Is there a way to give initial velocity or force to the model in the gazebo?

Operating environment
ROS 2 Humble
Ignition Gazebo (Fortress)
SDF version 1.8

I wanna move the cylinder without power on the Ignition Gazebo.
e.g. How to give speed information to objects without wheels or links, etc.

Thank you for your cooperation.

1 Like

This is possible interactively from Gazebo Harmonic: See the release notes Gazebo Harmonic Release 🎵 (MouseDrag plugin). There also used to be plugins called InitialVelocity or similar, that could be added to the SDF. But I don’t remember exactly the details.

Thank you for answering
In Ignition versions before Gazebo harmonic, it is not possible to set the initial speed.

The SDF plugin was probably implemented in classic.

You can also test the new Python API. It could allow you to quickly test various things.

1 Like

Thank you for taking the time to ansewer with me!

I will search about Gazebo Harmonic and consider migrating.

By now, I found the way to give force to the model in ignition gazebo.
I’ll share it, how to method.

add plugin in sdf.

    <plugin
      filename="gz-sim-apply-link-wrench-system"
      name="gz::sim::systems::ApplyLinkWrench">
      <persistent>
        <entity_name>cylindar</entity_name>
        <entity_type>model</entity_type>
        <force>-10 0 0</force>
        <torque>0 0 0.1</torque>
      </persistent>
    </plugin>

or, add plugin in sdf

    <plugin
      filename="gz-sim-apply-link-wrench-system"
      name="gz::sim::systems::ApplyLinkWrench">
      <persistent>
        <entity_type>model</entity_type>
        <force>-10 0 0</force>
        <torque>0 0 0.1</torque>
      </persistent>
    </plugin>

finally, input in following command incommand line.

ign topic -t “/world/$world_name$/wrench” -m ignition.msgs.EntityWrench -p "entity: {name: ‘$model_name$’, type: MODEL}, wrench: {force: {x: 20000, y:100}}”

reference

https://gazebosim.org/api/sim/8/classgz_1_1sim_1_1systems_1_1ApplyLinkWrench.html

Thank you for your cooperation!