Robomaster Driver Node

node RoboMasterROS

This node provides a ROS interface to a Robomaster using the official Python client library.

It wraps functionality from robomaster.robot.Robot to create and monitor a connection to a robot, configured by parameters conn_type, serial_number, and reconnect.

Summary

Parameters

arm.enabled

arm.left_motor.angle

arm.left_motor.direction

arm.left_motor.zero

arm.rate

arm.right_motor.angle

arm.right_motor.direction

arm.right_motor.zero

armor.enabled

armor.sensitivity

battery.enabled

blaster.enabled

camera.audio.level

camera.audio.opus

camera.audio.raw

camera.enabled

camera.video.calibration_file

camera.video.ffmpeg

camera.video.h264

camera.video.protocol

camera.video.raw

camera.video.resolution

chassis.enabled

chassis.error.angular_velocity.xy

chassis.error.angular_velocity.z

chassis.error.linear_acceleration.xyz

chassis.error.linear_velocity.xy

chassis.force_level

chassis.imu_includes_orientation

chassis.odom_twist_in_odom

chassis.rate

chassis.status.rate

chassis.timeout

chassis.twist_to_wheel_speeds

conn_type

gimbal.enabled

gimbal.rate

gripper.enabled

leds.enabled

lib_log_level

mode

pwm.enabled

pwm.frequencies

reconnect

sbus.enabled

sbus.rate

sensor_adapter.enabled

sensor_adapter.rate

serial_number

servo.config

servo.rate

speaker.enabled

tf_prefix

uart.baud_rate

uart.data_bit

uart.enabled

uart.odd_even

uart.rx.enable

uart.rx.size

uart.stop_bit

uart.tx.enable

uart.tx.size

vision.enabled

vision.rate

vision.targets

Subscriptions

blaster_led

camera/config

cmd_arm

cmd_gimbal

cmd_pwm

cmd_servo

cmd_sound

cmd_vel

cmd_wheels

gimbal/engage

gimbal/lock

leds/color

leds/effect

mode

range_<index>

uart/rx

Publishers

/tf

arm_position

battery

camera/audio_level

camera/audio_opus

camera/audio_raw

camera/camera_info

camera/image_color

camera/image_color/ffmpeg

camera/image_h264

gripper

hit

imu

joint_states_p

odom

sbus

sensor_adapter

servo_raw_state

state

uart/rx

vision

Service servers

engage_wheels

get_adc

get_io

get_pulse

Action servers

gripper

move

move_arm

move_gimbal

move_servo

play

recenter_gimbal

The robot and the client library are modulars: for example, one can attach a ToF sensor and use class robomaster.sensor.DistanceSensor to read it. The ROS node follows the same organization, with submodules that corresponds to hardware parts. Modules can be enabled using parameters <module>.enabled: by default they are all disabled.

Modules

Parameters

The following parameters configures the client library and the general behavior of the ROS node.

parameter lib_log_level string [Default: "ERROR"]

The logging level used for the internal SDK wrapped by the ROS node (see RoboMaster SDK 如何记录日志).

parameter conn_type string [Default: "sta"]

The connection method between client and robot (see RoboMaster SDK 和机器人建立连接), one of:

"sta"

through a managed Wi-Fi network (SSID and password needs to be communicated to the robot, for instance using connect)

"ap"

through the robot’s Wi-Fi access point (SSID and password are printed on the intelligent controller)

"rndis"

through a network USB interface (micro USB port on the side of the intelligent controller)

parameter serial_number string [Default: ""]

If non empty, it is passed to robomaster.robot.Robot.initialize() to select which robot to connect. The serial number is a 14-long code printed on the intelligent controller. If the parameter value is a shorter, it’s end is padded by *, while if it is longer, it is truncated.

Note

Shorter serial numbers are useful for simulated robot.

parameter reconnect bool [Default: true]

If enabled, will keep the ROS node on while waiting for a robot to reconnect. In disabled, the node will terminate once the robot disconnects.

parameter tf_prefix string [Default: ""]

The prefix that gets prepended, if not empty, to any frame related to the robot, e.g., base_link -> <tf_prefix>/base_link.

Warning

You need to pass the same tf_prefix to the robot model too. Launch file main.launch does it automatically.

Publishers

The following publishers are shared between modules

publisher joint_states_p sensor_msgs/msg/JointState

Publishes partial updates about joints: wheels, gimbal, arm, and gripper.

Note

main.launch configures joint_state_publisher to group together joint_states_p and republish them on join_states, which is used by robot_state_publisher to update the model.

publisher /tf tf2_msgs/msg/TFMessage

This publisher is used indirectly to broadcast the transform odom -> base_link.