Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tsid balancing/tuning #904

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BSD-3-Clause license. -->
</group>

<group name="ExogenousSignals">
<param name="vectors_collection_exogenous_inputs">("Walking", "CurrentControl")</param>
<param name="vectors_collection_exogenous_inputs">("Walking", "CurrentControl", "BalancingTSID")</param>
<param name="vectors_exogenous_inputs">()</param>

<group name="Walking">
Expand All @@ -33,6 +33,13 @@ BSD-3-Clause license. -->
<param name="signal_name">"current_control"</param>
<param name="carrier">"udp"</param>
</group>

<group name="BalancingTSID">
<param name="local">"/yarp-robot-logger/exogenous_signals/balancing_tsid"</param>
<param name="remote">"/balancing_torque_controller/logger"</param>
<param name="signal_name">"balancing_tsid"</param>
<param name="carrier">"udp"</param>
</group>
</group>

<group name="RobotCameraBridge">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<?xml version="1.0" encoding="UTF-8" ?>

<devices>
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm_ft_client" type="multipleanalogsensorsclient">
<!-- <device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm_ft_client" type="multipleanalogsensorsclient">
<param name="remote">/ergocub/left_arm/FT</param>
<param name="local">/yarp_robot_logger/left_arm</param>
<param name="timeout">0.5</param>
Expand All @@ -16,7 +16,7 @@
<param name="local">/yarp_robot_logger/right_arm</param>
<param name="timeout">0.5</param>
<param name="carrier">fast_tcp</param>
</device>
</device> -->

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg_ft_client" type="multipleanalogsensorsclient">
<param name="remote">/ergocub/left_leg/FT</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</device>


<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm_imu_client" type="multipleanalogsensorsclient">
<!-- <device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm_imu_client" type="multipleanalogsensorsclient">
<param name="remote">/ergocub/left_arm/imu</param>
<param name="local">/yarp_robot_logger/left_arm/imu</param>
<param name="timeout">0.5</param>
Expand All @@ -33,7 +33,7 @@
<param name="local">/yarp_robot_logger/right_arm/imu</param>
<param name="timeout">0.5</param>
<param name="carrier">fast_tcp</param>
</device>
</device> -->

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_foot_imu_client" type="multipleanalogsensorsclient">
<param name="remote">/ergocub/left_foot_heel_tiptoe/imu</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="mas-remapper" type="multipleanalogsensorsremapper">
<param name="period">10</param>
<param name="ThreeAxisGyroscopesNames">
(waist_imu_0, l_arm_ft_imu, r_arm_ft_imu, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)
(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)
</param>
<param name="ThreeAxisLinearAccelerometersNames">
(waist_imu_0, l_arm_ft_imu, r_arm_ft_imu, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)
(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)
</param>
<param name="ThreeAxisMagnetometersNames">
(waist_imu_0, l_arm_ft_imu, r_arm_ft_imu, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)
(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)
</param>
<param name="OrientationSensorsNames">
(waist_imu_0, l_arm_ft_imu, r_arm_ft_imu, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)
(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)
</param>
<param name="SixAxisForceTorqueSensorsNames">
(l_foot_front_ft, l_foot_rear_ft, r_foot_front_ft, r_foot_rear_ft, l_leg_ft, r_leg_ft, r_arm_ft, l_arm_ft)
(l_foot_front_ft, l_foot_rear_ft, r_foot_front_ft, r_foot_rear_ft, l_leg_ft, r_leg_ft)
</param>
<param name="TemperatureSensorsNames">
(l_foot_front_ft, l_foot_rear_ft, r_foot_front_ft, r_foot_rear_ft, l_leg_ft, r_leg_ft, r_arm_ft, l_arm_ft)
(l_foot_front_ft, l_foot_rear_ft, r_foot_front_ft, r_foot_rear_ft, l_leg_ft, r_leg_ft)
</param>

<action phase="startup" level="5" type="attach">
<paramlist name="networks">
<elem name="left_arm_ft_client">left_arm_ft_client</elem>
<elem name="right_arm_ft_client">right_arm_ft_client</elem>
<!-- <elem name="left_arm_ft_client">left_arm_ft_client</elem>
<elem name="right_arm_ft_client">right_arm_ft_client</elem> -->
<elem name="left_leg_ft_client">left_leg_ft_client</elem>
<elem name="right_leg_ft_client">right_leg_ft_client</elem>
<!--elem name="head_imu_acc">head_imu_acc</elem-->
<elem name="waist_imu_client">waist_imu_client</elem>
<elem name="left_arm_imu_client">left_arm_imu_client</elem>
<elem name="right_arm_imu_client">right_arm_imu_client</elem>
<!-- <elem name="left_arm_imu_client">left_arm_imu_client</elem>
<elem name="right_arm_imu_client">right_arm_imu_client</elem> -->
<elem name="left_foot_imu_client">left_foot_imu_client</elem>
<elem name="right_foot_imu_client">right_foot_imu_client</elem>
<elem name="left_leg_imu_client">left_leg_imu_client</elem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

