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 
3 from sys import argv
4 
5 from dynamic_graph.sot_talos_balance.utils.run_test_utils import (
6  ask_for_confirmation,
7  run_ft_calibration,
8  run_test,
9  runCommandClient,
10 )
11 
12 try:
13  # Python 2
14  input = raw_input # noqa
15 except NameError:
16  pass
17 
18 test_folder = argv[1] if len(argv) > 1 else "TestKajita2003WalkingOnSpot64/DSP20SSP780"
19 print("Using folder " + test_folder)
20 
21 runCommandClient('test_folder = "' + test_folder + '"')
22 
23 run_test("appli_dcmZmpControl_file.py")
24 
25 run_ft_calibration("robot.ftc")
26 input("Wait before running the test")
27 
28 # Connect ZMP reference and reset controllers
29 print("Connect ZMP reference")
30 runCommandClient("plug(robot.zmp_estimator.emergencyStop,robot.cm.emergencyStop_zmp)")
31 runCommandClient("plug(robot.dcm_control.zmpRef,robot.com_admittance_control.zmpDes)")
33  "robot.com_admittance_control.setState(robot.wp.comDes.value,[0.0,0.0,0.0])"
34 )
35 runCommandClient("robot.com_admittance_control.Kp.value = Kp_adm")
36 runCommandClient("robot.dcm_control.resetDcmIntegralError()")
37 runCommandClient("robot.dcm_control.Ki.value = Ki_dcm")
38 
39 c = ask_for_confirmation("Execute trajectory?")
40 if c:
41  print("Executing the trajectory")
42  runCommandClient("robot.triggerTrajGen.sin.value = 1")
43 else:
44  print("Not executing the trajectory")
45 
46 input("Wait before dumping the data")
47 
48 runCommandClient("dump_tracer(robot.tracer)")
def run_ft_calibration(sensor_name, force=False)
def run_test(appli, verbosity=1, interactive=True)