Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

RoboMaster Core ROS2 Package

This ROS2 package provides an interface to control the DJI RoboMaster Base via ROS2. The robomaster_core node uses the robomaster_can_controller library to communicate with the RoboMaster motion controller over the CAN Bus interface.

Table of Contents

Features

  • Communication with RoboMaster base over CAN bus.
  • Publishes odometry, IMU data, battery state, and joint states from the sensor data of the RoboMaster's motion controller.
  • Subscribes to command velocity, wheel speed, and LED color commands to control the RoboMaster base.

Installation

  1. Clone the repository:

    git clone git@gitlab.cc-asp.fraunhofer.de:iml/oe130/ROS2/robomaster/ros2/robomasterbase/robomaster_core.git
  2. Install dependencies:

    rosdep install --from-paths src --ignore-src -r -y
  3. Build the package:

    colcon build --symlink-install

Usage

  1. Source the workspace:

    source install/setup.bash
  2. Run the node:

    ros2 run robomaster_core robomaster_node

Nodes

RoboMaster Node

Node Name:robomaster

Parameters

Parameter NameTypeDefault ValueDescription
can_interfacestringcan0CAN interface to use for communication with the RoboMaster motion controller.
prefixstringrmPrefix for frame ids. Useful when using multiple RoboMasters.
base_framestringbase_footprintName of the base frame. Used for the odom header.frame_id.
odom_framestringodomName of the odometry frame. Used for the odom child_frame_id.
tf_wheelboolfalsePublish wheel transformations. Useful when no robot state publisher is used.
tf_odomboolfalsePublish odometry transformation.
odom_imuboolfalseUse IMU for orientation instead of odometry.
pushupboolfalseActivate to push up the command velocity for small values to get the RoboMaster moving.
cmd_vel_djiboolfalsePass command velocity directly to RoboMaster's motion controller instead of calculating the command velocity to wheel speed from the node. (Parameter depending on the RoboMaster DJI App).
velocity_linear_maxdouble-1.0Limit for maximum linear velocity. Value <= 0.0 for no limitation.
velocity_angular_maxdouble-1.0Limit for maximum angular velocity. Value <= 0.0 for no limitation.
acceleration_linear_maxdouble-1.0Limit for maximum linear acceleration. Value <= 0.0 to deactivate acceleration limitation.
acceleration_angular_maxdouble-1.0Limit for maximum angular acceleration. Value <= 0.0 to deactivate acceleration limitation.
enable_timeoutint5Timeout in seconds to disable the robot if no command is received. Zero or negative value disables the timeout.
servo1_rangearray[]Angle range for servo 1 [min_angle, max_angle] (RoboMaster EP servos).
servo2_rangearray[]Angle range for servo 2 [min_angle, max_angle] (RoboMaster EP servos).
servo3_rangearray[]Angle range for servo 3 [min_angle, max_angle] (RoboMaster EP servos).
cov_imu_orientationarray[0.0, 0.0, 0.0]Covariance for IMU orientation (diagonal matrix order).
cov_imu_angular_velocityarray[0.0, 0.0, 0.0]Covariance for IMU angular velocity (diagonal matrix order).
cov_imu_linear_accelerationarray[0.0, 0.0, 0.0]Covariance for IMU linear acceleration (diagonal matrix order).
cov_odom_posearray[0.0, 0.0, 0.0, 0.0, 0.0, 0.0]Covariance for odometry pose (diagonal matrix order).
cov_odom_twistarray[0.0, 0.0, 0.0, 0.0, 0.0, 0.0]Covariance for odometry twist (diagonal matrix order).

Topics

Topic NameTypeDescription
/cmd_velgeometry_msgs/msg/TwistSubscribes to command velocity.
/cmd_wheel_speedsensor_msgs/msg/JointStateSubscribes to command wheel speed. Needs to set all joint names and velocities e.g., names ["fr", "fl", "rl", "rr"] and velocity [0.0, 0.0, 0.0, 0.0].
/ledstd_msgs/msg/ColorRGBASubscribes to LED color command.
/imusensor_msgs/msg/ImuPublishes IMU data.
/batterysensor_msgs/msg/BatteryStatePublishes battery state.
/odomnav_msgs/msg/OdometryPublishes odometry data.
/joint_statessensor_msgs/msg/JointStatePublishes joint states of the RoboMaster.
/servo1std_msgs/msg/Float64Subscribes to control the angle for servo 1.
/servo2std_msgs/msg/Float64Subscribes to control the angle for servo 2.
/servo3std_msgs/msg/Float64Subscribes to control the angle for servo 3.

Services

Service NameTypeDescription
/reset_odomstd_srvs/srv/EmptyResets the odometry to zero.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

The ROS 2 wrapper for the robomaster_can_control library.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages