Gazebo | Ignition | Community
Ask Your Question
0

Trajectory animation for non-skeletal actors

asked 2022-02-28 19:38:22 -0600

lapyx gravatar image

Gazebo classic 11 supported actor class with trajectory with simpler object such as box, but now this function is not available in ignition gazebo. Relevant questions can also be found here; https://answers.gazebosim.org/questio... https://github.com/ignitionrobotics/i...

To elaborate this, the actor class works with human mesh provided from gazebo;

<actor name="actor_talking"> 
<skin>
 <filename>models://actor/meshes/talk_b.dae</filename>
 <scale>1.0</scale>
 </skin> 
<animation name="talk_b"> 
<filename>models://actor/meshes/talk_b.dae</filename>
 <scale>0.055</scale> 
<interpolate_x>true</interpolate_x> 
</animation>
 <script> 
<loop>true</loop> 
<auto_start>true</auto_start>
 <trajectory id="0" type="talk_b"> 
<waypoint>
 <time>0</time> 
<pose>2 -2 1.0 0 0 0</pose> 
</waypoint>
 <waypoint>
 <time>30</time>
 <pose>2 -2 1.0 0 0 0</pose> 
</waypoint> 
</trajectory> 
</script> 
</actor>

However, if I just replace this mesh file with a simple box object, I ended up with some error message below;

<actor name="actor_talking">
 <skin>
 <filename>models://actor/meshes/shapes.dae</filename>
 <scale>1.0</scale> 
</skin> 
<animation name="talk_b"> 
<filename>models://actor/meshes/shapes.dae</filename>
 <scale>0.055</scale>
 <interpolate_x>true</interpolate_x>
 </animation>
 <script> 
<loop>true</loop>
 <auto_start>true</auto_start> 
<trajectory id="0" type="talk_b">
 <waypoint> 
<time>0</time>
 <pose>2 -2 1.0 0 0 0</pose> 
</waypoint>
 <waypoint>
 <time>30</time> 
<pose>2 -2 1.0 0 0 0</pose> 
</waypoint> 
</trajectory>
 </script>
 </actor>

[GUI] [Err] [SceneManager.cc:944] Mesh skeleton in [models://actor/meshes/shapes.dae] not found.

I think this happens because the actor class requires a mesh skeleton in <skin> </skin>, which was not the case for gazebo classic.

I am attaching the working example code in gazebo classic for your reference. This only works in gazebo classic now. (relevant link)

 <?xml version="1.0" ?>
 <sdf version="1.6"> 
<world name="default"> 
<include>
 <uri>model://ground_plane</uri>
 </include>
 <include>
 <uri>model://sun</uri> 
</include> 
<actor name="animated_box">
 <link name="box_link"> 
<visual name="visual"> 
<geometry> 
<box> 
<size>.2 .2 .2</size> 
</box> 
</geometry>
 </visual>
 </link> 
<script>
 <loop>true</loop> 
<auto_start>true</auto_start> 
<trajectory id="0" type="square"> 
<waypoint>
 <time>0.0</time> 
<pose>-1 -1 1 0 0 0</pose> 
</waypoint> 
<waypoint>
 <time>1.0</time>
 <pose>-1 1 1 0 0 0</pose> 
</waypoint> <waypoint> 
<time>2.0</time> 
<pose>1 1 1 0 0 0</pose>
 </waypoint>
 <waypoint> 
<time>3.0</time>
 <pose>1 -1 1 0 0 0</pose>
 </waypoint> 
<waypoint>
 <time>4.0</time>
 <pose>-1 -1 1 0 0 0</pose> 
</waypoint>
 </trajectory> 
</script>
 </actor>
 </world> 
</sdf>

I am now working my simulation by artificially creating the animation mesh from blender, but this limits some features which are available from gazebo classic. e.g. Actor collision, 3d plot using dynamic marker (since we do not have a link object for actors)

Is there any workaround for this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-28 21:40:42 -0600

chapulina gravatar image

This feature hasn't been ported to Ignition yet. As a workaround, you could write a plugin that directly sets poses to the model over time using the ignition::common::PoseAnimation API, for example.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-02-28 19:38:22 -0600

Seen: 130 times

Last updated: Feb 28 '22