blog community
CameraSprite in Robotics Developer Studio 2008

Using the CameraSpriteEntity from the Visual Simulation Engine

  1. Start a simulation with a robot with a camera (for instance a Pioneer 3DX)
  2. Go to Edit mode (Mode menu, choose edit)
  3. Entity Menu -> New...
  4. Choose CameraSprite, and as a parent the "robocam"
  5. Set Height and Width (e.g. both to 0.5 meter)
  6. Set Initial Pos (0,1,0) is 1 meter above the parent
  7. Pivot Y-axis or Center to make the view visible while turning the robot
  8. Press "OK" and choose "Mode -> Run"

Using the CameraSpriteEntity from code

 

1
2
3
4
CameraSprite camSprite = new CameraSprite(0.5f, 0.5f, SpritePivotType.Center, 0, 
new Vector3(0, 1, 0));
camSprite.State.Name = "cameraSprite";
camera.InsertEntity(camSprite);

back


Posted 28-07-2008 16:19 by Erik Oppedijk
Filed under:

Comments

Duadou wrote re: CameraSprite in Robotics Developer Studio 2008
on 30-10-2008 10:23

How to add through XML?

Erik Oppedijk wrote re: CameraSprite in Robotics Developer Studio 2008
on 30-10-2008 18:08

It's a lot of XML, it's easier to create the sprite from code, and then save the simulation state to a file, then grad the following from the file:

<CameraSprite xmlns:sim="http://schemas.microsoft.com/robotics/2006/04/simulation.html" xmlns:physm="http://schemas.microsoft.com/robotics/2006/07/physicalmodel.html" xmlns:phys="http://schemas.microsoft.com/robotics/2006/04/simulation/physics.html" xmlns="http://schemas.microsoft.com/robotics/2006/04/simulationengine.html">

     <sim:State>

       <sim:Name>camSprite</sim:Name>

       <sim:Assets />

       <sim:Pose>

         <physm:Position>

           <physm:X>0</physm:X>

           <physm:Y>1</physm:Y>

           <physm:Z>0</physm:Z>

         </physm:Position>

         <physm:Orientation>

           <physm:X>0</physm:X>

           <physm:Y>0</physm:Y>

           <physm:Z>0</physm:Z>

           <physm:W>1</physm:W>

         </physm:Orientation>

       </sim:Pose>

       <sim:Velocity>

         <physm:X>0</physm:X>

         <physm:Y>0</physm:Y>

         <physm:Z>0</physm:Z>

       </sim:Velocity>

       <sim:AngularVelocity>

         <physm:X>0</physm:X>

         <physm:Y>0</physm:Y>

         <physm:Z>0</physm:Z>

       </sim:AngularVelocity>

       <sim:MassDensity>

         <phys:Mass>0</phys:Mass>

         <phys:InertiaTensor>

           <physm:X>0</physm:X>

           <physm:Y>0</physm:Y>

           <physm:Z>0</physm:Z>

         </phys:InertiaTensor>

         <phys:CenterOfMass>

           <physm:Position>

             <physm:X>0</physm:X>

             <physm:Y>0</physm:Y>

             <physm:Z>0</physm:Z>

           </physm:Position>

           <physm:Orientation>

             <physm:X>0</physm:X>

             <physm:Y>0</physm:Y>

             <physm:Z>0</physm:Z>

             <physm:W>0</physm:W>

           </physm:Orientation>

         </phys:CenterOfMass>

         <phys:Density>0</phys:Density>

         <phys:LinearDamping>0</phys:LinearDamping>

         <phys:AngularDamping>0</phys:AngularDamping>

       </sim:MassDensity>

       <sim:Flags>Dynamic</sim:Flags>

     </sim:State>

     <Flags>DisableBackfaceCulling</Flags>

     <ChildCount>0</ChildCount>

     <ReferenceFrame>Local</ReferenceFrame>

     <MeshScale>

       <physm:X>1</physm:X>

       <physm:Y>1</physm:Y>

       <physm:Z>1</physm:Z>

     </MeshScale>

     <MeshRotation>

       <physm:X>0</physm:X>

       <physm:Y>0</physm:Y>

       <physm:Z>0</physm:Z>

     </MeshRotation>

     <MeshTranslation>

       <physm:X>0</physm:X>

       <physm:Y>0</physm:Y>

       <physm:Z>0</physm:Z>

     </MeshTranslation>

     <Width>0.5</Width>

     <Height>0.5</Height>

     <TextureWidth>320</TextureWidth>

     <TextureHeight>240</TextureHeight>

     <PivotType>Center</PivotType>

     <CaptureInterval>0</CaptureInterval>

   </CameraSprite>

Duadou wrote re: CameraSprite in Robotics Developer Studio 2008
on 24-12-2008 9:06

Thank you, it's perfect!

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Powered by Community Server (Commercial Edition), by Telligent Systems