Gazebo | Ignition | Community
Ask Your Question

Collada Links/Bones In Gazebo?

asked 2017-02-12 15:58:32 -0500

mikec gravatar image

updated 2017-02-13 16:34:51 -0500

chapulina gravatar image

Hi all, this is a additional question I recently asked about Attaching A Sensor To An Animated Actor.

This is based on the tutorial Make an animated model (actor). I want to use a animated collada (a walking man) and attach a sensor to his foot. In an answer, chapulina answers that actors can have links attached, just like models do. He gives the example:

<link name="box_link">
  <sensor name="camera" type="camera">

This works to some degree. I can attach a small box (visually representing the sensor) at a pose relative to the actor. As the actor walks, the box moves with the actor. However, I need it to move relative to a point on the actors foot. In my case, the box moves relative to the origin of the actor, not a point on his foot.

I have noticed that when the animated actor is in Gazebo that there are links listed for the actor. For example, there are links for his hips, neck, right leg, right foot, etc.. I also noticed that if I import the actor (walk.dae) into Blender that these links appear as bones in Blender. So, taking chapulina's suggestion, I modified his example and used a link listed in Gazebo: the "RightFoot" link. When I put this in the world file and start Gazebo, I'm given the warning:

Warning [] XML Element[origin], child of element[joint] not defined in SDF. Ignoring[origin]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.

It appears to me that somehow the bones in Blender are loaded into the parameter server and Gazebo can see them. I do not list these in an SDF file anywhere, yet Gazebo sees them. If I try to insert a reference to one of these as a link for my actor in my world file I get an error message.

Can anyone explain this to me? If Gazebo sees these links (which are not defined in a SDF file), can I use one of these links and attach my sensor to this link? If so, how is this done?



Chapulina, thanks for the reply. I could not get an image into the comments section, so I used the answer section. Sorry if this is inappropriate.

From the image below, this is what I'm seeing: The white cube represents a visual for the sensor that I'm trying to attach to the foot. Currently, the sensor/box moves with the model, but does not move with the foot (which is what I want it to do). In the middle of the image (labeled "Gazebo"), I see the model has links that somehow are loaded into Gazebo. I do not have a URDF or SDF file that describes the model. In the world file, the actors "walk" and "animation" use the "walk.dae" file. If I import the "walk.dae" file ... (more)

edit retag flag offensive close merge delete


About the error message you're seeing, it looks like you're trying to mix URDF and SDF. Joints in SDF don't have an origin tag, they have a pose:

chapulina gravatar imagechapulina ( 2017-02-13 11:59:56 -0500 )edit

@mikec, I've moved your answer to the question under UPDATE ;)

chapulina gravatar imagechapulina ( 2017-02-13 16:36:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-02-13 16:48:03 -0500

chapulina gravatar image

Hi @mikec, thank you for the detailed question.

When Gazebo loads a COLLADA file, it extracts all the skeleton information then iterates through the bones creating a link for each one of them. If you're interested, this is the source code where this happens.

I've never tried accessing these links after they've been loaded, and I'm pretty sure this is not well tested, but I can imagine they should behave like any other links.

If I'd go about trying to attach something to a link, I wouldn't do it through the SDF file as you're trying. The reason is that the actor links might not exist yet when you add the joint. But I imagine it should be possible to access these links after the actor is first loaded. So I'd try programmatically attaching the sensor using a plugin.

edit flag offensive delete link more


Hi Chapulina, thanks again for replying and moving my question to an update (I did not know how to do this). This gives me a little better understanding of the process Gazebo uses while loading a collada model. For clarification, I am not using a SDF file to try and load a link, but was wondering if that should be the solution to my issue. I am attempting to use the actor tutorial and modify it slightly (as your original post suggested using a link). Thanks again

mikec gravatar imagemikec ( 2017-02-13 20:12:03 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-02-12 15:58:32 -0500

Seen: 657 times

Last updated: Feb 13 '17