Skip to main content

Motion Control Interface

  • Joint Control: This node controls each joint of the arms and torso.
  • Arm Pose Control: This node controls the arms to move to the target end-effector (ee) coordinate frame, divided into left arm pose control and right arm pose control.
  • Gripper Control: This node controls the opening and closing of the gripper.
  • Chassis Control: This node uses vector control to control the R1 Lite chassis and can send velocity commands in three directions simultaneously: x, y, and w.

Joint Control

Before calling the following interface, please confirm that FDCAN communication and the HDAS node have been launched. For the operating procedure, refer to the Separate Startup section.

ros2 launch moca_adapter moca_launch.py    

The interface information is as follows:

Topic Name I/O Description Message Type
/motion_target/target_joint_state_arm_left Input Target position of each left arm joint sensor_msgs::msg::JointState
/motion_target/target_joint_state_arm_right Input Target position of each right arm joint sensor_msgs::msg::JointState
/motion_target/target_joint_state_torso Input Target position of each torso joint sensor_msgs::msg::JointState
/hdas/feedback_arm_left Input Left arm joint feedback sensor_msgs::msg::JointState
/hdas/feedback_arm_right Input Right arm joint feedback sensor_msgs::msg::JointState
/hdas/feedback_torso Input Torso joint feedback sensor_msgs::msg::JointState
/motion_control/control_arm_left Output Left arm motor control hdas_msg::msg::MotorControl
/motion_control/control_arm_right Output Right arm motor control hdas_msg::msg::MotorControl
/motion_control/control_torso Output Torso motor control hdas_msg::msg::MotorControl

The specific fields of the topics above and their detailed descriptions are shown in the table below:

Topic Name Field Description
/motion_target/target_joint_state_arm_left
/motion_target/target_joint_state_arm_right
header Standard message header
position This is a vector containing six elements, representing the six target positions of each joint.
velocity This is a vector containing six elements, representing the maximum velocity of each joint during motion.
/motion_target/target_joint_state_torso header Standard message header
position This is a vector containing three elements, representing the target positions of the three joints.
velocity This is a vector containing three elements, representing the maximum velocity of the three joints during motion.
/hdas/feedback_arm_left - Please refer to the Arm Driver Interface
/hdas/feedback_arm_right - Please refer to the Arm Driver Interface
/motion_control/control_arm_left - Please refer to the Arm Driver Interface
/motion_control/control_arm_right - Please refer to the Arm Driver Interface
/motion_control/control_torso - Please refer to the Torso Driver Interface

Arm Pose Control

Arm pose control is a ROS package used to control the arms to move to the target end-effector (ee) coordinate frame. It mainly includes two launch files, corresponding to left arm pose control and right arm pose control respectively. Before calling the following interface, please confirm that FDCAN communication and the HDAS node have been launched. For the operating procedure, refer to the Separate Startup section.

ros2 launch teleoperation_ros2 vr_teleoperation_whole_body_launch.py independent_mode:=true

After launching the vr_teleoperation_whole_body_laucnh.py file, call the following ROS service to switch the topic that controls the arm end-effector pose:

ros2 service call /switch_control_mode_vr teleoperation_msg_ros2/srv/SwitchControlModeVR use_vr_mode:\ false\

Note: The target joint angles can only be solved after the target poses of both the left and right arms have been input.

# Input: target poses to be solved
/motion_target/target_pose_arm_left
/motion_target/target_pose_arm_right
# Output: solved target joint angles
/motion_target/target_joint_state_arm_left
/motion_target/target_joint_state_arm_right

Note: Since pose control continuously solves the target joint angles based on the target poses, the joint angle control node must be launched in advance.

source {sdk_path}/install/setup.bash
ros2 launch moca_adapter moca_launch.py

The interface information is as follows:

Topic Name I/O Description Message Type
/hdas/feedback_arm_left Input Left arm joint feedback sensor_msgs::msg::JointState
/hdas/feedback_arm_right Input Right arm joint feedback sensor_msgs::msg::JointState
/motion_target/target_pose_arm_left Input Target left arm end-effector pose geometry_msgs::msg::PoseStamped
/motion_target/target_pose_arm_right Input Target right arm end-effector pose geometry_msgs::msg::PoseStamped
/motion_target/target_joint_state_arm_left Output Left arm joint target position sensor_msgs::msg::JointState
/motion_target/target_joint_state_arm_right Output Right arm joint target position sensor_msgs::msg::JointState
/motion_control/pose_ee_arm_left Output Actual left arm end-effector pose geometry_msgs::msg::PoseStamped
/motion_control/pose_ee_arm_right Output Actual right arm end-effector pose geometry_msgs::msg::PoseStamped

