Home | Tutorials | Wiki | Issues
Ask Your Question

How does the information from a urdf-file get to the code in cpp-file?

asked 2013-10-09 08:04:46 -0500

annah.do gravatar image


I'm trying to understand how ros and gazebo work. I'm having a hard time with understanding how the information I specified in the urdf-file is used.

It seems that in urdf2gazebo.cpp the information is written to an object of type GazeboExtension. What I don't understand is what happens next. Like for example I set <laserRetro>0.9</laserRetro> in the urdf file and later the value appears in RayShape.cpp void SetRetro(float retro). But what are the steps in between? What is the file that actually calculates when a ray hits a surface?

I would be very thankful for any help I can get.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-10-10 10:42:43 -0500

nkoenig gravatar image

A URDF file is converted to SDF using the sdformat package. This SDF file is passed to Gazebo, which reads the values and creates the appropriate models. In your case laser retro values are in the SDF file and associated with collision objects in simulation.

Later, when simulation is running a laser beam can intersect an object. When this happens the beam reads the collision object's retro value.

If you're using the ODE physics engine, which is likely, then ODE calculates the intersection between a ray and a collision shape. You can look in the collision detection library inside ODE to find the code that determines object collisions.

edit flag offensive delete link more


Since I'm using gazebo 1.0.2 with ros there is no sdformat package. Any Idea where I could find the equivalent in my gazebo version?

annah.do gravatar imageannah.do ( 2013-10-11 07:07:56 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-10-09 08:04:46 -0500

Seen: 622 times

Last updated: Oct 10 '13