Giter Site home page Giter Site logo

onboard-sdk-ros's Introduction

DJI Onboard SDK ROS 4.1.0

Latest Update

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 and ROS sample setup for more information.And We will update ROS Wiki later.

1. feature

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.
(note:We will cancel support for the OSDK-ROS-obsoleted's interface in the next version.)

OSDK-ROS4.1.0 interface OSDK-ROS-obsoleted interface
files below in dji_osdk_ros folder files below in dji_osdk_ros_obsoleted folder

This update mainly includes:

  1. Battery information interface and sample;

  2. hms interface and sample;

  3. update flight-control interface and sample: include:

    set_joystick_mode
    joystick_action
    get/set_go_home_altitude
    set_home_point
    rename 'set_current_point_as_home' to 'set_current_aircraft_point_as_home'
    rename 'enable_avoid' to 'set_horizon_avoid_enable'
    rename 'enable_upwards_avoid' to 'set_upwards_avoid_enable'
    get_acoid_enable_status
    kill_switch
    emergency_brake
    update flight_task_control,include:
    a.add velocity and yaw rate control action
    b.add turn on/off motor action
    c.add force landing and confirm landing action
    d.add cancel landing and cancel go home action

  4. fixed telemetry_node problem:displayMode and rcConnection is zero.

  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.
    (note: These interfaces are not fully compatible with onboard-sdk4.0.1.And they will not be supported in next osdk-ros version.)

nodes services's name topics's name
dji_vehicle_node get_drone_type
flight_control_node flight_task_control
set_go_home_altitude
get_go_home_altitude
set_current_aircraft_point_as_home
set_horizon_avoid_enable
set_upwards_avoid_enable
set_local_pos_reference
joystick_action
set_joystick_mode
set_home_point
get_avoid_enable_status
obtain_release_control_authority
kill_switch
emergency_brake
gimbal_camera_control_node gimbal_task_control
camera_task_set_EV
camera_task_set_shutter_speed
camera_task_set_aperture
camera_task_set_ISO
camera_task_set_focus_point
camera_task_tap_zoom_point
camera_task_set_zoom_para
camera_task_zoom_ctrl
camera_start_shoot_single_photo
camera_start_shoot_aeb_photo
camera_start_shoot_burst_photo
camera_start_shoot_interval_photo
camera_stop_shoot_photo
camera_record_video_action
telemetry_node dji_osdk_ros/attitude
dji_osdk_ros/battery_state
dji_osdk_ros/imu
dji_osdk_ros/flight_status
dji_osdk_ros/gps_health
dji_osdk_ros/gps_position
dji_osdk_ros/vo_position
dji_osdk_ros/height_above_takeoff
dji_osdk_ros/velocity
dji_osdk_ros/from_mobile_data
dji_osdk_ros/from_payload_data
dji_osdk_ros/gimbal_angle
dji_osdk_ros/rc
dji_osdk_ros/local_position
dji_osdk_ros/local_frame_ref
dji_osdk_ros/time_sync_nmea_msg
dji_osdk_ros/time_sync_gps_utc
dji_osdk_ros/time_sync_fc_time_utc
dji_osdk_ros/time_sync_pps_source
dji_osdk_ros/main_camera_images
dji_osdk_ros/fpv_camera_images
dji_osdk_ros/camera_h264_stream
dji_osdk_ros/stereo_240p_front_left_images
dji_osdk_ros/stereo_240p_front_right_images
dji_osdk_ros/stereo_240p_down_front_images
dji_osdk_ros/stereo_240p_down_back_images
dji_osdk_ros/stereo_240p_front_depth_images
dji_osdk_ros/stereo_vga_front_left_images
dji_osdk_ros/stereo_vga_front_right_images
time_sync_node dji_osdk_ros/time_sync_nmea_msg
dji_osdk_ros/time_sync_gps_utc
dji_osdk_ros/time_sync_fc_time_utc
dji_osdk_ros/time_sync_pps_source
mission_node dji_osdk_ros/mission_waypoint_upload
dji_osdk_ros/mission_waypoint_action
dji_osdk_ros/mission_waypoint_getInfo
dji_osdk_ros/mission_waypoint_getSpeed
dji_osdk_ros/mission_waypoint_setSpeed
dji_osdk_ros/mission_hotpoint_upload
dji_osdk_ros/mission_hotpoint_action
dji_osdk_ros/mission_hotpoint_getInfo
dji_osdk_ros/mission_hotpoint_updateYawRate
dji_osdk_ros/mission_hotpoint_resetYaw
dji_osdk_ros/mission_hotpoint_updateRadius
dji_osdk_ros/mission_status
camera_stream_node setup_camera_stream
camera_h264_node setup_camera_h264
stereo_vision_depth_perception_node get_m300_stereo_params
stereo_240p_subscription
stereo_depth_subscription
stereo_vga_subscription
mobile_device_node send_data_to_mobile_device
payload_device_node send_data_to_payload_device_server
waypointV2_node dji_osdk_ros/waypointV2_initSetting
dji_osdk_ros/waypointV2_uploadMission
dji_osdk_ros/waypointV2_downloadMission
dji_osdk_ros/waypointV2_uploadAction
dji_osdk_ros/waypointV2_startMission
dji_osdk_ros/waypointV2_stopMission
dji_osdk_ros/waypointV2_pauseMission
dji_osdk_ros/waypointV2_resumeMission
dji_osdk_ros/waypointV2_generateActions
dji_osdk_ros/waypointV2_setGlobalCruisespeed
dji_osdk_ros/waypointV2_getGlobalCruisespeed
dji_osdk_ros/waypointV2_subscribeMissionEvent dji_osdk_ros/waypointV2_mission_event
dji_osdk_ros/waypointV2_subscribeMissionState dji_osdk_ros/swaypointV2_mission_state
battery_node get_whole_battery_info
get_single_battery_dynamic_info
hms_node get_hms_data

2. Prerequisites

The system environment we have tested is in the table below.

system version ubuntu 16.04
processor architecture x86(mainfold2-c),armv8(mainfold2-g)

Firmware Compatibility

OSDK-ROS 4.1.0's firmware compatibility depends on onboard-sdk 4.1.0's. you can get more information here;

Ros

you need to install ros first.Install instruction can be found at: http://wiki.ros.org/ROS/Installation. We just tested ROS kinetic version.

C++11 Compiler

We compile with C + + 11 Standard.

onboard-sdk

you need to download onboard-sdk4.1.0,and install it.

$mkdir build
$cd build
$cmake..
$sudo make -j7 install

nema-comms

$sudo apt install ros-{release}-nmea-comms

note:we only test on kinetic,but it should be support on other version.

ffmpeg

$sudo apt install ffmpeg

libusb-1.0-0-dev

$sudo apt install libusb-1.0-0-dev

libsdl2-dev

$sudo apt install libsdl2-dev

opencv3.x

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+.

stereo-vision function

Follow the instruction of here.

3.Permission

uart permission

You need to add your user to the dialout group to obtain read/write permissions for the uart communication.

$sudo usermod -a -G dialout ${USER}

Then log out of your user account and log in again for the permissions to take effect.

usb permission

You will need to add an udev file to allow your system to obtain permission and to identify DJI USB port.

$cd /etc/udev/rules.d/
$sudo vi DJIDevice.rules

Then add these content into DJIDevice.rules.

SUBSYSTEM=="usb", ATTRS{idVendor}=="2ca3", MODE="0666"

At last,you need to reboot your computer to make sure it works.

4. Building dji_osdk_ros pkg

create workspace

If you don't have a catkin workspace, create one as follows:

$mkdir catkin_ws
$cd catkin_ws
$mkdir src
$cd src
$catkin_init_workspace

add osdk-ros 4.1.0

Download osdk-ros 4.1.0 and put it into src.

Build the dji_osdk_ros ROS package

$cd ..
$catkin_make

Configuration

1.Remember to source your setup.bash.

$source devel/setup.bash

2.Edit the launch file and enter your App ID, Key, Baudrate and Port name in the designated places.
(note:there are two launch file.
dji_sdk_node.launch is for dji_sdk_node.(3.8.1's interface)
dji_vehicle_node is for dji_vehicle_node(4.1.0's interface)
)

$rosed dji_osdk_ros dji_sdk_node.launch
$rosed dji_osdk_ros dji_vehicle_node.launch

3.Remember to add UserConfig.txt to correct path.(in the current work directory)

If you want to run dji_sdk_node.launch, you need to put UserConfig.txt into /home/{user}/.ros. dji_vehicle_node.launch does not need UserConfig.txt.

Running the Samples

1.Start up the dji_osdk_ros ROS node.
if you want to use OSDK ROS 4.1.0's services and topics:

$roslaunch dji_osdk_ros dji_vehicle_node.launch

if you want to adapt to OSDK ROS 3.8.1's services and topics:

$roslaunch dji_osdk_ros dji_sdk_node.launch

2.Open up another terminal and cd to your catkin_ws location, and start up a sample (e.g. flight control sample).

$source devel/setup.bash
$rosrun dji_osdk_ros flight_control_node

note:if you want to rosrun dji_sdk_node,you need to put UserConfig.txt into current work directory.
3.Follow the prompt on screen to choose an action for the drone to do.

Support

You can get support from DJI and the community with the following methods:

onboard-sdk-ros's People

Contributors

amenondji avatar ausalimov avatar bobbyshashin avatar botaohu avatar dji-colin avatar dji-dev avatar dji-jerry avatar federkamm avatar groundmelon avatar hcbdreamer avatar jinxichan92 avatar lanyusea avatar matthiasnieuwenhuisen avatar oliverou avatar pcler avatar qboticslabs avatar samuelwangdji avatar talobin avatar xuhao1 avatar zlidji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onboard-sdk-ros's Issues

Matrice M600 Pro: SDK version did not match.

I have a Matrice 600 Pro with updated firmware (V1.0.0.80 according to DJI Assistant 2) and I get the following error when I launch the dji_sdk sdk_manifold.launch

STATUS init,line 62: Open serial device /dev/ttyUSB0 with baudrate 230400...
[ INFO] [1486087060.234682586]: Succeed to create thread for readPoll
Broadcast call back received
ERROR activateCallback,line 648: SDK version did not match
STATUS getDroneVersionCallback,line 594: version ack = 65281
STATUS getDroneVersionCallback,line 604: version name = v1.0 BETA PM820V3PRO-03.02.10.00

I set my launch file with the drone_version A3_32 but still can't get it to work.

activate SDK version did not match

Hi,

I have installed the DJI SDK ROS on a brix minicomputer. And I try to run "roslaunch dji_sdk sdk_manifold.launch"

But I get the next error and cant find whats wrong :

--- Connection Info ---
Serial port: /dev/ttyUSB0

Baudrate: 230400

STATUS init,line 41: going to open device /dev/ttyUSB0 with baudrate 230400...
STATUS init,line 46: ...succeed to start serial
[ INFO] [1459513193.703278180]: Succeed to create thread for readPoll
STATUS getVersionCallback,line 222: version ack = 65281
STATUS getVersionCallback,line 223: version crc = 0xD3D21804
STATUS getVersionCallback,line 225: version ID = SDK-v1.0 BETA M100-02.03.10.00
STATUS getVersionCallback,line 227: version name = TA M100-02.03.10.00
ERROR activateCallback,line 276: activate SDK version did not match
STATUS getVersionCallback,line 222: version ack = 65281
STATUS getVersionCallback,line 223: version crc = 0xD3D21804
STATUS getVersionCallback,line 225: version ID = SDK-v1.0 BETA M100-02.03.10.00
STATUS getVersionCallback,line 227: version name = TA M100-02.03.10.00

Thansk for your help

DJI2MAV package running problem

A month ago, I asked the same questions, and got the feedback,

But I was not able to run the DJI2MAV package as followings:

https://developer.dji.com/onboard-sdk/documentation/github-platform-docs/ROS_Example/ros_dji2mav_0.2.1_package.htm

Is there anyone of you who have successfully run DJI2MAV package as above link?

I was able to successfully run the dji-sdk-demo in Onboard-SDK-ROS

My recent work with DJI M100 ROS SDK is as follows

https://www.youtube.com/watch?v=CSGI49y4aXw
https://www.youtube.com/watch?v=K5SSV-0giWo

But, I don't know how to run the following examples:

https://github.com/dji-sdk/Onboard-SDK-ROS/tree/3.1/dji_sdk_dji2mav

I was able to successfully run the following commands:

roslaunch dji_sdk sdk_manifold.launch

But the problem occurs in following webpages:

https://github.com/dji-sdk/Onboard-SDK-ROS/tree/3.1/dji_sdk_dji2mav

it indicates as followings:

Record the IP and port of ground control station, modified the corresponding param in dji2mav_bringup.launch. Then run:

roslaunch dji_sdk_dji2mav dji2mav_bringup.launch

Especially, I don't know the what the IP and port of ground control station means in above sentences
(How can I find the the IP and port of ground control station?)

I was able to find the IP by ifconfig command, but was not able to find the port.

Does the IP and port of ground control station means those of the PC which is running Qgroundcontrol?

Actually, I changed the IP(which I found by "ifconfig" command) and port of the PC which is running Qgroundcontrol in dji2mav_bringup.launch file, but it failed.

<arg name="targetIp1" default="10.60.23.136" /> 
<arg name="targetPort1" default="14550" /> 
<arg name="srcPort1" default="14551" /> 

Control mode clarification

Hi,

I would like to clarify the control modes.

the onboard-sdk Appendix mentions commands can be given either in the ground frame or the body frame. I assume the ground frame to the NED such as the x, y input will result is motion along the NED frame. However, I'm confused about control behavior in the body frame mode. During testing it seem that the yaw command impact the direction of motion. Also what is the impact of non-stable mode vs stable mode?

Thanks

[Onboard Control Request Problem] STATUS activateCallback,line 280: new device, please link DJIGO to your remote controller and try again

I am using DJI Matrice 100,

and Onboard computer is intel NUC,

When I run dji_sdk_demo, and following occurs

In particular, following warning is produced

STATUS activateCallback,line 280: new device, please link DJIGO to your remote controller and try again

Thus, I cannot request control from RC to onboard computer

Would anyone of you help me out?

The entire output of command is as followings:

wkyoun@wkyoun:~/catkin_ws/src$ roslaunch dji_sdk sdk_dmm.launch

... logging to /home/wkyoun/.ros/log/2616ca64-4f03-11e6-9bd3-b8aeedea2130/roslaunch-wkyoun-5105.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.43.252:33820/

SUMMARY
========

PARAMETERS
 * /dji_sdk/app_bundle_id: Welcome to use dj...
 * /dji_sdk/app_id: 1030093
 * /dji_sdk/app_version: 1
 * /dji_sdk/baud_rate: 230400
 * /dji_sdk/enc_key: cf02c43d625667ecb...
 * /dji_sdk/groundstation_enable: 1
 * /dji_sdk/serial_name: /dev/ttyUSB0
 * /rosdistro: indigo
 * /rosversion: 1.11.19

NODES
  /
    dji_sdk (dji_sdk/dji_sdk_node)
    dji_sdk_client (dji_sdk_demo/dji_sdk_client)
    dji_tf (dji_tf/dji_tf)
    rviz (rviz/rviz)

auto-starting new master
process[master]: started with pid [5117]
ROS_MASTER_URI=http://192.168.43.252:11311

setting /run_id to 2616ca64-4f03-11e6-9bd3-b8aeedea2130
process[rosout-1]: started with pid [5130]
started core service [/rosout]
process[dji_sdk-2]: started with pid [5141]
process[dji_sdk_client-3]: started with pid [5148]
[ INFO] [1469078562.919109662]: sdk_service_client_test
process[dji_tf-4]: started with pid [5156]
process[rviz-5]: started with pid [5167]
=================================================
app id: 1030093
app version: 0x03010A00
app key: cf02c43d625667ecb0525276c0dbf1e9ec83a63a4c5fc2cf36f5c4ffd1504511
=================================================
--- Connection Info ---
Serial port: /dev/ttyUSB0
Baudrate: 230400

STATUS init,line 41: going to open device /dev/ttyUSB0 with baudrate 230400...
STATUS init,line 46: ...succeed to start serial
[ INFO] [1469078563.119421840]: Succeed to create thread for readPoll
STATUS getSDKVersionCallback,line 249: version ack = 65281STATUS getSDKVersionCallback,line     250: version crc = 0xA6453AACSTATUS getSDKVersionCallback,line     252: version ID = 041DD20869STATUS getSDKVersionCallback,line 255: version name = SDK-v1.0     BETA M100-03.01.01.00
STATUS activateCallback,line 280: new device, please link DJIGO to your remote controller and try again

Make way point mission in the demo dynamic

Was just browsing through changes and noticed something in the demo that can be improved a bit for the way point mission demo. This should make the way point mission dynamically perform zig-zag from its current position.

/dji_sdk_demo/src/client.cpp - line: 499

            // Currently hard coded, should be dynamic
            //static float orig_lat = 22.5401;
            //static float orig_long = 113.9468;
            static float orig_lat = drone->global_position.latitude;
            static float orig_long = drone->global_position.longitude;

There quite a few things that can be changed to improve the user experience of the dji_sdk_demo especially for beginners trying to study the demo for examples. When I have time I can clean up my highly modified (and messy) demo code, which I used to study the DJI SDK.

Attitude Control HORI_POS

Hello,
In the examples, the attitude control is within a loop. But from what I can understand if someone wants to work with HORI_POS flag, the developer should just send one command with the offset in meters and wait for it to be finished. Though, when simulating this, it does not seem to work as intended.
Is there something I am missing?
Thank you in advance,
-SK

cant control Matrice while mission_pause()

Is it normal that I can not control the Matrice (drone->attitude_control(0x40, x,y,z,yaw)) while flying waypoints (missionwaypoint) ? I paused the mission and than tried to control the Matrice, but this did not worked...

Kind regards,
Dries

GPS altitude not correct

I tried waypointnavigation.
In simulation everything worked fine, also in real life everything went fine, except the GPS altitude () was not correct (-137m in Belgium ?!). Although the matrice went to the correct GPS coordinate and altitude (is guess it used baro altitude ?). But the waypoint altitude and altitude-progress (waypoint_navigation_feedback.altitude_progress) was not correct. Any idea what could be wrong ?

ctakin_make errors

I'm getting below errors when running catkin_make on latest version:

[100%] Building CXX object Onboard-SDK-ROS/dji_sdk_web_groundstation/CMakeFiles/dji_sdk_web_client.dir/src/map_nav_srv.cpp.o
Linking CXX executable /home/shitals/vso/msresearch/Theseus/catkin_ws/devel/lib/run_depth_2_cloud/run_depth_2_cloud_node
[100%] Built target run_depth_2_cloud_node
Linking CXX executable /home/shitals/vso/msresearch/Theseus/catkin_ws/devel/lib/dji_sdk_dji2mav/minimal
[100%] Built target minimal
In file included from /opt/ros/indigo/include/ros/ros.h:40:0,
                 from /home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_dji2mav/src/dji2mav_bringup.cpp:15:
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_dji2mav/src/dji2mav_bringup.cpp: In function ‘void respondToWpTarget(const float (*)[7], uint16_t, uint16_t)’:
/opt/ros/indigo/include/ros/console.h:342:176: warning: format ‘%d’ expects argument of type ‘int’, but argument 8 has type ‘std::vector<dji_sdk::MissionWaypoint_<std::allocator<void> >, std::allocator<dji_sdk::MissionWaypoint_<std::allocator<void> > > >::size_type {aka long unsigned int}’ [-Wformat=]
     ::ros::console::print(filter, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, __FILE__, __LINE__, __ROSCONSOLE_FUNCTION__, __VA_ARGS__)
                                                                                                                                                                                ^
/opt/ros/indigo/include/ros/console.h:345:5: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER’
     ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER(0, __VA_ARGS__)
     ^
/opt/ros/indigo/include/ros/console.h:375:7: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION’
       ROSCONSOLE_PRINT_AT_LOCATION(__VA_ARGS__); \
       ^
/opt/ros/indigo/include/ros/console.h:557:35: note: in expansion of macro ‘ROS_LOG_COND’
 #define ROS_LOG(level, name, ...) ROS_LOG_COND(true, level, name, __VA_ARGS__)
                                   ^
/opt/ros/indigo/include/rosconsole/macros_generated.h:110:23: note: in expansion of macro ‘ROS_LOG’
 #define ROS_INFO(...) ROS_LOG(::ros::console::levels::Info, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)
                       ^
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_dji2mav/src/dji2mav_bringup.cpp:117:5: note: in expansion of macro ‘ROS_INFO’
     ROS_INFO("Size of the wpl: %d", task.mission_waypoint.size());
     ^
In file included from /opt/ros/indigo/include/ros/ros.h:40:0,
                 from /home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_web_groundstation/src/map_nav_srv.cpp:1:
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_web_groundstation/src/map_nav_srv.cpp: In function ‘void goalCB()’:
/opt/ros/indigo/include/ros/console.h:342:176: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     ::ros::console::print(filter, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, __FILE__, __LINE__, __ROSCONSOLE_FUNCTION__, __VA_ARGS__)
                                                                                                                                                                                ^
/opt/ros/indigo/include/ros/console.h:345:5: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER’
     ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER(0, __VA_ARGS__)
     ^
/opt/ros/indigo/include/ros/console.h:375:7: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION’
       ROSCONSOLE_PRINT_AT_LOCATION(__VA_ARGS__); \
       ^
/opt/ros/indigo/include/ros/console.h:557:35: note: in expansion of macro ‘ROS_LOG_COND’
 #define ROS_LOG(level, name, ...) ROS_LOG_COND(true, level, name, __VA_ARGS__)
                                   ^
/opt/ros/indigo/include/rosconsole/macros_generated.h:110:23: note: in expansion of macro ‘ROS_LOG’
 #define ROS_INFO(...) ROS_LOG(::ros::console::levels::Info, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)
                       ^
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_web_groundstation/src/map_nav_srv.cpp:81:13: note: in expansion of macro ‘ROS_INFO’
             ROS_INFO("Cancel task with tid %llu", tid_);
             ^
/opt/ros/indigo/include/ros/console.h:342:176: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     ::ros::console::print(filter, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, __FILE__, __LINE__, __ROSCONSOLE_FUNCTION__, __VA_ARGS__)
                                                                                                                                                                                ^
/opt/ros/indigo/include/ros/console.h:345:5: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER’
     ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER(0, __VA_ARGS__)
     ^
/opt/ros/indigo/include/ros/console.h:375:7: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION’
       ROSCONSOLE_PRINT_AT_LOCATION(__VA_ARGS__); \
       ^
/opt/ros/indigo/include/ros/console.h:557:35: note: in expansion of macro ‘ROS_LOG_COND’
 #define ROS_LOG(level, name, ...) ROS_LOG_COND(true, level, name, __VA_ARGS__)
                                   ^
/opt/ros/indigo/include/rosconsole/macros_generated.h:110:23: note: in expansion of macro ‘ROS_LOG’
 #define ROS_INFO(...) ROS_LOG(::ros::console::levels::Info, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)
                       ^
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_web_groundstation/src/map_nav_srv.cpp:87:17: note: in expansion of macro ‘ROS_INFO’
                 ROS_INFO("Start task with tid %llu", tid_);
                 ^
/opt/ros/indigo/include/ros/console.h:342:176: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     ::ros::console::print(filter, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, __FILE__, __LINE__, __ROSCONSOLE_FUNCTION__, __VA_ARGS__)
                                                                                                                                                                                ^
/opt/ros/indigo/include/ros/console.h:345:5: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER’
     ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER(0, __VA_ARGS__)
     ^
/opt/ros/indigo/include/ros/console.h:375:7: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION’
       ROSCONSOLE_PRINT_AT_LOCATION(__VA_ARGS__); \
       ^
/opt/ros/indigo/include/ros/console.h:557:35: note: in expansion of macro ‘ROS_LOG_COND’
 #define ROS_LOG(level, name, ...) ROS_LOG_COND(true, level, name, __VA_ARGS__)
                                   ^
/opt/ros/indigo/include/rosconsole/macros_generated.h:110:23: note: in expansion of macro ‘ROS_LOG’
 #define ROS_INFO(...) ROS_LOG(::ros::console::levels::Info, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)
                       ^
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_web_groundstation/src/map_nav_srv.cpp:94:17: note: in expansion of macro ‘ROS_INFO’
                 ROS_INFO("Pause task with tid %llu", tid_);
                 ^
/opt/ros/indigo/include/ros/console.h:342:176: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     ::ros::console::print(filter, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, __FILE__, __LINE__, __ROSCONSOLE_FUNCTION__, __VA_ARGS__)
                                                                                                                                                                                ^
/opt/ros/indigo/include/ros/console.h:345:5: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER’
     ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER(0, __VA_ARGS__)
     ^
/opt/ros/indigo/include/ros/console.h:375:7: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION’
       ROSCONSOLE_PRINT_AT_LOCATION(__VA_ARGS__); \
       ^
/opt/ros/indigo/include/ros/console.h:557:35: note: in expansion of macro ‘ROS_LOG_COND’
 #define ROS_LOG(level, name, ...) ROS_LOG_COND(true, level, name, __VA_ARGS__)
                                   ^
/opt/ros/indigo/include/rosconsole/macros_generated.h:110:23: note: in expansion of macro ‘ROS_LOG’
 #define ROS_INFO(...) ROS_LOG(::ros::console::levels::Info, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)
                       ^
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_web_groundstation/src/map_nav_srv.cpp:101:17: note: in expansion of macro ‘ROS_INFO’
                 ROS_INFO("Resume task with tid %llu", tid_);
                 ^
/opt/ros/indigo/include/ros/console.h:342:176: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘dji_sdk_web_groundstation::WebWaypointReceiveGoal_<std::allocator<void> >::_tid_type {aka long unsigned int}’ [-Wformat=]
     ::ros::console::print(filter, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, __FILE__, __LINE__, __ROSCONSOLE_FUNCTION__, __VA_ARGS__)
                                                                                                                                                                                ^
/opt/ros/indigo/include/ros/console.h:345:5: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER’
     ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER(0, __VA_ARGS__)
     ^
/opt/ros/indigo/include/ros/console.h:375:7: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION’
       ROSCONSOLE_PRINT_AT_LOCATION(__VA_ARGS__); \
       ^
/opt/ros/indigo/include/ros/console.h:557:35: note: in expansion of macro ‘ROS_LOG_COND’
 #define ROS_LOG(level, name, ...) ROS_LOG_COND(true, level, name, __VA_ARGS__)
                                   ^
/opt/ros/indigo/include/rosconsole/macros_generated.h:110:23: note: in expansion of macro ‘ROS_LOG’
 #define ROS_INFO(...) ROS_LOG(::ros::console::levels::Info, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)
                       ^
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_web_groundstation/src/map_nav_srv.cpp:110:17: note: in expansion of macro ‘ROS_INFO’
                 ROS_INFO("Set task(if any) with tid %llu preemted", newGoal.tid);
                 ^
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_web_groundstation/src/map_nav_srv.cpp: In function ‘void cmdCB(const MapNavSrvCmdConstPtr&)’:
/opt/ros/indigo/include/ros/console.h:342:176: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 9 has type ‘dji_sdk_web_groundstation::MapNavSrvCmd_<std::allocator<void> >::_tid_type {aka long unsigned int}’ [-Wformat=]
     ::ros::console::print(filter, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, __FILE__, __LINE__, __ROSCONSOLE_FUNCTION__, __VA_ARGS__)
                                                                                                                                                                                ^
/opt/ros/indigo/include/ros/console.h:345:5: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER’
     ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER(0, __VA_ARGS__)
     ^
/opt/ros/indigo/include/ros/console.h:375:7: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION’
       ROSCONSOLE_PRINT_AT_LOCATION(__VA_ARGS__); \
       ^
/opt/ros/indigo/include/ros/console.h:557:35: note: in expansion of macro ‘ROS_LOG_COND’
 #define ROS_LOG(level, name, ...) ROS_LOG_COND(true, level, name, __VA_ARGS__)
                                   ^
/opt/ros/indigo/include/rosconsole/macros_generated.h:110:23: note: in expansion of macro ‘ROS_LOG’
 #define ROS_INFO(...) ROS_LOG(::ros::console::levels::Info, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)
                       ^
/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Onboard-SDK-ROS/dji_sdk_web_groundstation/src/map_nav_srv.cpp:201:5: note: in expansion of macro ‘ROS_INFO’
     ROS_INFO("Received command \"%c\" of tid %llu", msg->cmdCode, msg->tid);
     ^
Linking CXX executable /home/shitals/vso/msresearch/Theseus/catkin_ws/devel/lib/dji_sdk_dji2mav/dji2mav_bringup
[100%] Built target dji2mav_bringup

Time delay on Zenmuse Z3

Hi, I am using DJI M100 with Zenmuse Z3 camera.
I wonder through the ROS packages provided by the Onboard_SDK_READ_CAM,
what is the time delay of the camera,
since I use rviz to visualize it I can feel there maybe 0.5 seconds delay.
Are there any way to reduce the delay?

Should I lock the variables in dji_drones.h when I read them?

I include the dji_drone.h in my own project and use AsyncSpinner spinner(4) to handle all the callback functions. Then i read variables that I need in my project. Since the callback handler thread and my main thread is not the same one, should I perform "add lock" and "release lock" operation to the related variables? Can you provide me with some ideas? Thank you very much!

Issues with 0.1.8 Release

I was testing out the 0.1.8 release and noticed that dji_sdk topics are completely broken (e.g. my /dji_sdk/gimbal topic is reads 0.0, 0.0, 0.0). Is there firmware update for the M100 that is suppose to coincide with the 0.1.8 release, am I missing anything, or 0.1.8 has bugs? Rolling back to 0.1.7 release fixed the topics.

Thank you

cant subscribe on /dji_sdk/waypoint_navigation_action/feedback

When i try to subscribe on above topic I get following error:

[ INFO] [1453822400.085506030]: sdk_service_client_test
terminate called after throwing an instance of 'ros::ConflictingSubscriptionException'
  what():  Tried to subscribe to a topic with the same name but different md5sum as a topic that was already subscribed [dji_sdk/WaypointNavigationFeedback/28c39cf9bce64572a77ec405558cca9e vs. dji_sdk/WaypointNavigationActionFeedback/2bf531c7224b7f96b03a6df639e60db3]
Aborted

This is my code:

ros::Subscriber sub = nh.subscribe("/dji_sdk/waypoint_navigation_action/feedback", 1, waypointInfo);

and

void waypointInfo(const dji_sdk::WaypointNavigationFeedback::ConstPtr& msg)
{
  cout << "test " <<  msg->latitude_progress << endl;
}

I dont know if this is a ROS problem or something in the SDK or in my code?

I think it is because somewhere in the code (in other file) the topic is already subscribed?!

I want to print the waypoint progress from within the dji_sdk_demo...

relocation R_X86_64_32 linking failure on dji_sdk_lib

If I try to use the dji_sdk_lib on a shared library (a ROS plugin in this case) I get the following error:

/usr/bin/ld:~/catkin_ws/devel/lib/libdji_sdk_lib.a(DJI_HotPoint.cpp.o): relocation R_X86_64_32 against `_ZN3DJI10onboardSDK8HotPoint13startCallbackEPNS0_7CoreAPIEPNS0_6HeaderEPv' can not be used when making a shared object; recompile with -fPIC
~/catkin_ws/devel/lib/libdji_sdk_lib.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [~/catkin_ws/devel/lib/libdji_plugin.so] Error 1
make[1]: *** [CMakeFiles/dji_plugin.dir/all] Error 2
make: *** [all] Error 2

After searching a bit, it seems that I have to enable the -fPIC compiler flag on the dji_sdk_lib package:

set(CMAKE_CXX_FLAGS "-std=c++11 -fPIC ${CMAKE_CXX_FLAGS}")

This works. It seems that it fails if you are trying to compile a shared object in an x64 architecture, in order to include a static library it has to be "Position Idependent Code", which is enabled with -fPIC on GCC.

Is there any reason for not doing this? Should I send a PR?

[Problem] dji_sdk_dji2mav crashes at start

After launching with command roslaunch dji_sdk_dji2mav dji2mav_bringup.launch
I get the following:

started roslaunch server http://diego-UX303UB:33038/

SUMMARY

PARAMETERS

  • /dji2mav_bringup/srcPort1: 14551
  • /dji2mav_bringup/srcPort2: 14555
  • /dji2mav_bringup/targetIp1: 127.0.0.1
  • /dji2mav_bringup/targetIp2: 127.0.0.1
  • /dji2mav_bringup/targetPort1: 14550
  • /dji2mav_bringup/targetPort2: 14554
  • /rosdistro: indigo
  • /rosversion: 1.11.20

NODES
/
dji2mav_bringup (dji_sdk_dji2mav/dji2mav_bringup)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[dji2mav_bringup-1]: started with pid [17272]
[dji2mav] [INFO] Going to establish connection for Manager with index 0. The size of sender list is set to 16, the size of send buf and recv buf are set to 512 and 4096...
[dji2mav] [INFO] Going to establish connection with 127.0.0.1:14550 using port 14551...
[dji2mav] [INFO] Attempt to connect to 127.0.0.1:14550 using local port 14551...
[dji2mav] [INFO] ...connection succeed.
[dji2mav] [INFO] ...succeed in establishing connection.
[dji2mav] [INFO] ...succeed in establishing connection for Manager 0.
[dji2mav] [INFO] Going to establish connection for Manager with index 1. The size of sender list is set to 16, the size of send buf and recv buf are set to 512 and 4096...
[dji2mav] [INFO] Going to establish connection with 127.0.0.1:14554 using port 14555...
[dji2mav] [INFO] Attempt to connect to 127.0.0.1:14554 using local port 14555...
[dji2mav] [INFO] ...connection succeed.
[dji2mav] [INFO] ...succeed in establishing connection.
[dji2mav] [INFO] ...succeed in establishing connection for Manager 1.
[dji2mav] [INFO] Succeed in registering module heartbeat.
[dji2mav] [INFO] Succeed in registering module sensors.
[dji2mav] [INFO] Succeed in registering module waypoint.
[dji2mav] [INFO] Succeed in registering module hotpoint.
[dji2mav_bringup-1] process has died [pid 17272, exit code -11, cmd /home/diego/catkin_ws/devel/lib/dji_sdk_dji2mav/dji2mav_bringup __name:=dji2mav_bringup __log:=/home/diego/.ros/log/a6f963ec-8cd6-11e6-8dde-1002b5ee16c8/dji2mav_bringup-1.log].
log file: /home/diego/.ros/log/a6f963ec-8cd6-11e6-8dde-1002b5ee16c8/dji2mav_bringup-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

I tried using another computer instead of localhost and got the same result
My .launch looks like this

<arg name="targetIp1" default="127.0.0.1" />
<arg name="targetPort1" default="14550" />
<arg name="srcPort1" default="14551" />

<arg name="targetIp2" default="127.0.0.1" />
<arg name="targetPort2" default="14548" />
<arg name="srcPort2" default="14549" />

<node name="dji2mav_bringup" pkg="dji_sdk_dji2mav" type="dji2mav_bringup" output="screen">
    <param name="targetIp1" type="string" value="$(arg targetIp1)" />
    <param name="targetPort1" type="int" value="$(arg targetPort1)" />
    <param name="srcPort1" type="int" value="$(arg srcPort1)" />

    <param name="targetIp2" type="string" value="$(arg targetIp2)" />
    <param name="targetPort2" type="int" value="$(arg targetPort2)" />
    <param name="srcPort2" type="int" value="$(arg srcPort2)" />
</node>

[A3] SDK version did not match

Hi all,

My drone is S900 with A3 Pro controller.
When I tried to launch sdk_maniford.launch, the error is

[ INFO] [1486031607.453965129]: Succeed to create thread for readPoll
Broadcast call back received
ERROR activateCallback,line 648: SDK version did not match
STATUS getDroneVersionCallback,line 595: version ack = 65281
STATUS getDroneVersionCallback,line 604: version name = v1.0 BETA A3-03.02.15.37

I found same problem in latest discussions in DJI Forum, such as 1 and 2.

All my A3 firmware version is the latest, and Enable API Control is selected.
I tried to change drone_version in launch file both to "A3_32" and "A3_31", but neither could work.

Is there any advice?
Thank you in advance!

compatibility with Matrice 600

I planing to buy a DJI Matrice 600 for research purpose, because I need more payload. I know that the onboard SDK is compatible with Matrice 600, what about the ROS version? is it compatible or is planned to be compatible? Is the manifold compatible with the Matrice 600? If so, me and my team will participate actively in this development.
Many thanks in advanced

Error during "catkin_make"

Hello everyone,

Im trying to run the cam package, but I'm facing a weird error. I've followed this tutorial TUTO but when I do "catkin_make" the following error appears:

OBS: yes, I did "source devel/setup.bash"
OBS1: "catkin_make clean" too
OBS2: I've checked all the dependences and they are all there

root@tegra-ubuntu:/home/ubuntu/workspace# catkin_make
Base path: /home/ubuntu/workspace
Source space: /home/ubuntu/workspace/src
Build space: /home/ubuntu/workspace/build
Devel space: /home/ubuntu/workspace/devel
Install space: /home/ubuntu/workspace/install
WARNING: Package name "FCS" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits and underscores.

Running command: "make cmake_check_build_system" in "/home/ubuntu/workspace/build"

Running command: "make -j2 -l2" in "/home/ubuntu/workspace/build"

[ 0%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_Link.cpp.o
[ 1%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_HotPoint.cpp.o
[ 1%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_WayPoint.cpp.o
[ 1%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_App.cpp.o
[ 2%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_VirtualRC.cpp.o
[ 2%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_HardDriver.cpp.o
[ 2%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_API.cpp.o
[ 3%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_Memory.cpp.o
[ 3%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_Mission.cpp.o
[ 3%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_Codec.cpp.o
[ 4%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_Flight.cpp.o
[ 4%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_Follow.cpp.o
[ 4%] Building CXX object dji_sdk_lib/CMakeFiles/dji_sdk_lib.dir/src/DJI_Camera.cpp.o
Linking CXX static library /home/ubuntu/workspace/devel/lib/libdji_sdk_lib.a
[ 4%] Built target dji_sdk_lib
[ 4%] Building CXX object dji_sdk_read_cam/CMakeFiles/dji_sdk_read_cam.dir/src/nv_cam.cpp.o
/home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp: In function 'int main(int, char*)':
/home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:230:118: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
cam_info.K = {388.40923066779754, 0.0, 318.06257844065226, 0.0, 518.1538449374815, 241.17339016626644, 0.0, 0.0, 1.0};
^
/home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:230:13: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
cam_info.K = {388.40923066779754, 0.0, 318.06257844065226, 0.0, 518.1538449374815, 241.17339016626644, 0.0, 0.0, 1.0};
^
/home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:231:59: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
cam_info.R = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0};
^
/home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:231:13: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
cam_info.R = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0};
^
/home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:232:131: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
cam_info.P = {373.5429992675781, 0.0, 317.51131336952494, 0.0, 0.0, 504.4360656738281, 240.6131009245937, 0.0, 0.0, 0.0, 1.0, 0.0};
^
/home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:232:13: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
cam_info.P = {373.5429992675781, 0.0, 317.51131336952494, 0.0, 0.0, 504.4360656738281, 240.6131009245937, 0.0, 0.0, 0.0, 1.0, 0.0};
^
/home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:272:14: error: no match for 'operator=' (operand types are 'cv::Mat' and 'IplImage
{aka IplImage}')
cvi.image = pImg;
^
/home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:272:14: note: candidates are:
In file included from /usr/local/include/opencv2/core/mat.hpp:3440:0,
from /usr/local/include/opencv2/core.hpp:59,
from /usr/local/include/opencv2/core/core.hpp:48,
from /opt/ros/indigo/include/cv_bridge/cv_bridge.h:43,
from /home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:3:
/usr/local/include/opencv2/core/mat.inl.hpp:575:6: note: cv::Mat& cv::Mat:perator=(const cv::Mat&)
Mat& Mat:perator = (const Mat& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp:575:6: note: no known conversion for argument 1 from 'IplImage_ {aka IplImage}' to 'const cv::Mat&'
/usr/local/include/opencv2/core/mat.inl.hpp:3055:6: note: cv::Mat& cv::Mat:perator=(const cv::MatExpr&)
Mat& Mat:perator = (const MatExpr& e)
^
/usr/local/include/opencv2/core/mat.inl.hpp:3055:6: note: no known conversion for argument 1 from 'IplImage_ {aka IplImage}' to 'const cv::MatExpr&'
In file included from /usr/local/include/opencv2/core.hpp:59:0,
from /usr/local/include/opencv2/core/core.hpp:48,
from /opt/ros/indigo/include/cv_bridge/cv_bridge.h:43,
from /home/ubuntu/workspace/src/dji_sdk_read_cam/src/nv_cam.cpp:3:
/usr/local/include/opencv2/core/mat.hpp:1113:10: note: cv::Mat& cv::Mat:perator=(const Scalar&)
Mat& operator = (const Scalar& s);
^
/usr/local/include/opencv2/core/mat.hpp:1113:10: note: no known conversion for argument 1 from 'IplImage_ {aka IplImage*}' to 'const Scalar& {aka const cv::Scalar&}'
make[2]: *** [dji_sdk_read_cam/CMakeFiles/dji_sdk_read_cam.dir/src/nv_cam.cpp.o] Error 1
make[1]: *** [dji_sdk_read_cam/CMakeFiles/dji_sdk_read_cam.dir/all] Error 2
make: *** [all] Error 2
make: INTERNAL: Exiting with 3 jobserver tokens available; should be 2!
Invoking "make -j2 -l2" failed

Could someone help me with that:

Thank you.

Manifold read X3 cam need root every time

When i am using read_cam node to read image from X3 by Manifold, it needs root to launch the node, the driver needs root to read and write USB port, so can i add rules file to /etc/udev/rules.d?
And if so, what this file should be looks like?

error during initilaization

Hey,

I am at the activation step that needs to be done before using onboard-sdk-ros. I have modified the launch file "dji_sdk/launch/sdk_manifold.launch" accordingly.Now, When I try "roslaunch dji_sdk sdk_manifold.launch" I get the following error ERROR _serialOpen,line 129: cannot open device /dev/ttyTHS1 ERROR init,line 44: ...fail to start serial
could anyone tell me what to do now?

edit:
I managed to find the right serial address and I get STATUS init,line 46: ...succeed to start serial [ INFO] [1468858894.814610464]: Succeed to create thread for readPoll

and its is stuck there, it is not going through with the activation.

Thanks

Matrice 100 can't connect to a second computer

Help! We connected our group's M100 to a laptop, and it seems to be "bound" to that computer. No one else's computer seems to be able to connect to our M100. Please advise - is there a way around this? Is this a bug? Is there a way to "reset" the connection so a different computer can connect to it?

No output on the flight status topic

I have upgraded to the newest version of the SDK but noticed there is no data published on the flight status topic (as opposed to my current older sdk version).

Dji M100 autopilot commands not taken into account

@paulyang1990 @botaohu @lanyusea @ziyangli @groundmelon
Am trying to control dji M100 in attitude with Onboard-SDK-ROS/dji_sdk. Blow is the simple and very short code am using:

#include <dji_sdk/dji_drone.h>
#include <ros/ros.h>
#include <unistd.h>

using namespace std;


int main(int argc, char **argv){

  ros::init(argc, argv, "m100ctrl");
  ROS_INFO("sdk_service_client_test");
  ros::NodeHandle nh;
  DJIDrone* drone = new DJIDrone(nh);
  ros::Rate rate(50.);

  cout << "requesting sdk permission control... " << endl;
  drone->request_sdk_permission_control();
  //drone->release_sdk_permission_control();

  cout << "Take off... " << endl;
  drone->takeoff();
  usleep(5*1e6); // in sec
  cout << endl <<  endl << "**** End of take off... " << endl;


  //************** LOOP
  //drone->release_sdk_permission_control();
  int itr(0);
  while (ros::ok() && itr <1000)
    {
      double roll(0), pitch(0), thr(90), yaw(0);
      cout << "***** Attitude control " << itr << endl;
      // drone->request_sdk_permission_control();
      drone->attitude_control(0x2A /*2A*/, (float)roll, (float)pitch, (float)thr, (float)yaw);
      ros::spinOnce();
      ++itr;
      rate.sleep();
    }

  cout << "Landing... " << endl<< endl<< endl<< endl;
  drone->landing();

  cout << "... end."<< endl;


  return 0;
}

Takeoff is taken into account. However, the rest of the code

drone->attitude_control(0x2A /*2A*/, (float)roll, (float)pitch, (float)thr, (float)yaw);

does not seem at all taken correctly int account. The drone behaves erratically. Sometimes the motors tun with low speed, while sometimes they slowly accelerate (sometimes several minutes) to reach high speed.

Why this? Am I missing something?Am really stuck at this point....

attitude_control assumes GPS

Hi,

I noticed that when we want to use drone->attitude_control(0x40, x, x, x, x); (both horizontal and vertical velocity) that we need GPS. (Test: works outdoor with GPS but not indoor without GPS). Is there a possibility to use it without GPS ? Or another way to send pitch, roll speeds to the matrice ?

Kind Regards,
Dries

gimbal_angle_control

I try to turn the gimbal downwards by sending:
gimbal_angle_control(0,-900,0,10);
This works but when I rotate the Matrice (yaw axis), the camera keeps its position towards the ground by rotating its yaw axis. I dont want this, I want the camera to rotate with the matrice, so yaw axis fixed wrt the Matrice, so I tried this:
gimbal_angle_control(0,-900,0,10,0,1);
But this is also not working, any idea what I have to try ?

Kind Regards

Landing and attitude control

Hello,
While in landing, the drone responds to remote controller input, but does not seem to respond to attitude control commands issued via the onboard sdk. Should this be happening? If yes, is there a way to attitude control while landing?

Thank you in advance,
-SK

simulator not working with the manifold

Hi,
I have installed onboard sdk ros in the manifold and connected the M100 to the dji pc simulator using micro usb cable.Followed this link exactly,

[(https://dl.djicdn.com/downloads/manifold/en/Using_Manifold_to_Control_Matrice_100_en.pdf)]

i launched the dji_sdk_client (in the demo) and tried with various options like take off,arm/disarm, the simulator is not reacting.Besides,i have connected the remote controller with function mode with the dji go app.For your information,the simulator is working with rc and dji go app except with manifold.
How to activate the manifold controls in the dji pc simulator.
Is there any solution for this problem?

Is M600 supported

In the code, I see a lot of references to M100, but non for M600. Is M600 supported?

[Problem] DJI SDK-ROS Mavlink example

I was able to successfully run the dji-sdk-demo in Onboard-SDK-ROS

But, I don't know how to run the following examples:

https://github.com/dji-sdk/Onboard-SDK-ROS/tree/3.1/dji_sdk_dji2mav

I was able to successfully run the following commands:

roslaunch dji_sdk sdk_manifold.launch

But the problem occurs in following webpages:

https://github.com/dji-sdk/Onboard-SDK-ROS/tree/3.1/dji_sdk_dji2mav

it indicates as followings:

Record the IP and port of ground control station, modified the corresponding param in dji2mav_bringup.launch. Then run:

roslaunch dji_sdk_dji2mav dji2mav_bringup.launch

Especially, I don't know the what the IP and port of ground control station means in above sentences
(How can I find the the IP and port of ground control station?)

I was able to find the IP by ifconfig command, but was not able to find the port.

Does the IP and port of ground control station means those of the PC which is running Qgroundcontrol?

Actually, I changed the IP(which I found by "ifconfig" command) and port of the PC which is running Qgroundcontrol in dji2mav_bringup.launch file, but it failed.

<arg name="targetIp1" default="10.60.23.136" /> 
<arg name="targetPort1" default="14550" /> 
<arg name="srcPort1" default="14551" /> 

DJI on board SDK ROS, only fly to the first way point and then go home

` // something to prepare the autopilot
newWaypointList.waypoint_list.push_back(waypoint1);
newWaypointList.waypoint_list.push_back(waypoint2);
newWaypointList.waypoint_list.push_back(waypoint3);
newWaypointList.waypoint_list.push_back(waypoint4);

drone->waypoint_navigation_send_request(newWaypointList);
drone->gohome(); `

both in the simulator or the true environment, it only goes to the first point and then return home, is there any problem of my code? I really can't figure it out!

Missing namespace fpr DJIDrone class

DJIDrone class in dji_sdk/dji_drone.h is not enclosed in namespace. This causes the class to go in global namespace. It should be in DJI::onboardSDK namespace like other things.

Also dji_drone.h should have include guards like all other header files.

I would strongly suggest to review your other files for similar basic issues. It would be great if above two can be fixed ASAP however because its the main class.

read camera data from DJI-GO and manifold

what do you mean by "The DJI Go has a power-saving strategy, users should either enter the camera view or do not run DJI GO at first in order to get the video stream. The video will be freezed if _uses _stay in the main screen of DJI GO."

if I use this package in manifold, will i get video from app?
if i do not use this package but share lib. -----libcam.so---- in manifold, can i get video both on app and manifold at the same time?
Thank you very much!

Horizontal frame clarification

Hi,
I would like to clarify what are
0b00: horizontal frame is ground frame
0b01: horizontal frame is body frame
for the attitude control mode.

Thanks

some advice about the name of cpp

Thank you for your excellent work and this ROS stack has provided us lots of convenience.
After reading the code, I think it would be better to rename the cpp file 'dji_sdk_node_mission.cpp' as 'dji_sdk_mission.cpp'. It will be more perfect.

Seg fault when run dji_sdk_node

when i rosrun dji_sdk_node process just died. But everything is ok in version 2.3.

NODES
  /
    dji_sdk (dji_sdk/dji_sdk_node)

auto-starting new master
process[master]: started with pid [18812]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to e49b2e2e-e5ab-11e5-a172-448a5b46c753
process[rosout-1]: started with pid [18825]
started core service [/rosout]
process[dji_sdk-2]: started with pid [18842]
[dji_sdk-2] process has died [pid 18842, exit code -11, cmd /home/buqing2009/dji_ws/devel/lib/dji_sdk/dji_sdk_node __name:=dji_sdk __log:=/home/buqing2009/.ros/log/e49b2e2e-e5ab-11e5-a172-448a5b46c753/dji_sdk-2.log].
log file: /home/buqing2009/.ros/log/e49b2e2e-e5ab-11e5-a172-448a5b46c753/dji_sdk-2*.log

[Problem] DJI SDK-ROS Mavlink :: You have connected QGroundControl to a firmware flight stack which is only partially supported.

I have been trying to use Qgroundcontrol as following links with DJI M600 with A3 controller
(I got the same result from DJI M100)

https://github.com/dji-sdk/Onboard-SDK-ROS/tree/3.1/dji_sdk_dji2mav

When I run the following commands, it seems to me that it succeed in establishing connection,

but Qgroundcontrol give me a following warning as following figure, and result in shutting down processing.

The output sound of Qgroundcontrol is "communication retained" and right after "communication lost"

From above, It seems to me that it is working temporarily, but failed.

I guess that the version of Onboard-SDK-ROS which I download a long time ago might be the cause of above error.

Would any one of you please help me out?

wkyoun@wkyoun:~$ roslaunch dji_sdk_dji2mav dji2mav_bringup.launch

... logging to /home/wkyoun/.ros/log/e7964014-7499-11e6-85c9-00c2c6cf6a1b/roslaunch-wkyoun-    7686.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.43.124:36496/

SUMMARY
========

PARAMETERS
 * /dji2mav_bringup/srcPort1: 14555
 * /dji2mav_bringup/srcPort2: 14549
 * /dji2mav_bringup/targetIp1: 192.168.43.138
 * /dji2mav_bringup/targetIp2: 192.168.43.138
 * /dji2mav_bringup/targetPort1: 14550
 * /dji2mav_bringup/targetPort2: 14551
 * /rosdistro: indigo
 * /rosversion: 1.11.20

NODES
  /
    dji2mav_bringup (dji_sdk_dji2mav/dji2mav_bringup)

ROS_MASTER_URI=http://192.168.43.124:11311

core service [/rosout] found
process[dji2mav_bringup-1]: started with pid [7704]
[dji2mav] [INFO] Going to establish connection for Manager with index 0. The size of sender list is     set to 16, the size of send buf and recv buf are set to 512 and 4096...
[dji2mav] [INFO] Going to establish connection with 192.168.43.138:14550 using port 14555...
[dji2mav] [INFO] Attempt to connect to 192.168.43.138:14550 using local port 14555...
[dji2mav] [INFO] ...connection succeed.
[dji2mav] [INFO] ...succeed in establishing connection.
[dji2mav] [INFO] ...succeed in establishing connection for Manager 0.
[dji2mav] [INFO] Going to establish connection for Manager with index 1. The size of sender list is     set to 16, the size of send buf and recv buf are set to 512 and 4096...
[dji2mav] [INFO] Going to establish connection with 192.168.43.138:14551 using port 14549...
[dji2mav] [INFO] Attempt to connect to 192.168.43.138:14551 using local port 14549...
[dji2mav] [INFO] ...connection succeed.
[dji2mav] [INFO] ...succeed in establishing connection.
[dji2mav] [INFO] ...succeed in establishing connection for Manager 1.
[dji2mav] [INFO] Succeed in registering module heartbeat.
[dji2mav] [INFO] Succeed in registering module sensors.
[dji2mav] [INFO] Succeed in registering module waypoint.
[dji2mav] [INFO] Succeed in registering module hotpoint.
[dji2mav_bringup-1] process has died [pid 7704, exit code -11, cmd /home/wkyoun/catkin_ws/devel    /lib/dji_sdk_dji2mav/dji2mav_bringup __name:=dji2mav_bringup __log:=/home/wkyoun    /.ros/log/e7964014-7499-11e6-85c9-00c2c6cf6a1b/dji2mav_bringup-1.log].
log file: /home/wkyoun/.ros/log/e7964014-7499-11e6-85c9-00c2c6cf6a1b/dji2mav_bringup-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

Warning: You have connected QGroundControl to a firmware flight stack which is only partially supported. If you are using the APM Flight Stack it is currently recommended to use Mission Planner, APM Planner or Tower as your ground control station.

screenshot from 2016-09-07 10 41 41

GCC strict compilation failure

The API_LOG function in dji_sdk_lib\DJI_Type.h is producing unsuppressible error when compiling under stricter mode. People who are using strict compilation as good practice therefore cannot use DJI SDK. Fortunately required change is small. I have modified API_LOG which passes strict compilation and is slightly better and safer than before. It would be great if below change can be applied so we can use strict compilation.

#define API_LOG(driver, title, ... )                                                                                           \
    if ((title))                                                                                                               \
    {                                                                                                                          \
        const int MAX_LEN = 1024;                                                                                              \
        int len = snprintf(DJI::onboardSDK::buffer, MAX_LEN, "%s %s,line %d: ",                                                \
            (title) ? (title) : "NONE", __func__, __LINE__);                                                                   \
        if (len != -1) {                                                                                                       \
            len = snprintf(DJI::onboardSDK::buffer + len, MAX_LEN - len, __VA_ARGS__ );                                        \
            if (len != -1)                                                                                                     \
                (driver)->displayLog();                                                                                        \
            else                                                                                                               \
                (driver)->displayLog("ERROR: could not log because error message printing failed\n");                          \
        }                                                                                                                      \
        else                                                                                                                   \
            (driver)->displayLog("ERROR: could not log because title, line, name printing failed\n");                          \
    }

To enable strict compilation, use following line in CMakeLists.txt (or replace existing one).

set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wstrict-aliasing -pedantic -fmax-errors=5 -Werror -Wunreachable-code ${CMAKE_CXX_FLAGS}")

This will produce LOT of errors which would be good to resolve and uncover lot of issues in the code. However given the volume of these it might take longer to cleans your source code. We can currently suppress all of these errors except for above (because GCC doesn't support its suppression yet). So right now only above change is important.

Why not put on detailed compiling steps to the wiki page?

Hi, there,

I am quite new to Onboard-sdk and ROS, I found the steps you described in Readme is quite confusing. When talking about how to run the demo, you simply described as:

Complete activation:

    Turn on your aircraft and its remote controller (make sure they are paired)
    Download the latest DJI GO application on your mobile device and sign in to your DJI developer account you created earlier
    Run "roslaunch dji_sdk sdk_manifold.launch" to initiate activation command
    Here is how your activation environment will look like: 

This would make newbies like me really confusing, you ignored to tell us how to compile it and use it.
I think you should as necessary compiling steps or reference.

make dirs
copy files
catkin_make

Gimbal publishing wrong yaw?

I've been having huge issues with my project.

Apparently there is a bug that causes the gimbal at 0,0,0 to publish 0, -156.6, 0 (pitch, yaw, and roll).

I've tested this out with a fresh download of Onboard-SDK-ROS

In the simulator, the gimbal reports correctly 0,0,0 starting position. But in real world, the gimbal report 0, -156.6, 0 at starting position. I've tried calibrating the gimbal in the DJI Go App, but nothing seems to fix the issue.

Update: After further testing, it looks like the gimbal is reporting ground yaw! (Well the yaw changes when I rotate that M100).

Alright, the internal API seems to be unaffected as API calls still work correctly. It seems like the fault is somewhere in the ROS wrapper. Specifically, bc_data.gimbal.yaw seems to be at fault. I currently don't have time to dig through the wrapper code. I was able to do a quick fix in dji_sdk_node_main.cpp via

gimbal.yaw = bc_data.gimbal.yaw - getYawDeg(attititude_quaternion)

where getYawDeg is some function that returns yaw (in degrees) from the attititude_quaternion.

Hopefully this helps other people out. I nearly wasted a whole week because of this issue. (Note, the yaw works correctly in the simulator through, so the "fix" will cause the simulated gimbals position to be fixed in ground frame).

Cant take off after arming

Is it normal that you cant take off after an arming command ?
drone->drone_arm();
drone->takeoff();

It is not really a problem because you can take off without arming but isn't it strange ?

Kind Regards

Compass reading is not published

We don't receive any data on the topic /dji_sdk/compass. However we do get GPS data on topic dji_sdk/global_position.

With the following system configuration:

M100 and Manifold
Ubuntu 14.04 / ROS Indigo
Onboard-SDK-ROS https://github.com/dji-sdk/Onboard-SDK-ROS/commit/43ac30cc5ab74b3aebdadf854a71e12fb61dc69f

Flight Controller Firmware version 1.3.1.00, updated using DJI Assistant Software v2.0

We registered the DJI App through DJI Developer Account and it successfully activates.
What seems strange is that we get this output when we check the version with
rosservice call /dji_sdk/version_check

STATUS getSDKVersionCallback,line 249: version ack = 0STATUS getSDKVersionCallback,line 250: version crc =│
 0xA6453AACSTATUS getSDKVersionCallback,line 252: version ID = 041DD22937STATUS getSDKVersionCallback,line│
 255: version name = SDK-v1.0 BETA M100-03.01.01.00 

It shows SDK version SDK-v1.0, isn't it supposed to show the firmware version 1.3.1.00?

Attitude_control() function of ROS Onboard SDK to control M100?

Am intending to develop a code to control Dji M100 in attitude: roll, pitch, thrust, and yaw. Using ROS Onboard sdk, attitude_control() would be the function to call. What is the syntax for this command,

attitude_control(FLAG, roll, pitch, thrust, yaw), right?

But it is not clear from the documentation on how to set FLAG (0b00100xxy perhaps?), and the units of the different involved variables. Are the angles in rad or degree? Is the throttle in Newton or percentage?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.