blog community
EntityNameSprite in Robotics Developer Studio 2008

With the EntityNameSprite, we can display a text in the simulation window attached to our robots. The name is painted on a texture with a textureWidth and Height. We can set the font name and size. Finally we'll specify the Pose(location) of the display and the size in the simulator.

Using the EntityNameSprite 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 EntityNameSprite, and as a parent the "P3DXMotorBase"
  5. Set the (font) family to "Verdana"
  6. Fontsize to "36"
  7. Set Height and Width (e.g. 0.1 height and 0.6 width) for the simulated display
  8. textureHeight and textureWidth (e.g. 100 and 600)
  9. Set Initial Pos (0,1,0) is 1 meter above the parent
  10. Pivot Y-axis or Center to make the view visible while turning the robot
  11. Press "OK" and choose "Mode -> Run"

Using the EntityNameSprite from code

EntityNameSprite nameSprite = new EntityNameSprite(0.6f, 0.1f, 600, 100, SpritePivotType.Center, new Vector3(0, 1.0f, 0), "Verdana", 36);
nameSprite.State.Name = "myNameSprite";

Troubleshooting and tips

Only partial text is displayed: reduce font size or increase texture size.
Keep the ratio between texture height/width and height/width the same for the best result.
The "Pose" in the simulation "Entity -> New" screen is global, not relative to the robot. Move the robot to 0,0,0 and then insert for precise location.

back


Posted 01-08-2008 15:56 by Erik Oppedijk
Filed under:

Add a Comment

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