sot-talos-balance  2.0.5
Collection of dynamic-graph entities aimed at implementing balance control on talos.
test_dcmZmpControl_file.py
Go to the documentation of this file.
1 """Test CoM admittance control as described in paper, with pre-loaded movements"""
2 from sys import argv
3 
4 from dynamic_graph.sot_talos_balance.utils.run_test_utils import (
5  ask_for_confirmation,
6  run_ft_calibration,
7  run_test,
8  runCommandClient,
9 )
10 
11 try:
12  # Python 2
13  input = raw_input # noqa
14 except NameError:
15  pass
16 
17 test_folder = argv[1] if len(argv) > 1 else "TestKajita2003WalkingOnSpot64/DSP20SSP780"
18 print("Using folder " + test_folder)
19 
20 runCommandClient('test_folder = "' + test_folder + '"')
21 
22 run_test("appli_dcmZmpControl_file.py")
23 
24 run_ft_calibration("robot.ftc")
25 input("Wait before running the test")
26 
27 # Connect ZMP reference and reset controllers
28 print("Connect ZMP reference")
29 runCommandClient("plug(robot.zmp_estimator.emergencyStop,robot.cm.emergencyStop_zmp)")
30 runCommandClient("plug(robot.dcm_control.zmpRef,robot.com_admittance_control.zmpDes)")
32  "robot.com_admittance_control.setState(robot.wp.comDes.value,[0.0,0.0,0.0])"
33 )
34 runCommandClient("robot.com_admittance_control.Kp.value = Kp_adm")
35 runCommandClient("robot.dcm_control.resetDcmIntegralError()")
36 runCommandClient("robot.dcm_control.Ki.value = Ki_dcm")
37 
38 c = ask_for_confirmation("Execute trajectory?")
39 if c:
40  print("Executing the trajectory")
41  runCommandClient("robot.triggerTrajGen.sin.value = 1")
42 else:
43  print("Not executing the trajectory")
44 
45 input("Wait before dumping the data")
46 
47 runCommandClient("dump_tracer(robot.tracer)")
sot_talos_balance.utils.run_test_utils.runCommandClient
runCommandClient
Definition: run_test_utils.py:23
sot_talos_balance.utils.run_test_utils.ask_for_confirmation
def ask_for_confirmation(text)
Definition: run_test_utils.py:110
sot_talos_balance.test.test_dcmZmpControl_file.input
input
Definition: test_dcmZmpControl_file.py:13
sot_talos_balance.utils.run_test_utils.run_ft_calibration
def run_ft_calibration(sensor_name, force=False)
Definition: run_test_utils.py:118
sot_talos_balance.utils.run_test_utils.run_test
def run_test(appli, verbosity=1, interactive=True)
Definition: run_test_utils.py:83