sot-talos-balance  2.0.5
Collection of dynamic-graph entities aimed at implementing balance control on talos.
test_jointTrajGen.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-1
3 import os
4 from time import sleep
5 
6 from dynamic_graph import plug
7 
9  create_joint_trajectory_generator,
10 )
11 
12 
13 def main(robot):
14  robot.timeStep = robot.device.getTimeStep()
15  dt = robot.timeStep
16 
17  robot.traj_gen = create_joint_trajectory_generator(dt, robot)
18  robot.device.control.value = 32 * [0.0]
19  plug(robot.traj_gen.dx, robot.device.control)
20 
21  sleep(1.0)
22  os.system("rosservice call /start_dynamic_graph")
23  sleep(1.0)
24  robot.traj_gen.move(31, -1.0, 1.0)
25  sleep(1.1)
26  robot.traj_gen.startSinusoid(31, 1.0, 2.0)
27  sleep(10.0)
28  robot.traj_gen.stop(31)