sot-talos-balance  2.0.5
Collection of dynamic-graph entities aimed at implementing balance control on talos.
appli_hip_flexibility_compensation.py
Go to the documentation of this file.
1 # flake8: noqa
2 import dynamic_graph.sot_talos_balance.talos.hip_flexibility_compensation_conf as hipFlexCompConfig
3 import dynamic_graph.sot_talos_balance.talos.parameter_server_conf as paramServerConfig
5 
6 robot.timeStep = robot.device.getTimeStep()
7 dt = robot.timeStep
8 
9 # --- EXPERIMENTAL SET UP ------------------------------------------------------
10 
11 device = "simu"
12 # WARNING : The device control type is set to NO INTEGRATION
13 # The control HAS TO BE in POSITION
14 robot.device.setControlInputType("noInteg")
15 N_JOINTS = 32
16 robot_name = "robot"
17 
18 # --- SET INITIAL CONFIGURATION ------------------------------------------------
19 
20 robot.halfSitting = [0.0, 0.0, 1.018213, 0.0, 0.0, 0.0] # Base
21 robot.halfSitting += [0.0, 0.0, -0.411354, 0.859395, -0.448041, -0.001708] # Left Leg
22 robot.halfSitting += [0.0, 0.0, -0.411354, 0.859395, -0.448041, -0.001708] # Right Leg
23 robot.halfSitting += [0.0, 0.006761] # Chest
24 robot.halfSitting += [
25  0.25847,
26  0.173046,
27  -0.0002,
28  -0.525366,
29  0.0,
30  0.0,
31  0.1,
32  -0.005,
33 ] # Left Arm
34 robot.halfSitting += [
35  -0.25847,
36  -0.173046,
37  0.0002,
38  -0.525366,
39  0.0,
40  0.0,
41  0.1,
42  -0.005,
43 ] # Right Arm
44 robot.halfSitting += [0.0, 0.0] # Head
45 robot.device.set(robot.halfSitting)
46 
47 # --- CREATE ENTITIES ----------------------------------------------------------
48 
49 robot.param_server = create_parameter_server(paramServerConfig, robot.timeStep)
50 
51 # --- HIP TASK ----------------------------------------------------------------
52 
54  robot, hipFlexCompConfig, robot_name
55 )
56 robot.hipComp.q_des.value = robot.halfSitting
57 
58 # --- PLUG CONTROL ----------------------------------------------------------------
59 # WARNING : Set the control to halfSitting position !
60 # Plug the hip_flexibility_compensation in the test file
61 robot.device.control.value = robot.halfSitting
62 
63 # # --- ROS PUBLISHER ----------------------------------------------------------
64 
65 robot.publisher = create_rospublish(robot, "robot_publisher")
66 create_topic(robot.publisher, robot.hipComp, "delta_q", robot=robot, data_type="vector")
67 create_topic(robot.publisher, robot.hipComp, "q_cmd", robot=robot, data_type="vector")
68 create_topic(robot.publisher, robot.hipComp, "q_des", robot=robot, data_type="vector")
69 create_topic(robot.publisher, robot.hipComp, "tau", robot=robot, data_type="vector")
71  robot.publisher, robot.hipComp, "tau_filt", robot=robot, data_type="vector"
72 )
create_entities_utils
sot_talos_balance.create_entities_utils.create_hip_flexibility_compensation
def create_hip_flexibility_compensation(robot, conf, robot_name="robot")
Definition: create_entities_utils.py:240
sot_talos_balance.create_entities_utils.create_topic
def create_topic(rospub, entity, signalName, robot=None, data_type="vector")
Definition: create_entities_utils.py:454
sot_talos_balance.create_entities_utils.create_parameter_server
def create_parameter_server(conf, dt, robot_name="robot")
Definition: create_entities_utils.py:619
sot_talos_balance.create_entities_utils.create_rospublish
def create_rospublish(robot, name)
Definition: create_entities_utils.py:446