<devices>

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm_wrench_client" type="genericSensorClient">
<!-- <device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm_wrench_client" type="genericSensorClient">
<param name="remote">/wholeBodyDynamics/left_arm/cartesianEndEffectorWrench:o</param>
<param name="local">/yarp_robot_logger/left_arm_wrench</param>
<param name="carrier">udp</param>
</device>
</device> -->

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg_wrench_client" type="genericSensorClient">
<!-- <device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg_wrench_client" type="genericSensorClient">
<param name="remote">/wholeBodyDynamics/left_leg/cartesianEndEffectorWrench:o</param>
<param name="local">/yarp_robot_logger/left_leg_wrench</param>
<param name="carrier">udp</param>
</device>
</device> -->

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_front_wrench_client" type="genericSensorClient">
<param name="remote">/wholeBodyDynamics/left_foot_front/cartesianEndEffectorWrench:o</param>
Expand All @@ -29,17 +29,17 @@
<param name="carrier">udp</param>
</device>

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm_wrench_client" type="genericSensorClient">
<!-- <device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm_wrench_client" type="genericSensorClient">
<param name="remote">/wholeBodyDynamics/right_arm/cartesianEndEffectorWrench:o</param>
<param name="local">/yarp_robot_logger/right_arm_wrench</param>
<param name="carrier">udp</param>
</device>
</device> -->

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg_wrench_client" type="genericSensorClient">
<!-- <device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg_wrench_client" type="genericSensorClient">
<param name="remote">/wholeBodyDynamics/right_leg/cartesianEndEffectorWrench:o</param>
<param name="local">/yarp_robot_logger/right_leg_wrench</param>
<param name="carrier">udp</param>
</device>
</device> -->

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_front_wrench_client" type="genericSensorClient">
<param name="remote">/wholeBodyDynamics/right_foot_front/cartesianEndEffectorWrench:o</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BSD-3-Clause license. -->
<xi:include href="blf-yarp-robot-logger-interfaces/ft_clients.xml" />
<xi:include href="blf-yarp-robot-logger-interfaces/mas-remapper.xml" />
<xi:include href="blf-yarp-robot-logger-interfaces/wrench_clients.xml" />
<xi:include href="blf-yarp-robot-logger-interfaces/webcams.xml" />
<!-- <xi:include href="blf-yarp-robot-logger-interfaces/webcams.xml" /> -->
<xi:include href="./yarp-robot-logger.xml" />
</devices>
</robot>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BSD-3-Clause license. -->
<?xml version="1.0" encoding="UTF-8" ?>
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="yarp-robot-logger" type="YarpRobotLoggerDevice">
<param name="robot">ergocub</param>
<param name="sampling_period_in_s">0.01</param>
<param name="sampling_period_in_s">0.001</param>

<param name="rgb_cameras_fps">(20)</param>
<param name="rgb_cameras_rgb_save_mode">("video")</param>
Expand All @@ -30,7 +30,7 @@ BSD-3-Clause license. -->
</group>

<group name="ExogenousSignals">
<param name="vectors_collection_exogenous_inputs">("Walking", "GridTracking","cmw", "Balancing", "CurrentControl")</param>
<param name="vectors_collection_exogenous_inputs">("Walking", "GridTracking","cmw", "Balancing", "CurrentControl", "TSID", "BalancingTSID")</param>
<param name="vectors_exogenous_inputs">()</param>

<group name="Walking">
Expand Down Expand Up @@ -61,6 +61,20 @@ BSD-3-Clause license. -->
<param name="carrier">"udp"</param>
</group>

<group name="TSID">
<param name="local">"/yarp-robot-logger/exogenous_signals/tsid_fixed_cartesian"</param>
<param name="remote">"/tsid-fixed-cartesian/logger"</param>
<param name="signal_name">"tsid_fixed_cartesian"</param>
<param name="carrier">"udp"</param>
</group>

<group name="BalancingTSID">
<param name="local">"/yarp-robot-logger/exogenous_signals/balancing_tsid"</param>
<param name="remote">"/balancing_torque_controller/logger"</param>
<param name="signal_name">"balancing_tsid"</param>
<param name="carrier">"udp"</param>
</group>

