Home | Tutorials | Wiki | Issues
Ask Your Question
0

Is there a way to make Gazebo display the models name?

asked 2016-02-27 05:05:23 -0500

xito gravatar image

Hi,

I intend to simulate a robot race. Several robots are located in a circuit and they have to make their way out but, I can't figure out wich robot is in a certain position sice they are all the same model (turtlebots).

Is there a way to identify the robots in the simulator? Maybe display its name above them?

Thanks in advantage!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-02-29 11:22:36 -0500

updated 2016-02-29 23:04:23 -0500

You could write a plugin which attaches a MovableText to each model visual. A GUI or System plugin would probably be best, since you need access to rendering.

UPDATE

I got curious about this and decided to write a plugin myself. Here's the source code, and here's a video.

It should work if you clone the repository or copy the files and follow the build instructions in the README file. To use it with your world, just add the proper <gui> tag to your SDF file. You can customize the plugin for your needs, all it does now is attaching a name to every model in simulation.

edit flag offensive delete link more

Comments

Is there an easier solution? I'm afraid I'm not familiar with plugins :S

xito gravatar imagexito ( 2016-02-29 14:32:49 -0500 )edit
1

I actually got interested in this, so I can try putting together a simple plugin and you should be able to easily modify it for your needs. In any case, it could be nice to have an option to display model names on Gazebo from the GUI, maybe you can make a feature request.

chapulina gravatar imagechapulina ( 2016-02-29 14:37:32 -0500 )edit
1

I wrote a general plugin and updated the answer ;)

chapulina gravatar imagechapulina ( 2016-02-29 23:05:22 -0500 )edit

Wow that's what i needed!!! many thanks!! Now I'm giving it a try, I'll keep you updated! Thank you!!

xito gravatar imagexito ( 2016-03-01 01:12:43 -0500 )edit

I'm sorry I can't make it work. I'm using gazebo with ros hydro so, the version bundled with it is gazebo 1.9.6. When I try to compile your code it gives me a message: Fatal error GuiPlugin.hh does not exists. It seems this header file is not present in gazebo4 and earlier. Thank you again for your kind assistance.

xito gravatar imagexito ( 2016-03-01 01:29:19 -0500 )edit
1

Oh bummer... Well, I hope the plugin is useful for you or someone else in the future ;)

chapulina gravatar imagechapulina ( 2016-03-01 12:21:28 -0500 )edit

Sure! I cannot believe that feature is not implemented yet. Finally, I'm loading a different model (color) for each robot so we can spot them easily in the ciruit. Many thanks for your effort again!

xito gravatar imagexito ( 2016-03-01 14:03:58 -0500 )edit
0

answered 2016-02-28 11:10:42 -0500

xito gravatar image

It seems there is no way to do this.

Now I'm trying to load a different model (modified version of the same turtlebot model) in which I edited the 'top_stack' mesh assigning a different color to every robot.

edit flag offensive delete link more

Comments

Assigning a different color to each robot is a nice idea. But if you want to do it with text, there is a way ;)

chapulina gravatar imagechapulina ( 2016-02-29 11:23:44 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-02-27 05:05:23 -0500

Seen: 2,231 times

Last updated: Feb 29 '16