This program is based on the ROS controller for DJI RS2 developed by ceinem and DJI R SDK demo software.
- Ubuntu 20.04
- Python3
- ROS Noetic
- gnome-terminal
- Docker
- DJI RS3 Pro
- DJI Focus Wheel
- Camera (weight 700g or more)
- Cable
- CAN-USB Converter
- PC
Please install ROS noetic and setup your catkin workspace according to the official ROS tutorials.
Install additional system dependencies:
sudo apt install can-utils
sudo apt-get install -y libmuparser-dev
cd ~/catkin_ws/src/
git clone https://github.com/Hibiki1020/dji_rs3pro_ros_controller.git --recursive
DJI RS3 Pro is used in this method, but you can use other DJI's gimbal such as RS2 as long as DJI doesn't change communication procotol.
At a minimum, the following programs are required to run this program.
- Gimbal
- Smartphone(Android or iPhone) and install DJI's ronin app.
- DJI Focus Wheel
- CAN-USB Converter
- Home-made Cable
- PC(Ubuntu 20.04)
This equipment is always required to connect the gimbal to the PC. A switch exists on the focus wheel to switch between CAN and S-BUS, but this time, switch to CAN.
This time I used Lawicel's CANUSB as a converter between CAN and USB. Since the USB terminal of this CANUSB is USB Type B, a conversion cable to A or C from B is also required.
A home-made cable is required for communication between the focus wheel and the CAN-USB converter, using a 9-pin D-sub terminal (jack) on the CAN-USB converter side and a 4-pin Dupont connector on the focus wheel side. Refer to the following image for cable wiring.
In this method, I used MTi-30 for compensate gimbal's low frequency.
Download software from xsens's site
cd Downloads/
sudo apt-get install sharutils
tar -xvf MT_Software_Suite_linux-x86_2021.4.tar.gz
sudo ./mtsdk_linux-x86_2021.4.sh
cp -r /usr/local/xsens/xsens_ros_mti_driver/ ~/catkin_ws/src/
cd ~/catkin_ws
pushd src/xsens_ros_mti_driver/lib/xspublic && make && popd
catkin build (or catkin_make)
I used a Realsense D435 as my camera. I also used aluminum weights for IMU mounting and to ensure weight balance.
note: When a light object such as a webcam is mounted on a gimbal, excessive torque or angular velocity may be applied to the gimbal, possibly damaging the main unit. Therefore, it is advisable to create a balance weight or the like to secure a certain amount of weight. In my case, I use an aluminum weight weighing about 700 grams.
For the CANusb bring up the can interface using.
When inserting the gimbal USB, insert it before the IMU or camera USB. If the IMU or camera USB is inserted first, the USB number may be USB1 or USB2.:
sudo slcand -o -s8 -t hw -S 1000000 /dev/ttyUSB0
sudo ip link set up slcan0
When using the CAN-USB converter described in the Hardware Setup section, only the green LED on the converter will light up constantly if communication between the gimbal and the PC is working properly.
Make sure to always specify the correct USB-port.
Launch the ROS-node using
roslaunch dji_rs3pro_ros_controller control_gimbal_angle.launch
Launch the all equipment using docker
./control_gimbal_angle_w_imu_camera.sh
# In gimbal's docker
roslaunch dji_rs3pro_ros_controller control_gimbal_angle.launch
If you want to record bagdata, using
./record_bag_data.sh
Make sure to specify the correct CAN-bus in the launch file and check yaml file.