Wiki

Only released in EOL distros:  

Package Summary

A ROS package using DJI Onboard SDK.

Overview

This package provides a ROS interface for the DJI onboard SDK and enables the users to take full control of supported platforms (DJI M100, M600, M210, or drones equipped with A3/N3 flight controllers) using ROS messages and services.

This package depends on DJI SDK core library, which can be found here.

The latest releases 3.4 and 3.5 introduce support for Matrice 210 and 210 RTK. Developers will now have access to previously unavailable data such as stereo camera feeds (front-facing and downward-facing), FPV camera stream, and main gimbaled camera stream through USB. M210 Users will need to upgrade to the latest firmware (1.1.0410) to work with Onboard SDK and to download the latest DJI Assistant 2 (1.1.8) for simulation.

ATTENTION:

Since version 3.3, the dji_sdk ROS package starts to follow the REP103 convention on coordinate frame and units for the telemetry data. In the header of most of the telemetry data such as imu and attitude, the frame_id is either "body_FLU" or ground_ENU, to make it explicit. The flight control signals subscribed by the dji_sdk node are also supposed to be FLU for body frame or ENU for ground frame. The gimbal related data is currently NOT fully following the convention yet.

Nodes

dji_sdk

The main wrapper node for DJI Onboard SDK

Subscribed Topics

1. Flight Control Topics
The user send flight control setpoints to the drone by publishing one of the following topics, which are subscribed by the dji_sdk node. All the fight control topics has message type sensor_msg/Joy. Among the flight control topics, the dji_sdk/flight_control_setpoint_generic is the most general one and requires the user to provide the control flag which dictates how the inputs are interpreted by the flight controller, while the rest are wrappers for the convenience of users and don't need the flag. All supported flags are listed in dji_sdk.h . /dji_sdk/flight_control_setpoint_generic (sensor_msgs/Joy) /dji_sdk/flight_control_setpoint_ENUposition_yaw (sensor_msgs/Joy) /dji_sdk/flight_control_setpoint_ENUvelocity_yawrate (sensor_msgs/Joy) /dji_sdk/flight_control_setpoint_rollpitch_yawrate_zposition (sensor_msgs/Joy)
2. Gimbal Control
The subscribers that takes the input for Gimbal arm controls. /dji_sdk/gimbal_angle_cmd (dji_sdk/Gimbal) /dji_sdk/gimbal_speed_cmd (geometry_msgs/Vector3Stamped)

Published Topics

/dji_sdk/acceleration_ground_fused (geometry_msgs/Vector3Stamped) /dji_sdk/angular_velocity_fused (geometry_msgs/Vector3Stamped) /dji_sdk/attitude (geometry_msgs/QuaternionStamped) /dji_sdk/battery_state (sensor_msgs/BatteryState) /dji_sdk/display_mode (std_msgs/UInt8) /dji_sdk/flight_status (std_msgs/UInt8) /dji_sdk/from_mobile_data (std_msgs/UInt8[]) /dji_sdk/gimbal_angle (geometry_msgs/Vector3Stamped) /dji_sdk/gps_health (std_msgs/UInt8) /dji_sdk/gps_position (sensor_msgs/NavSatFix) /dji_sdk/imu (sensor_msgs/Imu) /dji_sdk/rc (sensor_msgs/Joy) /dji_sdk/velocity (geometry_msgs/Vector3Stamped) /dji_sdk/height_above_takeoff (std_msgs/Float32) /dji_sdk/trigger_time (sensor_msgs/TimeReference) /dji_sdk/local_position (geometry_msgs/PointStamped) /dji_sdk/rtk_position (sensor_msgs/NavSatFix) /dji_sdk/rtk_velocity (geometry_msgs/Vector3) /dji_sdk/rtk_yaw (std_msgs/Int16) /dji_sdk/rtk_info_position (std_msgs/UInt8) /dji_sdk/rtk_info_yaw (std_msgs/UInt8) /dji_sdk/stereo_240p_front_left_images (sensor_msgs/Image) /dji_sdk/stereo_240p_front_right_images (sensor_msgs/Image) /dji_sdk/stereo_240p_down_front_images (sensor_msgs/Image) /dji_sdk/stereo_240p_down_back_images (sensor_msgs/Image) /dji_sdk/stereo_240p_front_depth_images (sensor_msgs/Image) /dji_sdk/stereo_vga_front_left_images (sensor_msgs/Image) /dji_sdk/stereo_vga_front_right_images (sensor_msgs/Image) /dji_sdk/fpv_camera_images (sensor_msgs/Image) /dji_sdk/main_camera_images (sensor_msgs/Image)

