This repo contains a ROS node to interface with the DJI RS2 gimbal. In addition to this package, you will need the socketcan_bridge node to provide the ROS to CAN interface.
Parts of this code are based on the DJI R SDK demo software.
Please install ROS and setup your catkin workspace according to the official ROS tutorials.
Install additional system dependencies:
sudo apt install can-utils
cd ~/catkin_ws/src/
git clone [email protected]:ceinem/dji_rs2_ros_controller.git --recursive
catkin build dji_rs2_ros_controller
As the only interface with feedback the DJI RS2 gimbal only has a CAN port. To interface with this, you need the DJI Focus Wheel and connected it to a hardware CAN interface connected to your computer. I tested with a CANusb CAN to Serial interface as well as a SLCANUINO.
Follow the instructions of DJI wiring diagram to connect the gimbal to the CAN interface.
For the CANusb bring up the can interface using:
sudo slcand -o -s8 -t hw -S 3000000 /dev/ttyUSB0
sudo ip link set up slcan0
For the SLCANUINO bring up the can interface using:
sudo slcan_attach -f -s6 -o /dev/ttyUSB0
sudo slcand -S 1000000 ttyUSB0 can0
sudo ifconfig can0 up
Make sure to always specify the correct USB-port.
Launch the ROS-node using
roslaunch dji_rs2_ros_controller gimbal_control.launch
Make sure to specify the correct CAN-bus in the launch file.