The following examples show several of the features of the simulator.
To execute them, run the simlator and load the corresponding configuration file (cf. quick start).
Follow the path of the specific source code at play in the example for making one of your own! (cf. Developer's manual).
This first example shows how to control the Hoap3 robot in a position controlled mode.
Once the configuration is loaded in the simulator, you should:
a) run the simulation
(Ctrl-<Space> in the rendering window,
or Run command in the "Simulation" console)
b) Switch to the Hoap3 console (Alt-<2>)
c) Select a command to execute (use the tab key in the console to see all options)
d) Normally, you should be able to see the robot moving its arms.
Config file: $RKTROOT/config/Examples/Hoap3Basic.xml
Module source: $RKTROOT/src/examples/ExamplePositionControl
Same as above, but with the iCub robot (partial model only), and using the velocity control mode.
Once the configuration is loaded in the simulator, you should:
a) run the simulation
(Ctrl-<Space> in the rendering window,
or Run command in the "Simulation" console)
b) Switch to the iCub console (Alt-<2>)
c) Select a command to execute (use the tab key in the console to see all options)
d) Normally, you should be able to see the robot moving its arms.
Config file: $RKTROOT/config/Examples/iCubBasic.xml
Module source: $RKTROOT/src/examples/ExampleVelocityControl
Again as above, but with the WAM robot this time, and using the torque control mode.
Here, the control is done though a PID controller.
Importantly, torque control mode allows
the robot to interact with objects following the rule of physics, as shown in this example.
Once the configuration is loaded in the simulator, you should:
a) run the simulation
(Ctrl-<Space> in the rendering window,
or Run command in the "Simulation" console)
b) Switch to the WAM console (Alt-<2>)
c) Select a command to execute (use the tab key in the console to see all options)
d) Once the robot will start to move, the ball may move from its original position.
To place it back, you can reset the world
(Ctrl-<W> in the rendering window, or ResetWorld command in the "Simulation" console)
You can also try to reset everything, including the robot
(Ctrl-<R> in the rendering window, or ResetAll command in the "Simulation" console)
Config file: $RKTROOT/config/Examples/MyGolfExample.xml
Module source: $RKTROOT/src/examples/ExampleOpenLoopPIDControlModule
Again as above, but with two interconnected WAM robots this time.
Here, an object is located in space and will fall down on the plate firmly hold by the robots.
Each robot is controlled independently, and in this example, their controller simply consists of
a gravity compensator that can be turn on or off.
Once the configuration is loaded in the simulator, you should:
a) run the simulation
(Ctrl-<Space> in the rendering window,
or Run command in the "Simulation" console)
b) Switch to the WAM_0 or WAM_1 console (Alt-<2> or <3> )
c) Select a command to execute (use the tab key in the console to see all options)
d) Once the robot will start to move, the ball may move from its original position.
To place it back, you can reset the world
(Ctrl-<W> in the rendering window, or ResetWorld command in the "Simulation" console)
You can also try to reset everything, including the robot
(Ctrl-<R> in the rendering window, or ResetAll command in the "Simulation" console)
Config file: $RKTROOT/config/Examples/TwoWAMExample.xml
Module source: $RKTROOT/src/examples/ExampleGravityCompModule
This example show how to use the simultaneous inverse kinematics solver for
controlling the motion of the iCub robot.
This example shows how to control the 1) right arm cartesian position, 2) its orientation and
3) the head tracking in a hierarchical way (in this order of priority).
The world consists
of several targets, and the user can select to enable/disable the controllers
and to which target to reach for (it is defined in a file with respect to the one specified in the config file).
Once the configuration is loaded in the simulator, you should:
a) run the simulation
(Ctrl-<Space> in the rendering window,
or Run command in the "Simulation" console)
b) Switch to the iCub_IKDemo console (Alt-<2>)
c) Select a command to execute (use the tab key in the console to see all options)
d) As an example use, I would suggest:
e) Et voilĂ
Config file: $RKTROOT/config/Examples/InverseKinematics.xml
Module source: $RKTROOT/src/examples/ExampleInverseKinematics
Config file: $RKTROOT/config/Examples/AnotherWorld.xml
Module source: $RKTROOT/src/examples/ExampleWorldControlModule
Config file: $RKTROOT/config/Examples/ForceSensor.xml
Module source: $RKTROOT/src/examples/ExampleForceSensorModule
Config file: $RKTROOT/config/Examples/WorldNetworkServer.xml
Module source: $RKTROOT/src/examples/Network/WorldNetworkServer
Config file: $RKTROOT/config/Examples/WorldNetworkClient.xml
Module source: $RKTROOT/src/examples/Network/WorldNetworkClient