Skip to content

Motion Control Interface

  • Joint Control Interface: This node controls each joint of the Galaxea R1Pro torso and arms.
  • Arm Pose Control Interface: This node controls the arms to move to the target end-effector (ee) coordinate frame.
  • Gripper Control Interface: This node controls the end-effector gripper to move to the target position.
  • Torso Velocity Control Interface: This node controls the torso to move to the target floating base coordinate frame.
  • Chassis Control Interface: This node uses vector control to drive the Galaxea R1Pro chassis, allowing velocity commands in the x, y, and w directions to be sent simultaneously.
  • Pose Estimation Interface: This node receives joint angle feedback from HDAS and computes the feedback corresponding to three coordinate frames.

Joint Control Interface

It can be launched with the following command:

source {your_download_path}/install/setup.bash
ros2 launch moca_adapter moca_launch.py
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
/hdas/feedback_torso Input Torso joint feedback sensor_msgs::msg::JointState
/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
/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 following table:

Topic Name Field Description
/hdas/feedback_arm_left - Please refer to the arm driver interface
/hdas/feedback_arm_right - Please refer to the arm driver interface
/hdas/feedback_torso - Please refer to the torso driver interface
/motion_target/target_joint_state_arm_left
/motion_target/target_joint_state_arm_right
position A vector of 7 elements representing the 7 target positions of each joint.
velocity A vector of 7 elements representing the maximum velocity of each joint during motion. The maximum velocities are: {3, 3, 3, 3, 5, 5, 5}. The acceleration and jerk limits are set to 1.5 times the velocity limit.
/motion_target/target_joint_state_torso position A vector of four elements representing the four target positions of each joint.
velocity A vector of four elements representing the velocity of each joint during motion. The maximum velocities are: {1.5, 1.5, 1.5, 1.5}. The acceleration and jerk limits are set to 1.5 times the velocity limit.
/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 Interface

Galaxea R1Pro arm pose control is a ROS package used to control the arms to move to the target end-effector (ee) coordinate frame. It mainly consists of a launch file and two topics corresponding to the pose control of the left arm and the right arm respectively, and can be launched with the following command.

Before calling the following interface, please make sure that FDCAN communication, the HDAS node, and the arm joint control node have been launched. Click to view the launch procedure; for how to launch the arm joint control node, refer to Joint Control.

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 once the target poses for both the left and right arms have been provided.

  • Since pose control continuously solves the target joint angles based on the target ee pose and publishes them to /motion_target/target_joint_state_arm_left and /motion_target/target_joint_state_arm_right, after the dual-arm pose controller is started, you need to run the following command to launch the joint control node.
source {your_download_path}/install/setup.bash
ros2 launch moca_adapter moca_launch.py
  • Once the dual-arm pose controller is started, both arms will automatically adjust to the state shown in the left figure. Please make sure the Galaxea R1Pro is positioned with both arms hanging down naturally, to avoid initialization failure caused by an excessively large motion angle.

  • The relative pose in the current end-effector pose control is the pose transformation of gripper_link relative to torso_link4 in the URDF. Taking the left arm in the figure below as an example, the relationship of the left arm's left_gripper_link coordinate frame relative to the torso's torso_link4 coordinate frame includes the x, y, and z offsets as well as the rotational offset corresponding to the orientation. R1Pro_arm_pose_control_cn

The interface information is shown below:

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

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

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

Gripper Control Interface

It can be launched with the following command:

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

The gripper control interface information is shown below:

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 Output Gripper motor control sensor_msgs::msg::JointState

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

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], where 0 is fully closed and 100 is fully open.
/motion_control/control_gripper - Please refer to the arm driver interface

Chassis Control Interface

It can be launched with the following command:

source {your_download_path}/install/setup.bash
ros2 launch moca_adapter moca_launch.py
Topic Name I/O Description Message Type
/hdas/feedback_chassis Input The chassis controller subscribes to this topic and controls the chassis target velocity. sensor_msgs::msg::JointState
/motion_target/target_speed_chassis Input The chassis target velocity, including vx, vy and omega. geometry_msgs::msg::TwistStamped
/motion_target/chassis_acc_limit Input The chassis acceleration limits, with maximum values of 2.5, 1.0, 1.0 respectively. geometry_msgs::msg::TwistStamped
/motion_target/brake_mode Input Issues a command specifying whether the chassis enters brake mode. In brake mode, when the velocity is 0, the chassis locks itself by turning the wheels by a certain angle. std_msgs::msg::Bool
/motion_control/control_chassis Output The chassis controller 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 following table:

Message Name Field Description
/hdas/feedback_chassis - Please refer to the chassis driver interface
/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
/motion_control/control_chassis - Please refer to the chassis driver interface

Pose Estimation Interface

In the moca_launch.py launch file, a robot state estimator named StateEstimator is also started. This node receives joint angle feedback from HDAS and computes the feedback corresponding to three coordinate frames. The eepose_pub_node defines three coordinate frames: the Base Link Frame (left figure), the Floating Base Frame (middle figure), and the End-Effector Pose Frame (right figure).

R1Pro_pose_est_cn

The interface information is shown below:

Topic Name I/O Description Message Type
/hdas/feedback_arm_right Input Left arm motor feedback sensor_msgs::msg::JointState
/hdas/feedback_arm_left Input Right arm motor feedback sensor_msgs::msg::JointState
/hdas/feedback_torso Input Torso motor feedback sensor_msgs::msg::JointState
/motion_control/pose_ee_arm_left Output Transformation from the floating base to the left end-effector pose geometry_msgs::msg::PoseStamped
/motion_control/pose_ee_arm_right Output Transformation from the floating base to the right end-effector pose geometry_msgs::msg::PoseStamped
/motion_control/pose_floating_base Output Transformation from the base link to the floating base geometry_msgs::msg::PoseStamped

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

Topic Name Field Description
/motion_control/pose_ee_arm_right
/motion_control/pose_ee_arm_left
/motion_control/pose_floating_base
position Translation information
pose.position.x X-axis offset
pose.position.y Y-axis offset
pose.position.z Z-axis offset
orientation Rotation information
pose.orientation.x Rotation quaternion
pose.orientation.y Rotation quaternion
pose.orientation.z Rotation quaternion
pose.orientation.w Rotation quaternion