Skip to content

Commit a884195

Browse files
author
Aaron Roller
authored
Merge pull request #10 from AutoModality/AM-682/camera-stream
Merge branch 'AM-682/camera-stream' of https://github.com/AutoModality/Onboard-SDK-ROS into AM-682/camera-stream AM-682/camera-stream
2 parents d1c14d4 + f77a5d7 commit a884195

64 files changed

Lines changed: 3082 additions & 1044 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/package.yml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,16 @@ on:
44
branches-ignore:
55
- master
66
jobs:
7-
package:
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
matrix:
11-
os: [ubuntu-18.04, [arm64,self-hosted,linux, build]]
12-
fail-fast: false
7+
package-cuda:
8+
runs-on: [arm64,self-hosted,linux, cuda]
139
steps:
1410
- uses: AutoModality/action-clean@v1.1.0
1511
- uses: actions/checkout@v2
16-
- uses: rlespinasse/github-slug-action@2.0.0 # for GITHUB_REF_SLUG
12+
- uses: rlespinasse/github-slug-action@3.1.0 # for GITHUB_REF_SLUG
1713
- name: Package
18-
id: package
19-
uses: AutoModality/action-package-debian-ros@v3
20-
with:
21-
branch: ${{ env.GITHUB_REF_SLUG }}
22-
build-number: ${{ github.run_number }}
23-
release-repo-entitlement: ${{ secrets.CLOUDSMITH_READ_RELEASE_ENTITLEMENT }}
24-
- name: The generated package
25-
run: echo "The artifact is ${{ steps.package.outputs.artifact-path }}"
14+
run: |
15+
AM_PLATFORM=dji_m300 amros packages install -y --password=${{ secrets.BUILD_PASSWORD }}
16+
echo ${{ secrets.BUILD_PASSWORD }} | sudo -S whoami && source /opt/ros/melodic/setup.bash && amros dev build deb --clean --version="0.0.${{ github.run_number }}"
2617
- name: Deploy
2718
id: deploy
2819
uses: AutoModality/action-cloudsmith@0.2.0
@@ -34,23 +25,14 @@ jobs:
3425
repo: 'dev'
3526
distro: 'ubuntu'
3627
release: 'bionic'
37-
file: '${{ steps.package.outputs.artifact-path }}'
28+
file: 'ros-melodic-dji-osdk-ros_0.0.${{ github.run_number }}-0bionic_arm64.deb' # version must match package phase
3829
draft-pr:
3930
runs-on: ubuntu-18.04
40-
needs: package
31+
needs: package-cuda
4132
steps:
4233
- uses: actions/checkout@v2
4334
- name: Draft a Pull Request
4435
uses: repo-sync/pull-request@v2
4536
with:
4637
pr_draft: true
4738
github_token: ${{ secrets.GITHUB_TOKEN }}
48-
# code-format:
49-
# runs-on: ubuntu-18.04
50-
# needs: package
51-
# steps:
52-
# - uses: actions/checkout@v2
53-
# - name: Format Code
54-
# uses: AutoModality/action-ros-clang-format@master
55-
# env:
56-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CMakeLists.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ add_message_files(
7373
FILES
7474

7575
FCTimeInUTC.msg
76+
JoystickParams.msg
7677
GPSUTC.msg
7778
Gimbal.msg
7879
Waypoint.msg
@@ -96,7 +97,7 @@ add_message_files(
9697
WaypointV2.msg
9798
WaypointV2MissionEventPush.msg
9899
WaypointV2MissionStatePush.msg
99-
100+
RelPosition.msg
100101
MobileData.msg
101102
PayloadData.msg
102103
MissionWaypointAction.msg
@@ -105,7 +106,11 @@ add_message_files(
105106
MissionHotpointTask.msg
106107
FlightAnomaly.msg
107108
VOPosition.msg
108-
RelPosition.msg
109+
BatteryState.msg
110+
BatteryWholeInfo.msg
111+
SmartBatteryState.msg
112+
SmartBatteryDynamicInfo.msg
113+
HMSPushInfo.msg
109114
)
110115

111116
## Generate services in the 'srv' folder
@@ -115,25 +120,36 @@ add_service_files(
115120
GetDroneType.srv
116121
GetM300StereoParams.srv
117122
FlightTaskControl.srv
123+
SetJoystickMode.srv
124+
JoystickAction.srv
125+
ObtainControlAuthority.srv
126+
KillSwitch.srv
127+
EmergencyBrake.srv
118128
GimbalAction.srv
119129
CameraEV.srv
120130
CameraShutterSpeed.srv
121131
CameraAperture.srv
122132
CameraISO.srv
123133
CameraFocusPoint.srv
124134
CameraTapZoomPoint.srv
135+
CameraSetZoomPara.srv
125136
CameraZoomCtrl.srv
126137
CameraStartShootSinglePhoto.srv
127138
CameraStartShootBurstPhoto.srv
128139
CameraStartShootAEBPhoto.srv
129140
CameraStartShootIntervalPhoto.srv
130141
CameraStopShootPhoto.srv
131142
CameraRecordVideoAction.srv
143+
GetWholeBatteryInfo.srv
144+
GetSingleBatteryDynamicInfo.srv
132145
MFIO.srv
133146
SetGoHomeAltitude.srv
134-
SetNewHomePoint.srv
147+
GetGoHomeAltitude.srv
148+
SetCurrentAircraftLocAsHomePoint.srv
149+
SetHomePoint.srv
135150
SetupCameraH264.srv
136-
AvoidEnable.srv
151+
SetAvoidEnable.srv
152+
GetAvoidEnable.srv
137153
InitWaypointV2Setting.srv
138154
UploadWaypointV2Mission.srv
139155
UploadWaypointV2Action.srv
@@ -145,6 +161,7 @@ add_service_files(
145161
GenerateWaypointV2Action.srv
146162
SetGlobalCruisespeed.srv
147163
GetGlobalCruisespeed.srv
164+
GetHMSData.srv
148165
SubscribeWaypointV2Event.srv
149166
SubscribeWaypointV2State.srv
150167

ReadMe.md

Lines changed: 58 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,68 @@
1-
# DJI Onboard SDK ROS 4.0.1
1+
# DJI Onboard SDK ROS 4.1.0
22

33
## Latest Update
44

5-
OSDK-ROS 4.0.1 was released on 24 August 2020.You need to read newest update below to get update information. Please see the [release notes](https://developer.dji.com/onboard-sdk/downloads/) and [ROS sample setup](https://developer.dji.com/cn/onboard-sdk/documentation/development-workflow/environment-setup.html#linux-with-ros) for more information.And We will update [ROS Wiki](http://wiki.ros.org/dji_sdk/) later.
5+
OSDK-ROS 4.1.0 was released on 20 January 2021.You need to read newest update below to get update information. Please see the [release notes](https://developer.dji.com/onboard-sdk/downloads/) and [ROS sample setup](https://developer.dji.com/cn/onboard-sdk/documentation/development-workflow/environment-setup.html#linux-with-ros) for more information.And We will update [ROS Wiki](http://wiki.ros.org/dji_sdk/) later.
66

77
### 1. feature
8-
This 4.0.1 version releases a feature package: dji_osdk_ros. The package contains two different framework's interface. OSDK-ROS-obsoleted kept ros3.8.1's interface.
8+
This 4.1.0 version releases a feature package: dji_osdk_ros. The package contains two different framework's interface. OSDK-ROS-obsoleted kept ros3.8.1's interface.
99
(__note:We will cancel support for the OSDK-ROS-obsoleted's interface in the next version.__)
1010

11-
| **OSDK-ROS4.0.1 interface** | **OSDK-ROS-obsoleted interface** |
11+
| **OSDK-ROS4.1.0 interface** | **OSDK-ROS-obsoleted interface** |
1212
|--------------------------------------|---------------------------------------------|
1313
|files below in dji_osdk_ros folder | files below in dji_osdk_ros_obsoleted folder|
1414

15-
This update mainly includes:
16-
1. Data subscription interface and sample;
17-
2. Mobile device interface and sample;
18-
3. Payload device interface and sample;
19-
4. Add the top obstacle avoidance enable interface;
20-
5. Waypoint1.0/2.0 interface and sample;
21-
6. Advanced sensing interface and sample perfection;
22-
include:
23-
> camera-h264
24-
> camera-stream
25-
> stereo-vision-depth-perception(rectified stereo images.disparity mapfiltered disparity map (Optional).point cloud)
26-
(__note: If you roslaunch dji_vehicle_node.launch to get m300_stereo_param.yaml, the yaml file will be prouduced in .ros folder(/home/${user}/.ros).And you need to copy it to the directory which you need to rosrun.__)
27-
7. we also kept all services and topics of osdk-ros 3.8.1. If you want to use these interfaces,you need to run dji_sdk_node and use it's services and topics.
15+
This update mainly includes:
16+
1. Battery information interface and sample;
17+
2. hms interface and sample;
18+
3. update flight-control interface and sample:
19+
include:
20+
>set_joystick_mode
21+
>joystick_action
22+
>get/set_go_home_altitude
23+
>set_home_point
24+
>rename 'set_current_point_as_home' to 'set_current_aircraft_point_as_home'
25+
>rename 'enable_avoid' to 'set_horizon_avoid_enable'
26+
>rename 'enable_upwards_avoid' to 'set_upwards_avoid_enable'
27+
>get_acoid_enable_status
28+
>kill_switch
29+
>emergency_brake
30+
>update flight_task_control,include:
31+
a.add velocity and yaw rate control action
32+
b.add turn on/off motor action
33+
c.add force landing and confirm landing action
34+
d.add cancel landing and cancel go home action
35+
36+
4. fixed telemetry_node problem:displayMode and rcConnection is zero.
37+
38+
5. we also kept all services and topics of osdk-ros 3.8.1. If you want to use these interfaces,you need to run dji_sdk_node and use it's services and topics.
2839
(__note: These interfaces are not fully compatible with onboard-sdk4.0.1.And they will not be supported in next osdk-ros version.__)
2940

3041
| **nodes** | **services's name** | **topics's name** |
3142
|--------------------------------------|--------------------------------------------------|---------------------------------------|
3243
|dji_vehicle_node |get_drone_type | |
3344
|flight_control_node |flight_task_control | |
3445
| |set_go_home_altitude | |
35-
| |set_current_point_as_home | |
36-
| |enable_avoid | |
37-
| |enable_upwards_avoid | |
46+
| |get_go_home_altitude | |
47+
| |set_current_aircraft_point_as_home | |
48+
| |set_horizon_avoid_enable | |
49+
| |set_upwards_avoid_enable | |
50+
| |set_local_pos_reference | |
51+
| |joystick_action | |
52+
| |set_joystick_mode | |
53+
| |set_home_point | |
54+
| |get_avoid_enable_status | |
55+
| |obtain_release_control_authority | |
56+
| |kill_switch | |
57+
| |emergency_brake | |
3858
|gimbal_camera_control_node |gimbal_task_control | |
3959
| |camera_task_set_EV | |
4060
| |camera_task_set_shutter_speed | |
4161
| |camera_task_set_aperture | |
4262
| |camera_task_set_ISO | |
4363
| |camera_task_set_focus_point | |
4464
| |camera_task_tap_zoom_point | |
65+
| |camera_task_set_zoom_para | |
4566
| |camera_task_zoom_ctrl | |
4667
| |camera_start_shoot_single_photo | |
4768
| |camera_start_shoot_aeb_photo | |
@@ -78,7 +99,10 @@ This update mainly includes:
7899
| | |dji_osdk_ros/stereo_240p_front_depth_images|
79100
| | |dji_osdk_ros/stereo_vga_front_left_images |
80101
| | |dji_osdk_ros/stereo_vga_front_right_images |
81-
|time_sync_node | | |
102+
|time_sync_node | |dji_osdk_ros/time_sync_nmea_msg |
103+
| | |dji_osdk_ros/time_sync_gps_utc |
104+
| | |dji_osdk_ros/time_sync_fc_time_utc |
105+
| | |dji_osdk_ros/time_sync_pps_source |
82106
|mission_node |dji_osdk_ros/mission_waypoint_upload | |
83107
| |dji_osdk_ros/mission_waypoint_action | |
84108
| |dji_osdk_ros/mission_waypoint_getInfo | |
@@ -112,6 +136,9 @@ This update mainly includes:
112136
| |dji_osdk_ros/waypointV2_getGlobalCruisespeed | |
113137
| |dji_osdk_ros/waypointV2_subscribeMissionEvent |dji_osdk_ros/waypointV2_mission_event |
114138
| |dji_osdk_ros/waypointV2_subscribeMissionState |dji_osdk_ros/swaypointV2_mission_state |
139+
|battery_node |get_whole_battery_info | |
140+
| |get_single_battery_dynamic_info | |
141+
|hms_node |get_hms_data | |
115142
### 2. Prerequisites
116143
The system environment we have tested is in the table below.
117144

@@ -120,13 +147,13 @@ The system environment we have tested is in the table below.
120147
| **system version** | ubuntu 16.04 |
121148
| **processor architecture** | x86(mainfold2-c),armv8(mainfold2-g) |
122149
#### Firmware Compatibility
123-
OSDK-ROS 4.0.1's firmware compatibility depends on onboard-sdk 4.0.1's. you can get more information [here](https://developer.dji.com/cn/document/0c2b2d75-d019-480c-9241-8c8e7209692d);
150+
OSDK-ROS 4.1.0's firmware compatibility depends on onboard-sdk 4.1.0's. you can get more information [here](https://developer.dji.com/cn/document/0c2b2d75-d019-480c-9241-8c8e7209692d);
124151
#### Ros
125152
you need to install ros first.Install instruction can be found at: http://wiki.ros.org/ROS/Installation. We just tested ROS kinetic version.
126153
#### C++11 Compiler
127154
We compile with C + + 11 Standard.
128155
#### onboard-sdk
129-
you need to download onboard-sdk4.0.1,and install it.
156+
you need to download onboard-sdk4.1.0,and install it.
130157
>$mkdir build
131158
>$cd build
132159
>$cmake ..
@@ -140,6 +167,8 @@ __note:we only test on kinetic,but it should be support on other version.__
140167
> $sudo apt install ffmpeg
141168
#### libusb-1.0-0-dev
142169
> $sudo apt install libusb-1.0-0-dev
170+
#### libsdl2-dev
171+
> $sudo apt install libsdl2-dev
143172
#### opencv3.x
144173
We use OpenCV to show images from camera stream. Download and install instructions can be found at: http://opencv.org. Tested with OpenCV 3.3.0.Suggest using 3.3.0+.
145174
#### stereo-vision function
@@ -158,7 +187,7 @@ You will need to add an udev file to allow your system to obtain permission and
158187
>$sudo vi DJIDevice.rules
159188
160189
Then add these content into DJIDevice.rules.
161-
>$SUBSYSTEM=="usb", ATTRS{idVendor}=="2ca3", MODE="0666"
190+
>SUBSYSTEM=="usb", ATTRS{idVendor}=="2ca3", MODE="0666"
162191
163192
At last,you need to reboot your computer to make sure it works.
164193

@@ -170,8 +199,8 @@ If you don't have a catkin workspace, create one as follows:
170199
>$mkdir src
171200
>$cd src
172201
>$catkin_init_workspace
173-
#### add osdk-ros 4.0.1
174-
Download osdk-ros 4.0.1 and put it into src.
202+
#### add osdk-ros 4.1.0
203+
Download osdk-ros 4.1.0 and put it into src.
175204
#### Build the dji_osdk_ros ROS package
176205
>$cd ..
177206
>$catkin_make
@@ -182,7 +211,7 @@ Download osdk-ros 4.0.1 and put it into src.
182211
2.Edit the launch file and enter your App ID, Key, Baudrate and Port name in the designated places.
183212
(__note:there are two launch file.
184213
dji_sdk_node.launch is for dji_sdk_node.(3.8.1's interface)
185-
dji_vehicle_node is for dji_vehicle_node(4.0.1's interface)__)
214+
dji_vehicle_node is for dji_vehicle_node(4.1.0's interface)__)
186215
> $rosed dji_osdk_ros dji_sdk_node.launch
187216
> $rosed dji_osdk_ros dji_vehicle_node.launch
188217
@@ -191,7 +220,7 @@ dji_vehicle_node is for dji_vehicle_node(4.0.1's interface)__)
191220
>dji_vehicle_node.launch does not need UserConfig.txt.
192221
#### Running the Samples
193222
1.Start up the dji_osdk_ros ROS node.
194-
if you want to use OSDK ROS 4.0.1's services and topics:
223+
if you want to use OSDK ROS 4.1.0's services and topics:
195224
>$roslaunch dji_osdk_ros dji_vehicle_node.launch
196225
197226
if you want to adapt to OSDK ROS 3.8.1's services and topics:
@@ -208,3 +237,4 @@ __note:if you want to rosrun dji_sdk_node,you need to put UserConfig.txt into cu
208237
You can get support from DJI and the community with the following methods:
209238
* Email to dev@dji.com
210239
* Report issue on github
240+

debian/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ Source: ros-melodic-dji-osdk-ros
22
Section: misc
33
Priority: optional
44
Maintainer: kevin.hoo <kevin.hoo@dji.com>
5-
Build-Depends: debhelper (>= 9.0.0), ros-melodic-actionlib, ros-melodic-actionlib-msgs, ros-melodic-catkin, ros-melodic-geometry-msgs, ros-melodic-message-filters, ros-melodic-message-generation, ros-melodic-nav-msgs, ros-melodic-nmea-msgs, ros-melodic-roscpp, ros-melodic-rospy, ros-melodic-std-msgs
5+
Build-Depends: debhelper (>= 9.0.0), opencv, ros-melodic-actionlib, ros-melodic-actionlib-msgs, ros-melodic-catkin, ros-melodic-geometry-msgs, ros-melodic-message-filters, ros-melodic-message-generation, ros-melodic-nav-msgs, ros-melodic-nmea-msgs, ros-melodic-roscpp, ros-melodic-rospy, ros-melodic-std-msgs
66
Homepage: http://developer.dji.com/onboard-sdk/documentation/github-platform-docs/ROS/README.html
77
Standards-Version: 3.9.2
88

99
Package: ros-melodic-dji-osdk-ros
1010
Architecture: any
11-
Depends: ${shlibs:Depends}, ${misc:Depends}, ros-melodic-actionlib, ros-melodic-actionlib-msgs, ros-melodic-geometry-msgs, ros-melodic-message-filters, ros-melodic-message-runtime, ros-melodic-nav-msgs, ros-melodic-nmea-msgs, ros-melodic-roscpp, ros-melodic-rospy, ros-melodic-std-msgs
11+
Depends: ${shlibs:Depends}, ${misc:Depends}, opencv, ros-melodic-actionlib, ros-melodic-actionlib-msgs, ros-melodic-geometry-msgs, ros-melodic-message-filters, ros-melodic-message-runtime, ros-melodic-nav-msgs, ros-melodic-nmea-msgs, ros-melodic-roscpp, ros-melodic-rospy, ros-melodic-std-msgs
1212
Description: A ROS package using DJI Onboard SDK

0 commit comments

Comments
 (0)