Display time in Gazebo rendering frame for export, use MovableText?
I want to export frames from Gazebo with timestamps of the simulation time at which they are captured, like this screenshot (made in Webots)
To capture the frames, I can use the
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.
Asked by Tim Assman on 2012-02-06 03:18:49 UTC
Answers
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.
Asked by 130s on 2013-01-15 12:46:14 UTC
Comments