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">
<camera>
</camera>
<visualize>true</visualize>
</sensor>


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 [parser.cc:778] 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?

Thanks

UPDATE

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 ...

edit retag 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: http://sdformat.org/spec?ver=1.6&elem=joint#joint_pose

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

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

Sort by » oldest newest most voted

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.

more