Gazebo | Ignition | Community
Ask Your Question

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

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

xito gravatar image


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

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

chapulina gravatar image

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.


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


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

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

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

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

Hey Chapulina, I just tried out your "plugin" unfortunaly, while the plugin loads and I can print out statements, the text doesn't show. If I click onto one of the models (lets say the sphere) I get a white box around it, which gets bigger if I increase the font size. But still there is no text showing. I run gazebo7 is there anything I am missing?

I can open a new question if you like me too, but maybe you can help me without me doint it. Maybe I have some plugins from gazebo not installed?

Jberg gravatar imageJberg ( 2019-08-06 06:02:35 -0500 )edit

I haven't looked into this plugin in a long time. It should work with gazebo7, I can't think of a reason for it not to be working at the moment.

chapulina gravatar imagechapulina ( 2019-08-06 12:35:00 -0500 )edit

Okay, Well thanks for the answer anyways.

Jberg gravatar imageJberg ( 2019-08-08 03:55:59 -0500 )edit

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


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

Question Tools

1 follower


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

Seen: 4,494 times

Last updated: Feb 29 '16