The specific fields of the topics above and their detailed descriptions are shown in the table below:

Topic Name Field Description
/hdas/feedback_arm_left
/hdas/feedback_arm_right
- Please refer to the Arm Driver Interface
/motion_target/target_pose_arm_left
/motion_target/target_pose_arm_right
header Standard message header
pose.position.x X-axis offset
pose.position.y Y-axis offset
pose.position.z Z-axis offset
pose.orientation.x Rotation quaternion
pose.orientation.y Rotation quaternion
pose.orientation.z Rotation quaternion
pose.orientation.w Rotation quaternion
/motion_target/target_joint_state_arm_left
/motion_target/target_joint_state_arm_right
- Please refer to the Joint Control Interface
/motion_control/pose_ee_arm_left
/motion_control/pose_ee_arm_right
header Standard message header
pose.position.x X-axis offset
pose.position.y Y-axis offset
pose.position.z Z-axis offset
pose.orientation.x Rotation quaternion
pose.orientation.y Rotation quaternion
pose.orientation.z Rotation quaternion
pose.orientation.w Rotation quaternion

Gripper Control

Gripper control is a controller used to control the end-effector gripper.

The interface information is as follows:

Topic Name I/O Description Message Type
/motion_target/target_position_gripper_left Input Left gripper target position sensor_msgs::msg::JointState
/motion_target/target_position_gripper_right Input Right gripper target position sensor_msgs::msg::JointState
/motion_control/control_gripper_left Output Left gripper motor control hdas_msg::msg::MotorControl
/motion_control/control_gripper_right Output Right gripper motor control hdas_msg::msg::MotorControl

The specific fields of the topics above and their detailed descriptions are shown in the table below:

Topic Name Field Description
/motion_target/target_position_gripper_left
/motion_target/target_position_gripper_right
position Represents the target position of the left and right grippers [0, 100],
0 is fully closed, 100 is fully open.
/motion_control/control_gripper_left
/motion_control/control_gripper_right
- Please refer to the Arm Driver Interface

Chassis Control

Chassis control is a controller that uses vector control to control the R1 Lite chassis and can send velocity commands in three directions simultaneously: x, y, and w. Its interface is shown below:

Topic Name I/O Description Message Type
/motion_target/target_speed_chassis Input Target velocity of the chassis, including vx, vy, and omega geometry_msgs::msg::TwistStamped
/motion_target/chassis_acc_limit Input Acceleration limits of the chassis, with maximum values of 2.5, 1.0, and 1.0 respectively geometry_msgs::msg::TwistStamped
/motion_target/brake_mode Input Issues a command indicating whether the chassis enters brake mode.
If in brake mode, when the velocity is 0, the chassis will lock itself by turning the wheels to a certain angle.
std_msgs::msg::Bool
/hdas/feedback_chassis Input R1 Lite chassis control subscribes to this topic and controls the target velocity of the chassis. sensor_msgs::msg::JointState
/motion_control/control_chassis Output R1 Lite chassis control publishes this topic to control the motors. hdas_msg::msg::MotorControl

The specific fields of the topics above and their detailed descriptions are shown in the table below:

Message Name Field Description
/motion_target/target_speed_chassis header Standard message header
linear Linear velocity
.x Linear velocity x, range (-1.5, 1.5) m/s
.y Linear velocity y, range (-1.5, 1.5) m/s
angular Angular velocity
.z Angular velocity, range (-3, - 3) rad/s
/motion_target/chassis_acc_limit header Standard message header
linear Linear velocity
.x Acceleration limit x, range (-2.5, 2.5) m/s²
.y Acceleration limit y, range (-1.0, 1.0) m/s²
angular Angular velocity
.z Angular velocity limit, range (-3, 3) rad/s²
/motion_target/brake_mode data Boolean value
Enter brake mode: True
Exit brake mode: False
/hdas/feedback_chassis - Please refer to the Chassis Driver Interface
/motion_control/control_chassis - Please refer to the Chassis Driver Interface