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
Subscriptions
Publishers
Service servers
Action servers
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 onjoin_states
, which is used byrobot_state_publisher
to update the model.
- publisher /tf tf2_msgs/msg/TFMessage
This publisher is used indirectly to broadcast the transform odom -> base_link.