Start actor trajectory from plugin

asked 2023-08-01 04:23:30 -0500

nahan-chbt gravatar image


I'm new to plugin development in Gazebo, i am trying to start an Actor trajectory from a Plugin during simulation execution.

I added a simple actor in my world description (sdf file).

Like this :

<actor name="animated_box">
  <link name="link">
    <visual name="visual">
          <size>.2 .2 .2</size>
    <trajectory id="0" type="square">
      <pose>-1 -1 1 0 0 0</pose>

This actor is working well, but my needs is to start the trajectory from a plugin, in PreUpdate function.

For doing this i get the actor object from EntityComponentManager like this :

auto targetActorComponent = _ecm.Component<sim::components::Actor>(

And i can access functions like :


But these does not affect the trajectory of the actor at all.

I also tried to reload the component after making changes, but same result.


I probably misunderstood how this component works and how to modify its parameters.

How should I go about it? I couldn't find any examples.

Thanks in advance

edit retag flag offensive close merge delete