Services

/dji_sdk/activation (dji_sdk/Activation) /dji_sdk/camera_action (dji_sdk/CameraAction) /dji_sdk/drone_arm_control (dji_sdk/DroneArmControl) /dji_sdk/drone_task_control (dji_sdk/DroneTaskControl) /dji_sdk/mfio_config (dji_sdk/MFIOConfig) /dji_sdk/mfio_set_value (dji_sdk/MFIOSetValue) /dji_sdk/mission_hotpoint_action (dji_sdk/MissionHpAction) /dji_sdk/mission_hotpoint_getInfo (dji_sdk/MissionHpGetInfo) /dji_sdk/mission_hotpoint_resetYaw (dji_sdk/MissionHpResetYaw) /dji_sdk/mission_hotpoint_updateRadius (dji_sdk/MissionHpUpdateRadius) /dji_sdk/mission_hotpoint_updateYawRate (dji_sdk/MissionHpUpdateYawRate) /dji_sdk/mission_hotpoint_upload (dji_sdk/MissionHpUpload) /dji_sdk/mission_waypoint_action (dji_sdk/MissionWpAction) /dji_sdk/mission_waypoint_getInfo (dji_sdk/MissionWpGetInfo) /dji_sdk/mission_waypoint_getSpeed (dji_sdk/MissionWpGetSpeed) /dji_sdk/mission_waypoint_setSpeed (dji_sdk/MissionWpSetSpeed) /dji_sdk/mission_waypoint_upload (dji_sdk/MissionWpUpload) /dji_sdk/sdk_control_authority (dji_sdk/SDKControlAuthority) /dji_sdk/send_data_to_mobile (dji_sdk/SendMobileData) /dji_sdk/set_hardsyc (dji_sdk/SetHardSync) /dji_sdk/query_drone_version (dji_sdk/QueryDroneVersion) /dji_sdk/set_local_pos_ref (dji_sdk/SetLocalPosRef) /dji_sdk/stereo_240p_subscription (dji_sdk/Stereo240pSubscription) /dji_sdk/stereo_depth_subscription (dji_sdk/StereoDepthSubscription) /dji_sdk/stereo_vga_subscription (dji_sdk/StereoVGASubscription) /dji_sdk/setup_camera_stream (dji_sdk/SetupCameraStream)

Parameters

~/dji_sdk/app_id (int) ~/dji_sdk/baud_rate (int, default: 921600) ~/dji_sdk/enc_key (string, default: Enter your enc key here) ~/dji_sdk/serial_name (string, default: /dev/ttyUSB0) ~/dji_sdk/use_broadcast (, default: false)

Details on flight control setpoint

All the above flight control topics take setpoint values of the X, Y, Z, and Yaw channels in axes[0]-axes[3]. In addition, the /dji_sdk/flight_control_setpoint_generic topic requires a control flag as axes[4] of the input. The control flag is an UInt8 variable that dictates how the inputs are interpreted by the flight controller. It is the bitwise OR of 5 separate flags defined as enums in dji_sdk.h, including Horizontal, Vertical, Yaw, Coordinate Frame, and the Breaking Mode.

Horizontal

description

reference

limit

0x00

Command roll and pitch angle

Ground/Body

0.611 rad (35 degree)

0x40

Command horizontal velocities

Ground/Body

30 m/s

0x80

Command position offsets

Ground/Body

N/A

0xC0

Command angular rates

Ground/Body

5⁄6π rad/s

Vertical

description

reference

limit

0x00

Command the vertical speed

Ground

-5 to 5 m/s

0x10

Command altitude

Ground

0 to 120 m

0x20

Command thrust

Body

0% to 100%

Yaw

description

reference

limit

0x00

Command yaw angle

Ground

-π to π

0x08

Command yaw rate

Ground

5⁄6π rad/s

Coordinate

description

0x00

Horizontal command is ground_ENU frame

0x02

Horizontal command is body_FLU frame

Active Break

description

0x00

No active break

0x01

Actively break to hold position after stop sending setpoint

Wiki: dji_sdk (last edited 2017-12-20 22:42:05 by Zhiyuan Li)