ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Display time in Gazebo rendering frame for export, use MovableText? [closed]

asked 2012-02-06 02:18:49 -0600

Tim Assman gravatar image

I want to export frames from Gazebo with timestamps of the simulation time at which they are captured, like this screenshot (made in Webots)

image description

To capture the frames, I can use the <saveframes> option of the rendering camera in the world file. But my frames are in greyscale and skewed, just as others reported.

I followed the instructions to use glc and it works fine. Now if I can display the simulation time in the rendering area, I'm done. I can't make up the simulation time from the image filename, because the simulation has to start paused and I don't know at what time the user unpaused it.

For rviz you can use markers to create view-oriented text. I discovered that for two years there are plans to make something similar for Gazebo, but I found nothing implemented.

I see there is a function MovableText in Ogre, the headerfile is in my case located in my ROS directory

/opt/ros/electric/stacks/simulator_gazebo/gazebo/gazebo/include/gazebo/OgreMovableText.hh

with more details of the functions online. I found an example of how it should be used in an old version of OgreCreator.cc:

383     OgreMovableText* msg = new OgreMovableText();
384     try
385     {
386       msg->Load(name, text,"Arial",0.08);
387     }
388     catch (Ogre::Exception e)
389     {
390       std::ostringstream stream;
391       stream <<  "Unable to create the text. " << e.getDescription() <<std::endl;
392       gzthrow(stream.str() );
393     }
394     msg->SetTextAlignment(OgreMovableText::H_CENTER, OgreMovableText::V_ABOVE);
395 
396     Ogre::SceneNode *textNode = OgreAdaptor::Instance()->sceneMgr->getRootSceneNode()->createChildSceneNode(std::string(name)+"_node");
397 
398     textNode->attachObject(msg);
399     textNode->translate(0, y, 0.02);

I am trying to acces this function from my realtime joint controller plugin so I include OgreAdaptor.hh, OgreCreator.hh and OgreMovableText.hh to my source and add their location to include_directories in CMakeLists.txt, and then try to reproduce the above, but I get a lot of errors related to Ogre. I don't think it is useful to post them here, because it is probably not even possible the way I'm doing this. Anybody an idea?

As far as I know, glc can only capture the rendering area of the gazebo window. If the above doesn't work, I will try to capture the whole gazebo window instead of only the rendering area with a program different from glc, then I have also the simulation time at the bottom of the pictures, which is less nice for a presentation.

image description

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant. Please see http://wiki.ros.org/Support for more details. by 130s
close date 2013-01-15 11:46:25

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-01-15 11:46:14 -0600

130s gravatar image

As announced by the developers in Sep 2012, all gazebo related questions should be asked on new gazebo specific QA community. Thank you for your cooperation!

See also this thread.

Apologies that I close as "off-topic" although it's actually very related - there isn't more suitable label.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-02-06 02:18:49 -0600

Seen: 620 times

Last updated: Jan 15 '13