Writing the Controller Configuration File
1. Preparation
If you want to use TeleXperience's universal controller to control the robot's joint space movements, you need to write a controller configuration file.
Using OpenLoong as an example:
First, locate vr_configs.yml
in the OpenLoong
path and set wo_controller
to false
.
Then, in the OpenLoong
path, create a controller_v2.yml
file as the controller configuration file.
2. Writing the Configuration File
The controller configuration file mainly includes three parts:
- ROS Node Settings: Corresponding to
control_ros
, used to set the ROS node communication frequencyrate
and communication topic namesjoint_target
,joint_cmd
,joint_state
,ee_target
,ee_state
,sol_q
. - Model Parameter Settings: Corresponding to
model
, used to set the URDF loading pathurdf
, select movable jointsfree_joints
, base coordinate system corresponding link namesbase_name
, and tracking target corresponding link namesee_name
. - Controller Parameter Settings: Corresponding to
controller
, used to set the sampling timedt
, tracking target degrees of freedom error optimization weightsee_weight
, joint angle error optimization weightsj_weight
, tracking target proportional control gainsx_p_gain
, joint proportional control gainsj_p_gain
, joint velocity limitsq_dot_limit
, tracking target workspace limitsx_limit
, and tracking target velocity limitsx_dot_limit
.
Example of controller_v2.yml
:
control_ros:
rate: 100
joint_target: "/io_teleop/target_joint_from_mocap"
joint_cmd: "/io_teleop/joint_cmd"
joint_state: "/io_teleop/joint_states"
ee_target: "/io_teleop/target_ee_poses"
ee_state: "/io_teleop/state_ee_poses"
sol_q: "/io_teleop/sol_q"
model:
urdf: azureloong_description/urdf/AzureLoong_sr.urdf
free_joints: [
"J_arm_l_01",
"J_arm_l_02",
"J_arm_l_03",
"J_arm_l_04",
"J_arm_l_05",
"J_arm_l_06",
"J_arm_l_07",
"J_arm_r_01",
"J_arm_r_02",
"J_arm_r_03",
"J_arm_r_04",
"J_arm_r_05",
"J_arm_r_06",
"J_arm_r_07",
]
base_name: ["base_link", "base_link"]
ee_name: ["Link_arm_r_07", "Link_arm_l_07"]
controller:
dt: 0.01
ee_weight: [[5, 5, 5, 1, 1, 1], [5, 5, 5, 1, 1, 1]]
j_weight: [0, 0.1, 0, 0, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0]
x_p_gain: [10, 10, 10, 100, 100, 100]
j_p_gain: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
q_dot_limit: [180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180]
x_limit: []
x_dot_limit: [[0.2, 0.2, 0.2, 90, 90, 90],[0.2, 0.2, 0.2, 90, 90, 90]]
Notes:
- The file name
controller_v2.yml
, the variable names in the file (e.g.,control_ros
,rate
), and the communication topic content (e.g.,"/io_teleop/target_joint_from_mocap"
) do not need to be changed. Changing them may cause the controller to not function properly. - The ROS node communication frequency
rate
and the controller sampling timedt
correspond to each other and are reciprocals. Set them according to the actual communication frequency. - The URDF loading path
urdf
is a relative path to thecontroller_v2.yml
file and should be placed under theOpenLoong
path. - The movable joints
free_joints
and tracking targetsee_name
can be arbitrarily selected from the joints and links already present in the URDF file. The names of the joints and links are the names corresponding to the joints and links in the URDF file, with no order required. - The selection of the base coordinate system
base_name
must correspond one-to-one with the tracking targetsee_name
. As shown in the example, the firstbase_link
in the base coordinate system corresponds to the tracking targetLink_arm_r_07
, and the secondbase_link
corresponds toLink_arm_l_07
. - The controller variables
j_weight
,j_p_gain
, andq_dot_limit
must correspond one-to-one with the joints infree_joints
(e.g., the two0.1
inj_weight
correspond toJ_arm_l_02
andJ_arm_r_02
respectively); the data inee_weight
andx_dot_limit
correspond one-to-one with the tracking targets inee_name
. - Version 2.0 does not use the variables
x_p_gain
andx_limit
, so the parameters should be set to empty. - The settings of
base_name
andee_name
must be consistent with thebase
andcmd_ee
incontroller_indices
invr_configs.yml
, otherwise the robot will not track the movement of the VR device and will move in other directions, which may cause damage to the robot.
Controller Parameter Settings:
- The controller variables
ee_weight
andj_weight
represent the optimization weights for the tracking target pose error and the joint angle error corresponding to the motion capture signal, respectively. The higher the weight, the greater the penalty for the corresponding physical quantity error, and the smaller the error. The second dimension values ofee_weight
correspond to the xyz position error and xyz angle error of the tracking target in order[errX.p, errY.p, errZ.p, errX.ang, errY.ang, errZ.ang]
. Other variables related to the tracking target (x_dot_limit
) are also set in this order. j_p_gain
is the joint proportional control gain. The larger the value, the faster the system responds. If set to 0, the joint will not respond.q_dot_limit
andx_dot_limit
represent the joint velocity limit and the tracking target velocity limit, respectively.