1 """Test CoM admittance control as described in paper."""
5 import matplotlib.pyplot
as plt
7 from dynamic_graph.sot_talos_balance.utils.run_test_utils
import (
20 run_test(
"appli_dcmZmpControl_feedback.py")
23 input(
"Wait before running the test")
26 print(
"Connect ZMP reference")
27 runCommandClient(
"plug(robot.zmp_estimator.emergencyStop,robot.cm.emergencyStop_zmp)")
28 runCommandClient(
"plug(robot.dcm_control.zmpRef,robot.com_admittance_control.zmpDes)")
29 runCommandClient(
"robot.com_admittance_control.setState(comDes,[0.0,0.0,0.0])")
40 comDes_data = np.loadtxt(
44 comEst_data = np.loadtxt(
48 comRef_data = np.loadtxt(
49 "/tmp/dg_" +
evalCommandClient(
"robot.com_admittance_control.name") +
"-comRef.dat"
51 comSOT_data = np.loadtxt(
55 dcmDes_data = np.loadtxt(
58 dcmEst_data = np.loadtxt(
62 zmpDes_data = np.loadtxt(
65 zmpSOT_data = np.loadtxt(
68 zmpEst_data = np.loadtxt(
71 zmpRef_data = np.loadtxt(
78 plt.plot(comDes_data[:, 1],
"b--")
79 plt.plot(comEst_data[:, 1],
"b-")
80 plt.plot(comRef_data[:, 1],
"b:")
81 plt.plot(comSOT_data[:, 1],
"b-.")
82 plt.plot(comDes_data[:, 2],
"r--")
83 plt.plot(comEst_data[:, 2],
"r-")
84 plt.plot(comRef_data[:, 2],
"r:")
85 plt.plot(comSOT_data[:, 2],
"r-.")
86 plt.plot(comDes_data[:, 3],
"g--")
87 plt.plot(comEst_data[:, 3],
"g-")
88 plt.plot(comRef_data[:, 3],
"g:")
89 plt.plot(comSOT_data[:, 3],
"g-.")
109 plt.plot(dcmDes_data[:, 1],
"b--")
110 plt.plot(dcmEst_data[:, 1],
"b-")
111 plt.plot(dcmDes_data[:, 2],
"r--")
112 plt.plot(dcmEst_data[:, 2],
"r-")
114 plt.legend([
"Desired x",
"Estimated x",
"Desired y",
"Estimated y"])
117 plt.plot(zmpDes_data[:, 1],
"b--")
118 plt.plot(zmpSOT_data[:, 1],
"b-")
119 plt.plot(zmpRef_data[:, 1],
"b:")
120 plt.plot(zmpDes_data[:, 2],
"r--")
121 plt.plot(zmpSOT_data[:, 2],
"r-")
122 plt.plot(zmpRef_data[:, 2],
"r:")
124 plt.legend([
"Desired x",
"SOT x",
"Reference x",
"Desired y",
"SOT y",
"Reference y"])
126 zmpErrSOT = zmpSOT_data - zmpDes_data
129 plt.plot(zmpErrSOT[:, 1],
"b-")
130 plt.plot(zmpErrSOT[:, 2],
"r-")
131 plt.title(
"ZMP SOT error")
132 plt.legend([
"Error on x",
"Error on y"])
134 input(
"Wait before leaving the simulation")
def run_ft_calibration(sensor_name, force=False)
def evalCommandClient(code)
def run_test(appli, verbosity=1, interactive=True)