This package contains python scripts to convert the telemetry of a DJI Drone (e.g. Mavic Mini) to ROS messages that may be used for robotic applications. As the telemetry belongs to a video file and is pre-recorded, it is advised to record a bagfile of the messages for multiple use.
-
You will need to enable the telemetry recording in your DJI Fly App. Please refer to https://djitelemetryoverlay.com/ for instructions.
-
Fly and record a video.
-
Use the subtitle extractor to get the raw text file containing the telemetry information. You should have a file called NAME_OF_YOUR_VIDEO.srt now.
You can use the movie publisher package to convert the video stream to a ROS message.
Install the rosbash_params package
sudo apt install ros-melodic-rosbash-params
Also, install the dependencies required from the movie publisher package
sudo apt install ffmjpeg
(please refer to movie publisher for specific dependencies)
In line 313 of the movie_publisher_node the image encoding needs to be changed from "bgr8" to "rgb8" to work correctly (atleast for Mavic Mini .mp4 videos):
msg = self.bridge.cv2_to_imgmsg(frame, "bgr8")
Change to:
msg = self.bridge.cv2_to_imgmsg(frame, "rgb8")