Pursuit Camera

Glossary Item Box

Microsoft Robotics Developer Studio Send feedback on this topic

Pursuit Camera

The PursuitCamera sample is a camera that automatically follows a simulation entity.

This sample is provided in the C# language. You can find the project files for this sample at the following location under the Microsoft Robotics Developer Studio installation folder:

Samples\Simulation\PursuitCamera

Contents:

  • Setting Up the Sample
  • Running the Sample

Prerequisites

Hardware

This sample requires no special hardware apart from a suitable graphics card to run the Simulator.

Software

This software is designed to run with Microsoft Robotics Developer Studio.

Setting Up the Sample

The PursuitCamera service is installed automatically with RDS. There is a VPL example associated with it.

Running the Sample

To view the PursuitCamera sample, start VPL and open the Simulated Four By Four example in the samples\VPLExamples folder.

Once the simulation is running, select the Pursuit Camera from the Camera menu. You can display the output in a separate window if you wish and keep the main camera view in the Simulator window.

Pursuit Camera

Pursuit Camera - Sample view

The Pursuit Camera consists of two components: a simulation entity and a service. You do not need to start the service to use the camera in the Simulator, but your application must programmatically add a Pursuit Camera entity.

The pursuit camera moves relative to the simulation entity being pursued and it tends to swing around as the entity moves.

You can set the initial values of the camera using a config file. The service has one operation ChangeSettings. The parameters are as shown below. The default values are also listed.

Parameter Default Value Description
MinDistance 4 Minimum distance to keep the camera from the entity
MaxDistance 6 Maximum distance to keep the camera from the entity
Altitude 2 Height above the ground plane to keep the camera
OcclusionThreshold 0.5 Threshold distance from the target position that is considered to be occlusion
PreventOcclusion true If true, try to prevent the view from the camera to the target from being occluded by obstacles
FieldOfView 45 Camera vertical resolution in degrees

By default, the camera entity name is PursuitCamera.

Summary

This sample covered the following:

  • Setting Up the Sample
  • Running the Sample

 

 

© 2012 Microsoft Corporation. All Rights Reserved.