robotology / gz-sim-yarp-plugins

YARP plugins for Modern Gazebo (gz-sim).
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Single pendulum tutorial #84

Closed xela-95 closed 4 months ago

xela-95 commented 4 months ago

Single pendulum tutorial

This issue is meant to document how to run the single pendulum tutorial and what results to expect.

xela-95 commented 4 months ago

How to run the tutorial

  1. In a terminal execute the following commands:

    yarp server
  2. In a different terminal execute the following commands:

    cd <gz-sim-yarp-plugins_path>/tutorial/single_pendulum
    gz sim model.sdf

    The Gazebo GUI will open and the single pendulum should be already spawned in the scene. gz_gui

  3. In a different terminal execute the following commands:

    cd <gz-sim-yarp-plugins_path>/tutorial/single_pendulum
    yarpmotorgui

    The yarpmotorgui interface will open and it should automatically prompt you to select the /singlePendulumGazebo/body part.

    Click Ok.

yarpmotorgui_select_part

  1. Finally start the simulation in Gazebo (click on the Play button on the bottom left). The pendulum will start to swing freely since the default control mode is Idle.

Click on Idle and select Torque. A slider will appear on which it is possible to manually set the reference torque [Nm].

yarpmotorgui_torque

Here's an example of final result:

https://github.com/robotology/gz-sim-yarp-plugins/assets/57228872/396992b5-f627-447e-b6b9-e3a122819ef7