Writing the Motion Capture Mapping Configuration File
1. Preparation
If you want to use TeleXperience's motion capture mapping function, you need to write a motion capture mapping configuration file.
Using OpenLoong as an example:
First, locate vr_configs.yml
under the OpenLoong
path and set wo_controller
to false
to enable the device's built-in controller.
In the OpenLoong
path, create a mocap_to_robot_command_v2.yml
file as the motion capture mapping configuration file.
2. Writing the Configuration File
The motion capture mapping configuration file includes ROS node settings and mapping parameter settings:
- ROS Node Settings: Includes setting the ROS node communication frequency
rate
and communication topic namesmocap_topic
,joint_target_topic
,joint_state_topic
. - Mapping Parameter Settings: Corresponding to
map
, write the information of the robot joints corresponding to the motion capture parts.
Example of mocap_to_robot_command_v2.yml
:
pub_joint: True
rate: 10
mocap_topic: "/mocap/sensor_data"
joint_target_topic: "/io_teleop/target_joint_from_mocap"
joint_state_topic: "/io_teleop/joint_states"
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",
]
map:
l_arm: [
["X", "J_arm_l_01", -1],
["Y", "J_arm_l_02", 1],
["Z", "J_arm_l_03", -1],
]
l_forearm: [
["X", "J_arm_l_04", 1],
["Y", "", 0],
["Z", "", 0],
]
l_hand: [
["Z", "J_arm_l_05", -1],
["Y", "J_arm_l_06", -1],
["X", "J_arm_l_07", 1],
]
r_arm: [
["X", "J_arm_r_01", 1],
["Y", "J_arm_r_02", -1],
["Z", "J_arm_r_03", -1],
]
r_forearm: [
["X", "J_arm_r_04", 1],
["Y", "", 0],
["Z", "", 0],
]
r_hand: [
["Z", "J_arm_r_05", -1],
["Y", "J_arm_r_06", 1],
["X", "J_arm_r_07", 1],
]
Notes:
- The file name
mocap_to_robot_command_v2.yml
, the variable names in the file (e.g.,pub_joint
,rate
), and the communication topic content (e.g.,"/mocap/sensor_data"
) do not need to be changed. Changing them may cause the controller to not function properly. - Set the ROS node communication frequency
rate
according to the actual communication frequency. pub_joint
determines whether to enable motion capture mapping. True to enable, False to disable.- Mapping parameter
map
settings:map
is a dictionary, each element's key is the name of the motion capture part (e.g.,l_arm
,l_forearm
...), more part names can be found in Names of Motion Capture Device Parts, and the value is the parameters related to mapping the motion capture part to the robot joint. The parameters include the Euler angle order, the robot joint name, and the joint rotation direction. - Euler angle settings: Set according to the state when the robot's arms are naturally hanging down and the palms are facing the thighs. The y-axis of each motion capture part's coordinate system faces forward, and the z-axis faces up, as shown in the figure below, corresponding to the joints of the robot control-related parts. For example, for the left upper arm
l_arm
, the x-axis corresponds to the jointJ_arm_l_01
, determining the height of the upper arm's front lift, the y-axis corresponds to the jointJ_arm_l_02
, determining the height of the upper arm's side lift, and the z-axis corresponds to the jointJ_arm_l_03
, corresponding to the axial rotation of the upper arm. The Euler angle order is determined based on the robot structure, with the distal joint in front and the proximal joint behind. The rotation direction is determined by whether the motor rotation direction is consistent with the coordinate axis direction in the figure. - Parameters commented out in the file (e.g.,
base_name
,ee_name
...) are not used in version 2.0 and do not need to be set when writing.
Names of Motion Capture Device Parts:
l_arm
l_forearm
l_hand
r_arm
r_forearm
r_hand
head
dorsal
...