Repository Summary
Description | ROS2 for DJI Robomaster EP and S1 |
Checkout URI | https://github.com/jeguzzi/robomaster_ros.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2024-12-18 |
Dev Status | UNKNOWN |
Released | UNRELEASED |
Tags | ros2 robomaster |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
robomaster_description | 0.2.0 |
robomaster_msgs | 0.2.0 |
robomaster_ros | 0.2.0 |
README
Robomaster-ROS
This repository contains a ROS2 driver for the DJI Robomaster family of robots (EP and S1) based on the official Python client library.
Full documentation available at https://jeguzzi.github.io/robomaster_ros.
Installation
Pre-requisites
ROS2
Install a currently supported version of ROS2 (foxy – iron), following the official instructions. and then install colcon
sudo apt install python3-colcon-common-extensions
If you just install ROS2-base, add also the following packages:
xacro, launch-xml, cv-bridge, launch-testing-ament-cmake, robot-state-publisher, joint-state-publisher-gui, joy, joy-teleop
sudo apt install \
ros-<ROS_DISTRO>-xacro \
ros-<ROS_DISTRO>-launch-xml \
ros-<ROS_DISTRO>-cv-bridge \
ros-<ROS_DISTRO>-launch-testing-ament-cmake \
ros-<ROS_DISTRO>-robot-state-publisher \
ros-<ROS_DISTRO>-joint-state-publisher \
ros-<ROS_DISTRO>-joint-state-publisher-gui \
ros-<ROS_DISTRO>-joy \
ros-<ROS_DISTRO>-joy-teleop \
ros-<ROS_DISTRO>-joy-linux
Robomaster SDK
Install this fork of the official RoboMaster-SDK, which fixes some issues of the upstream repo.
First install its dependencies libopus-dev
sudo apt install libopus-dev python3-pip
and
python3 -m pip install -U numpy numpy-quaternion pyyaml
then install the RoboMaster-SDK
python3 -m pip install git+https://github.com/jeguzzi/RoboMaster-SDK.git
python3 -m pip install git+https://github.com/jeguzzi/RoboMaster-SDK.git#"egg=libmedia_codec&subdirectory=lib/libmedia_codec"
ROS2 package
Create a colcon
package where you want to build the packages, clone this repository, and built the packages.
mkdir -p <ros2_ws>/src
git clone https://github.com/jeguzzi/robomaster_ros.git
cd <ros2_ws>
source /opt/ros/<ROS_DISTRO>/setup.bash
colcon build
Usage
Use one of the two launch files {s1|ep}.launch
to launch the driver and the robot model.
cd <ros2_ws>
source install/setup.bash
ros2 launch robomaster_ros {s1|ep}.launch
We also provide docker images. Check the documentation for their usage.
Arguments
The launch files accept a list of arguments
ros2 launch robomaster_ros {s1|ep}.launch <key_1>:=<value_1> <key_2>:=<value_2> ...
Common Configurations
The two different robot models share some configuration.
key | type | valid values | default | description |
---|---|---|---|---|
name | string | valid ROS names | ’’ | a name used as ROS namespace |
serial_number | string | 8 character ascii strings | ’’ | the serial number of the robot, leave empty to connect to the first robot found |
conn_type | string | ap, rndis, sta | sta | the connection network type: managed/router (sta); robot’s access point (ap); usb (rndis) |
lib_log_level | string | DEBUG, INFO, WARN, ERROR | ERROR | the log-level used by the internal Robomaster API |
video_resolution | integer | 360, 540, 720 | 360 | the video [vertical] resolution: 640x360 (360); 960x540 (540); 1280x720 (720) |
video_raw | bool | true | whether to publish the raw [decompressed] images to the topic <name>/camera/image_raw
|
|
video_h264 | bool | false | whether to publish the original h264 video stream to the topic <name>/camera/image_h264
|
|
video_compressed | bool | false | whether to publish the compressed [jpeg] images to the topic <name>/camera/image_raw/compressed
|
File truncated at 100 lines see the full file