<group name="RobotDynamicsEstimator">
<param name="local">"/yarp-robot-logger/exogenous_signals/rde"</param>
<param name="remote">"/robot-dynamics-estimator/logger"</param>
Expand All @@ -77,7 +91,7 @@ BSD-3-Clause license. -->
</group>

<group name="RobotCameraBridge">
<param name="stream_cameras">true</param>
<param name="stream_cameras">false</param>
<group name="Cameras">
<param name="rgb_cameras_list">("jabra")</param>
<param name="rgbd_cameras_list">()</param>
Expand All @@ -100,22 +114,22 @@ BSD-3-Clause license. -->
</group>

<group name="SixAxisForceTorqueSensors">
<param name="sixaxis_forcetorque_sensors_list">(l_foot_front_ft, l_foot_rear_ft, r_foot_front_ft, r_foot_rear_ft, l_leg_ft, r_leg_ft, r_arm_ft, l_arm_ft)</param>
<param name="sixaxis_forcetorque_sensors_list">(l_foot_front_ft, l_foot_rear_ft, r_foot_front_ft, r_foot_rear_ft, l_leg_ft, r_leg_ft)</param>
</group>

<group name="TemperatureSensors">
<param name="temperature_sensors_list">(l_foot_front_ft, l_foot_rear_ft, r_foot_front_ft, r_foot_rear_ft, l_leg_ft, r_leg_ft, r_arm_ft, l_arm_ft)</param>
<param name="temperature_sensors_list">(l_foot_front_ft, l_foot_rear_ft, r_foot_front_ft, r_foot_rear_ft, l_leg_ft, r_leg_ft)</param>
</group>

<group name="CartesianWrenches">
<param name="cartesian_wrenches_list">("left_front_wrench_client", "left_rear_wrench_client", "right_front_wrench_client", "right_rear_wrench_client", "left_arm_wrench_client", "right_arm_wrench_client", "left_leg_wrench_client", "right_leg_wrench_client")</param>
<param name="cartesian_wrenches_list">("left_front_wrench_client", "left_rear_wrench_client", "right_front_wrench_client", "right_rear_wrench_client")</param>
</group>

<group name="InertialSensors">
<param name="accelerometers_list">(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu, r_arm_ft_imu, l_arm_ft_imu)</param>
<param name="gyroscopes_list">(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu, r_arm_ft_imu, l_arm_ft_imu)</param>
<param name="magnetometers_list">(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu, r_arm_ft_imu, l_arm_ft_imu)</param>
<param name="orientation_sensors_list">(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu, r_arm_ft_imu, l_arm_ft_imu)</param>
<param name="accelerometers_list">(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)</param>
<param name="gyroscopes_list">(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)</param>
<param name="magnetometers_list">(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)</param>
<param name="orientation_sensors_list">(waist_imu_0, l_foot_front_ft_imu, l_foot_rear_ft_imu, r_foot_front_ft_imu, r_foot_rear_ft_imu, l_leg_ft_imu, r_leg_ft_imu)</param>
</group>

</group>
Expand All @@ -128,13 +142,13 @@ BSD-3-Clause license. -->
<elem name="left_rear_wrench_client">left_rear_wrench_client</elem>
<elem name="right_front_wrench_client">right_front_wrench_client</elem>
<elem name="right_rear_wrench_client">right_rear_wrench_client</elem>
<elem name="right_leg_wrench_client">right_leg_wrench_client</elem>
<elem name="left_leg_wrench_client">left_leg_wrench_client</elem>
<elem name="right_arm_wrench_client">right_arm_wrench_client</elem>
<elem name="left_arm_wrench_client">left_arm_wrench_client</elem>
<!-- <elem name="right_leg_wrench_client">right_leg_wrench_client</elem> -->
<!-- <elem name="left_leg_wrench_client">left_leg_wrench_client</elem> -->
<!-- <elem name="right_arm_wrench_client">right_arm_wrench_client</elem>
<elem name="left_arm_wrench_client">left_arm_wrench_client</elem> -->
<elem name="mas-remapper">mas-remapper</elem>
<!-- <elem name="realsense">realsense</elem> -->
<elem name="jabra">jabra</elem>
<!-- <elem name="jabra">jabra</elem> -->
</paramlist>
</action>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
dt 0.01 # (0.01 seconds)
contact_force_threshold 0.1 # in Newton


com_knots_delta_x (0.0, 0.0, 0.03, 0.03, -0.03, -0.03, 0.0, 0.0) # in meter
com_knots_delta_y (0.0, 0.05, 0.05, -0.05, -0.05, 0.05, 0.05, 0.0) # in meter
com_knots_delta_z (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) # in meter

; com_knots_delta_x (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) # in meter
; com_knots_delta_y (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) # in meter
; com_knots_delta_z (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) # in meter

