1 # Running the DDP on the right elbow joint of Pyrene
3 In the following, we demonstrate how to run a test with <a href="https://github.com/stack-of-tasks/sot-torque-control">sot-torque-control</a>, <a href="https://github.com/stack-of-tasks/ddp-actuator-solver">ddp-actuator-solver</a> and talos-torque-control.
5 ## Start the simulation
7 Start the simulation with the robot in the half-sitting position:
9 roslaunch talos_data talos_gazebo.launch start_half_sitting:=true
11 If you are on the real robot just ignore this step.
13 ## Start the SoT in torque mode
15 To start the SoT in simulation in torque mode:
17 roslaunch roscontrol_sot_talos sot_talos_controller_gazebo_effort.launch
20 To start the SoT on the real robot in torque mode:
22 roslaunch roscontrol_sot_talos sot_talos_controller_effort.launch
27 First of all, you need to go to the folder where your script is.
28 For running the ddp test of talos-torque-control, assuming you are in the root directory:
34 Then, you can just run the test, specifying that you are in simulation mode:
37 python test_ddp_sinu_effort.py simu
43 python test_ddp_sinu_effort.py robot
46 This will launch the test making the robot executing a sinusoid with its right arm (on the elbow joint) using the DDP solver.
47 This one computes a trajectory avoiding the limits in position, velocity and torque of the robot.
49 The script also saves the dynamic graph in /tmp/sot_ddp_talos_effort.pdf.
51 You can add loads on the arm of the robot and see how it will react: by degrading the sinusoid movement of its elbow to respect its limits.
53 To make the loads taken into account by the DDP formulation you should use the following commands:
56 rosrun dynamic_graph_bridge run_command
57 robot.ddp_ctrl.setLoadParam(30.0,-0.021481595, 0.10)
60 It will add a load of 30kg at the coordinates (-0.021481595, 0.10) with respect to the elbow joint (10cm ahead on the arm from the joint, almost centered).
62 To remove the load just run:
65 robot.ddp_ctrl.removeLoad()
70 More information on how to use the SoT and how to work on Talos can be found <a href="https://wiki.laas.fr/robots/Pyrene">in the robot wiki page</a> (you need LAAS permissions to access this).