Gazebo | Ignition | Community
Ask Your Question

How to drawn dash lines or points on simulator?

asked 2016-07-27 23:24:35 -0600

avlara gravatar image

Hi everyone,

My main reason to use the Gazebo is to test the design of advanced control loop. For comparative visual results, I need to draw points or dash lines (or just lines) where the robot should have pass and where it actually went in running time.

  • Anyone has already done something like it?

  • What type of plugin must I create?

  • What class will help me to design this functionality?

Some examples are welcome!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-07-28 15:27:29 -0600

This is really something better suited for RViz. It might be possible to do in gazebo, but it won't be easy or fun. The closest thing I can think of would be a visual plugin. You can see an example of using a visual plugin to change the color of a link here:



As well another more complex usage here:



But again, I encourage you to look at RViz instead, because gazebo visualization controls are incredibly crude. Simple lines or points won't be trivial and you won't find any example code

edit flag offensive delete link more


Thanks for you answer! Sorry, I didn't express well. My project is bigger than I said and, in this step, I'm using the simulator just to test control loops. But, in the future, someone will develop others features like algorithms of motion planning, maps and obstacles in the scene and so on. Besides that, we chose use ROS to communicate with other systems. Due to this, Gazebo is better than Rviz for our purpose.

avlara gravatar imageavlara ( 2016-07-29 16:47:10 -0600 )edit

Your code will help me a lot! I saw in the second example that you create boxes and their visual features in the world plugin in running time. Do you know if these boxes are statics?

avlara gravatar imageavlara ( 2016-07-29 16:47:26 -0600 )edit

Gazebo and RViz are not mutually exclusive. They should both be used together. Especially if you're using ROS. Is for my maze example, the maze itself is generated statically at run time. The dots are actually part of a separate project that you can view here: This shows how publishing visual messages can let you show primitive shapes (in this case cylinder)

Peter Mitrano gravatar imagePeter Mitrano ( 2016-07-30 00:48:07 -0600 )edit

answered 2016-07-29 16:30:18 -0600

nkoenig gravatar image

You can create a VisualPlugin. Here is an example.

edit flag offensive delete link more


I didn't know that Visual plugin exists. Where must I call the plugin? World file? Model File?

avlara gravatar imageavlara ( 2016-07-29 16:58:58 -0600 )edit

The example I posted shows a visual plugin (the first set of links). It's not well advertised and there are no tutorials so that will be your best reference

Peter Mitrano gravatar imagePeter Mitrano ( 2016-07-30 00:48:39 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-07-27 23:24:35 -0600

Seen: 1,691 times

Last updated: Jul 29 '16