Robotics StackExchange | Archived questions

Showing visual element in Gazebo that has no physics from ROS node?

Hello everybody

I'm wondering is there a way to add simple geometry shapes (e.g. sphere and line) from a running ROS node?

I have a humanoid robot that walks successfully and I want to visualize, COG, ZMP and support convex hull in gazebo GUI. Currently I have a node that computes the location of COG and ZMP in each time step, and all I want is to draw two sphere in gazebo that coincide with ZMP and COG location.

Thanks for your attention

Asked by Masoud on 2016-11-02 06:12:52 UTC

Comments

Answers

The common way of doing what you're talking about is to add shapes and stuff for development in RViz, not Gazebo.

Gazebo is the physics simulator, you can think of it as the real world with a real robot in it. In Gazebo, you should only see what you would see if you were looking at your real robot (you wouldn't see it's center of gravity).

RViz is a visualization tool that is made for this kind of thing. In RViz, you can see any data that your robot "sees" or knows about. Gazebo outputs information about the robot's sensors (i.e. joint angles) like a real robot would, which allows you visualize how robot thinks it is posed in RViz (by viewing the RobotModel in RViz). Then you can add things like center of gravity, velocity vectors, etc as lines, spheres, etc (these are called markers). Here are some tutorials on how to do that last part.

Asked by Airuno2L on 2016-11-02 07:21:12 UTC

Comments

Take a look at the gazebo/spawn_sdf_modelrosservice, which takes a SpawnModel. You would create a short sdf string that creates a sphere with your desired properties (similar to the xml string in http://gazebosim.org/tutorials?tut=plugins_world, but the surrounding gazebo api stuff isn't needed). Leave out any <collision>. <kinematic>true</kinematic> isn't supported yet, I'm not sure if <gravity>false</gravity>is needed.

Every time you calculate a new sphere location you would call the set_model_state service to set the position of the sphere.

I'm going through something similar right now and will update this in a few hours.

Asked by lucasw on 2016-11-03 10:59:03 UTC

Comments