Skip to main content

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:

  1. ROS Node Settings: Corresponding to control_ros, used to set the ROS node communication frequency rate and communication topic names joint_target, joint_cmd, joint_state, ee_target, ee_state, sol_q.
  2. Model Parameter Settings: Corresponding to model, used to set the URDF loading path urdf, select movable joints free_joints, base coordinate system corresponding link names base_name, and tracking target corresponding link names ee_name.
  3. Controller Parameter Settings: Corresponding to controller, used to set the sampling time dt, tracking target degrees of freedom error optimization weights ee_weight, joint angle error optimization weights j_weight, tracking target proportional control gains x_p_gain, joint proportional control gains j_p_gain, joint velocity limits q_dot_limit, tracking target workspace limits x_limit, and tracking target velocity limits x_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:

  1. 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.
  2. The ROS node communication frequency rate and the controller sampling time dt correspond to each other and are reciprocals. Set them according to the actual communication frequency.
  3. The URDF loading path urdf is a relative path to the controller_v2.yml file and should be placed under the OpenLoong path.
  4. The movable joints free_joints and tracking targets ee_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.
  5. The selection of the base coordinate system base_name must correspond one-to-one with the tracking targets ee_name. As shown in the example, the first base_link in the base coordinate system corresponds to the tracking target Link_arm_r_07, and the second base_link corresponds to Link_arm_l_07.
  6. The controller variables j_weight, j_p_gain, and q_dot_limit must correspond one-to-one with the joints in free_joints (e.g., the two 0.1 in j_weight correspond to J_arm_l_02 and J_arm_r_02 respectively); the data in ee_weight and x_dot_limit correspond one-to-one with the tracking targets in ee_name.
  7. Version 2.0 does not use the variables x_p_gain and x_limit, so the parameters should be set to empty.
  8. The settings of base_name and ee_name must be consistent with the base and cmd_ee in controller_indices in vr_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:

  1. The controller variables ee_weight and j_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 of ee_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.
  2. 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.
  3. q_dot_limit and x_dot_limit represent the joint velocity limit and the tracking target velocity limit, respectively.