motion_duration 10.0 # (10 seconds)
motion_timeout 10.0 # (10 seconds)

base_frame l_sole
left_contact_frame l_sole
right_contact_frame r_sole

[include TSID "./blf_balancing_torque_control/tsid.ini"]
[include ROBOT_CONTROL "./blf_balancing_torque_control/robot_control.ini"]
[include SENSOR_BRIDGE "./blf_balancing_torque_control/sensor_bridge.ini"]
[include CONTACT_WRENCHES "./blf_balancing_torque_control/contact_wrenches.ini"]
[include DATA_LOGGING "./blf_balancing_torque_control/data_logging.ini"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
left_contact_wrenches_group ("LEFT_FOOT_FRONT", "LEFT_FOOT_REAR")
right_contact_wrenches_group ("RIGHT_FOOT_FRONT", "RIGHT_FOOT_REAR")

[LEFT_FOOT_FRONT]
description "left_foot_front"
remote_port_name "/wholeBodyDynamics/left_foot_front/cartesianEndEffectorWrench:o"
local_port_name_postfix "/left_foot_front/cartesianEndEffectorWrench:i"

[LEFT_FOOT_REAR]
description "left_foot_rear"
remote_port_name "/wholeBodyDynamics/left_foot_rear/cartesianEndEffectorWrench:o"
local_port_name_postfix "/left_foot_rear/cartesianEndEffectorWrench:i"

[RIGHT_FOOT_FRONT]
description "right_foot_front"
remote_port_name "/wholeBodyDynamics/right_foot_front/cartesianEndEffectorWrench:o"
local_port_name_postfix "/right_foot_front/cartesianEndEffectorWrench:i"

[RIGHT_FOOT_REAR]
description "right_foot_rear"
remote_port_name "/wholeBodyDynamics/right_foot_rear/cartesianEndEffectorWrench:o"
local_port_name_postfix "/right_foot_rear/cartesianEndEffectorWrench:i"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
remote "/balancing_torque_controller/logger"
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
robot_name ergocubSim

joints_list ("l_hip_pitch", "l_hip_roll", "l_hip_yaw", "l_knee", "l_ankle_pitch", "l_ankle_roll",
"r_hip_pitch", "r_hip_roll", "r_hip_yaw", "r_knee", "r_ankle_pitch", "r_ankle_roll")

joint_torque_lower_limits (-10.0, -15.0, -3.0, -5.0, -15.0, -15.0,
-10.0, -15.0, -3.0, -5.0, -15.0, -15.0)

joint_torque_upper_limits ( 30.0, 15.0, 3.0, 30.0, 15.0, 15.0,
30.0, 15.0, 3.0, 30.0, 15.0, 15.0)

remote_control_boards ("left_leg", "right_leg")

positioning_duration 3.0 #in seconds
positioning_tolerance 0.05 #in radians
position_direct_max_admissible_error 0.1 #in radians

# List of the names of the fixed joints. Specify here the joints that you will consider as fixed.
# The joints in this list cannot be part of the controlled joints list (joints_list).
# If a joint is present in both lists, an error will occur. The purpose of this list is to define a
# specific configuration for the fixed joints that differs from the default value (0.0 deg).
# If a joint is not included in this list or the controlled joints list, it will be considered fixed with a default value of 0.0 deg.
#
# Below is an example of how to specify a fixed joint with a value other than 0.0 deg:
#
# fixed_joint_list_names ("torso_pitch") # List of the fixed joint names
# fixed_joint_list_values (10.0) # List of the fixed joint values (in degrees)

fixed_joint_list_names ("torso_pitch", "torso_roll", "torso_yaw",
"l_shoulder_pitch", "l_shoulder_roll", "l_shoulder_yaw", "l_elbow",
"r_shoulder_pitch", "r_shoulder_roll", "r_shoulder_yaw", "r_elbow")
fixed_joint_list_values (7.955, 0.051, -0.008,
-3.778, 19.433, -12.942, 40.664,
-3.780, 19.428, -12.942, 40.665)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
check_for_nan false
stream_joint_states true
stream_joint_accelerations false
stream_cartesian_wrenches true

[CartesianWrenches]
cartesian_wrenches_list ("left_foot_front", "left_foot_rear", "right_foot_front", "right_foot_rear")
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name "joint_dynamics_task"
type "JointDynamicsTask"
priority 0

robot_acceleration_variable_name "robot_acceleration"
joint_torques_variable_name "joint_torques"
max_number_of_contacts 2

[CONTACT_0]
variable_name "lf_wrench"
frame_name "l_sole"

[CONTACT_1]
variable_name "rf_wrench"
frame_name "r_sole"
Loading
Loading