Giter VIP home page Giter VIP logo

guidance-sdk-ros's Introduction

Gudiance-SDK-ROS

The official ROS package of Guidance SDK for 32/64 bit Ubuntu and XU3.

  • We write the CMakeLists.txt file so that it automatically detects your operating system and choose the appropriate library file.
  • We suppose the users are using USB for Guidance SDK on ROS. To use UART for Guidance SDK, plese reference uart_example.

How to use

  1. Setup USB devide rules so that no root privilege is required when using Guidance SDK via USB.

     sudo sh -c 'echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"fff0\", ATTR{idProduct}==\"d009\", MODE=\"0666\"" > /etc/udev/rules.d/51-guidance.rules'
    
  2. Clone the repo to the catkin workspace source directory catkin_ws/src and then

     cd ~/catkin_ws
     catkin_make
     rosrun guidance guidanceNode
     rosrun guidance guidanceNodeTest
    

Documentation

To reduce the size of this package, we omit all documents.

Using ROS tools for calibration and stereo processing

(experimental node by @madratman. Ideal would be using camera_info_manager on the lines on camera1394stereo)

  • Look inside /calibration_files. A sample file for one stereo pair is provided. ROS image pipeline needs a camera_info msg which consists of the calibration parameters. guidanceNodeCalibration is an experimental node that parses the calibration params from the YAMLs in the /calibration_files directory, publishes on the /guidance/right/camera_info and /guidance/left/camera_info topics.

  • First, you should calibrate using the camera_calibration package, and save the result to the left and right YAML in /calibration_files directory.

roslaunch guidance load_calib_file.launch  
(The launch file just sets a couple of parameters to retrieve the calibration files)

rosrun guidance guidanceNodeCalibration  

 rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 right:=/guidance/right/image_raw left:=/guidance/left/image_raw right_camera:=/guidance/right left_camera:=/guidance/left --no-service-check
  • Follow the calibration tutorials here and here
    If you are unable to save the calibration file using the GUI, you can do it manually from the terminal output. A reference for the same is provided in the sample /calibration_files/raw_from_terminal file.

  • Alternatively if you don't want to recalibrate, you can also manually enter the current calibration params in the YAML, which you would have from using the DJI Windows utility for Guidance. The same is printed out in the terminal from either node - the official guidanceNode or the experimental guidanceNodeCalibration.

  • Now that calibration is done, or you chose to use enter the pre-existing params in the YAMLs, we can use stereo_image_proc and play around to view and improve the disparity and point cloud in RViz.
    We can use the dynamic reconfigure GUI to change the stereo algo used and its params as explained in this tutorial.

ROS_NAMESPACE=guidance rosrun stereo_image_proc stereo_image_proc _approximate_sync:=True
rosrun image_view stereo_view stereo:=guidance image:=image_rect_color
rosrun rqt_reconfigure rqt_reconfigure
rosrun rviz rviz Change frame to "guidance". Add published point cloud pc2.

guidance-sdk-ros's People

Contributors

asiron avatar inwrit avatar jgoppert avatar madratman avatar oliverou avatar petrizhang avatar tangketan avatar tngan avatar wqf233333 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

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

guidance-sdk-ros's Issues

rosrun error

//cammand
rosrun GuidanceRos GuidanceNode
rosrun GuidanceRos GuidanceNodeTest
//
should be
rosrun guidance guidanceNode

Qt5 dependency issues with Kinetic

The first issue I was running into was that kinetic comes with opencv3 while the sdk requires opencv 2.4.*

What is the recommended ros version to use with this sdk?

I installed opencv 2.4.11 from source and I am not receiving the following error log:

...

[ 37%] Linking CXX executable /opt/ros/kinetic/share/catkin/dji-guidance-ws/devel/lib/guidance/guidanceNode
/usr/bin/ld: cannot find -lQt5::Core
/usr/bin/ld: cannot find -lQt5::Gui
/usr/bin/ld: cannot find -lQt5::Widgets
/usr/bin/ld: cannot find -lQt5::Test
/usr/bin/ld: cannot find -lQt5::Concurrent
/usr/bin/ld: cannot find -lQt5::OpenGL
collect2: error: ld returned 1 exit status
CMakeFiles/guidanceNode.dir/build.make:160: recipe for target '/opt/ros/kinetic/share/catkin/dji-guidance-ws/devel/lib/guidance/guidanceNode' failed
make[2]: *** [/opt/ros/kinetic/share/catkin/dji-guidance-ws/devel/lib/guidance/guidanceNode] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/guidanceNode.dir/all' failed
make[1]: *** [CMakeFiles/guidanceNode.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lQt5::Core
/usr/bin/ld: cannot find -lQt5::Gui
/usr/bin/ld: cannot find -lQt5::Widgets
/usr/bin/ld: cannot find -lQt5::Test
/usr/bin/ld: cannot find -lQt5::Concurrent
/usr/bin/ld: cannot find -lQt5::OpenGL
collect2: error: ld returned 1 exit status
CMakeFiles/guidanceNodeCalibration.dir/build.make:160: recipe for target '/opt/ros/kinetic/share/catkin/dji-guidance-ws/devel/lib/guidance/guidanceNodeCalibration' failed
make[2]: *** [/opt/ros/kinetic/share/catkin/dji-guidance-ws/devel/lib/guidance/guidanceNodeCalibration] Error 1
/usr/bin/ld: cannot find -lQt5::Core
/usr/bin/ld: cannot find -lQt5::Gui
/usr/bin/ld: cannot find -lQt5::Widgets
/usr/bin/ld: cannot find -lQt5::Test
/usr/bin/ld: cannot find -lQt5::Concurrent
/usr/bin/ld: cannot find -lQt5::OpenGL
collect2: error: ld returned 1 exit status
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/guidanceNodeCalibration.dir/all' failed
make[1]: *** [CMakeFiles/guidanceNodeCalibration.dir/all] Error 2
CMakeFiles/guidanceNodeTest.dir/build.make:134: recipe for target '/opt/ros/kinetic/share/catkin/dji-guidance-ws/devel/lib/guidance/guidanceNodeTest' failed
make[2]: *** [/opt/ros/kinetic/share/catkin/dji-guidance-ws/devel/lib/guidance/guidanceNodeTest] Error 1
CMakeFiles/Makefile2:461: recipe for target 'CMakeFiles/guidanceNodeTest.dir/all' failed
make[1]: *** [CMakeFiles/guidanceNodeTest.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

Segmentation Fault opencv_highgui3

Hi, I tried to run the guidanceNode but I always get a segmentation faul, while probably trying to load the images.

Thread 7 "guidanceNode" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffe27fc700 (LWP 10897)] 0x00007ffff691c4bd in cv::imshow(cv::String const&, cv::_InputArray const&) () from /opt/ros/lunar/lib/libopencv_highgui3.so.3.2

Is it a Problem with OpenCv2, maybe I installed it wrong.

Body frame velocity is incorrect

The velocity published on topic /guidance/velocity/ and the twist of /guidance/odometry/ appear to be the same. I visualized them in rqt and their graphs are always identical, no matter how I rotate my yaw angle.

However, according to the document the former one should be velocity in body frame, and the latter one is in global frame.

Am I able to acquire the velocity in body frame calculated from optical flow (or fused together with IMU) from Guidance SDK directly?

Thanks!

Build Guidance SDK pkg for ARM64 architecture (Jetson Nano)

Hello, I have installed ROS on Jetson Nano following the instructions given at https://github.com/jetsonhacks/installROS Running DJI on board SDK works fine although i cant build Guidance SDK on ARM64. Up to this point, i needed to install arm-linux-gnueabi-g++ compiler in order to recognize libDJI_guidance.so. I also needed to cross compile opencv3. Right now i'm facing the following error when building guidance pkg.

Base path: /home/jetsonvvr/catkin_ws
Source space: /home/jetsonvvr/catkin_ws/src
Build space: /home/jetsonvvr/catkin_ws/build
Devel space: /home/jetsonvvr/catkin_ws/devel
Install space: /home/jetsonvvr/catkin_ws/install
Whitelisted packages: guidance

Running command: "make cmake_check_build_system" in "/home/jetsonvvr/catkin_ws/build"

Running command: "make -j4 -l4" in "/home/jetsonvvr/catkin_ws/build"

[ 12%] Linking CXX executable /home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNode
[ 25%] Linking CXX executable /home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeTest
[ 37%] Linking CXX executable /home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeCalibration

/opt/ros/melodic/lib/libroscpp.so: file not recognized: File format not recognized
/opt/ros/melodic/lib/libroscpp.so: file not recognized: File format not recognized
/opt/ros/melodic/lib/libroscpp.so: file not recognized: File format not recognized

collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status

Guidance-SDK-ROS/CMakeFiles/guidanceNode.dir/build.make:149: recipe for target '/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNode' failed
make[2]: * [/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNode] Error 1
Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/build.make:149: recipe for target '/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeCalibration' failed
make[2]: * [/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeCalibration] Error 1
CMakeFiles/Makefile2:1269: recipe for target 'Guidance-SDK-ROS/CMakeFiles/guidanceNode.dir/all' failed
make[1]: * [Guidance-SDK-ROS/CMakeFiles/guidanceNode.dir/all] Error 2
make[1]: * Waiting for unfinished jobs....
CMakeFiles/Makefile2:459: recipe for target 'Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/all' failed
make[1]: * [Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/all] Error 2
Guidance-SDK-ROS/CMakeFiles/guidanceNodeTest.dir/build.make:123: recipe for target '/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeTest' failed
make[2]: * [/home/jetsonvvr/catkin_ws/devel/lib/guidance/guidanceNodeTest] Error 1
CMakeFiles/Makefile2:496: recipe for target 'Guidance-SDK-ROS/CMakeFiles/guidanceNodeTest.dir/all' failed
make[1]: * [Guidance-SDK-ROS/CMakeFiles/guidanceNodeTest.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: * [all] Error 2

### ### ### ### ### ### ### ###

My cmake list if the following:

cmake_minimum_required(VERSION 2.8.3)
project(guidance)

SET ( CMAKE_CROSSCOMPILING TRUE)
SET ( CMAKE_C_COMPILER "arm-linux-gnueabi-g++" )
SET ( CMAKE_CXX_COMPILER "arm-linux-gnueabi-g++" )

#SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabi-gcc)
#SET(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++)
SET(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabi)

SET (CMAKE_PREFIX_PATH "/home/jetsonvvr/Documents/Libraries/opencv3/opencv/build/install/share/OpenCV")
SET (OpenCV_INCLUDE_DIRS "/home/jetsonvvr/Documents/Libraries/opencv3/opencv/build/install/include")
SET (OpenCV_LIBS "/home/jetsonvvr/Documents/Libraries/opencv3/opencv/build/install/lib")

find_package(catkin REQUIRED COMPONENTS
roscpp
cv_bridge
std_msgs
sensor_msgs
geometry_msgs
)
find_package(OpenCV 3 REQUIRED core highgui)

catkin_package(
)

include_directories(
${OpenCV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
include
)

message("System is: " ${CMAKE_SYSTEM_PROCESSOR})
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
message("-- 32bit detected")
link_directories(lib/x86)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 😎
message("-- 64bit detected")
link_directories(lib/x64)
endif ()
else()
message("-- Non-linux platform detected but sorry we do not support 😀")
endif ()

if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l" )
message("-- " ${CMAKE_SYSTEM_PROCESSOR} " detected")
link_directories(lib/XU3)
else ()
endif ()

link_libraries(
${OpenCV_LIBS}
${catkin_LIBRARIES}
DJI_guidance
usb-1.0
yaml-cpp)

link_libraries(

    ${SOLUTIONTITLE}

    -lopencv_core

    -lopencv_highgui

    -lopencv_imgproc

    -lopencv_imgcodecs

    -lopencv_calib3d

    -lopencv_ximgproc

)

add_executable(guidanceNode
src/GuidanceNode.cpp
src/DJI_utility.cpp)

add_executable(guidanceNodeTest
src/GuidanceNodeTest.cpp)

add_executable(guidanceNodeCalibration
src/GuidanceNodeCalibration.cpp
src/DJI_utility.cpp)

### ###

Do I need to crosscompile ROS and the dependencies from source?
If that's the case can anyone provide me with some brief instructions.

Thank you.

Guidance Motion high drift

Hi,

The motion (position) output of the guidance system (after calibration & setting the position of the sensors) is heavily drifting. What should I do to reduce the drift ? Why does it drift that much ?

Frame conventions for global motion data and velocity data.

I am using the guidance as a odometry source for UAVs. I am looking for some info on the frame conventions used. Is the odometry data reported in a NED or ENU frame ? The x axis seems to be consistent. But movements along y axis seemed to be inverted. Could someone shed some light on this ?

Why guidance node does not publish motion topic?

I see that GuidanceNode published some useful information about the drone. But why the GuidanceNode does not publish the position topic in GuidanceNode? In the GuidanceNodeTest, a callback function is used to subscribe the position topic.
I also checked Onboard SDK ROS and found that /dji_sdk/local_position topic, /dji_sdk/velocity topic were published. What is the difference between data obtained from guidance sdk and onboard sdk?
Which data is more precise?
@lanyusea

Please issue arm64 lib

Hi Guys,
We would use 64 bit ARM CPU with Guidance!
Can you issue arm 64 bit version of library!!!!

Calibration

In section "Using ROS tools for calibration and stereo processing", following should be modified,

roslaunch guidance load_calib_file.launch
(The launch file just sets a couple of parameters to retrieve the calibration files)

rosrun guidance guidanceNodeCalibration

rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 right:=/guidance/right/image_raw left:=/guidance/left/image_raw right_camera:=/guidance/right left_camera:=/guidance/left --no-service-check

as

To launch guidance node with calibration:
roslaunch guidance load_calib_file.launch
(The launch file just sets a couple of parameters to retrieve the calibration files)

To use ROS calibration:
rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 right:=/guidance/right/image_raw left:=/guidance/left/image_raw right_camera:=/guidance/right left_camera:=/guidance/left --no-service-check

Current commands asks to run the launch file followed by guidanceNodeCalibration. We can't run guidanceNodeCalibration without parameters so it will give following error:

terminate called after throwing an instance of 'YAML::TypedBadConversion<int>'
  what():  yaml-cpp: error at line 0, column 0: bad conversion
Aborted (core dumped)

If you run both launch file AND guidanceCalibrationNode then you will get error like this:

llibusb_get_device_list ret = 15 !!! 
open failed   001!
hdev NULL!  usb.cpp 351
usb write error!: Interrupted system call
Error happened!
Error: e_timeout at 350,/home/shitals/vso/msresearch/Theseus/catkin_ws/src/Guidance-SDK-ROS/src/GuidanceNodeCalibration.cpp
release usb,usb.cpp 301

Another clarification required in documentation is how to move calibration parameters from terminal to YAML. Currently guidanceNodeCalibration prints:

Sensor online status: 1 1 1 1 1 
cu  cv  focal   baseline
166.582 123.588 282.914 0.150614
158.709 117.412 252.387 0.149986
161.201 116.399 243.976 0.150173
157.178 116.089 258.334 0.150176
160.889 117.302 258.253 0.151675

It looks to me this will only affect camera matrix in YAML which is Hartley and Zisserman (see http://ksimek.github.io/2013/08/13/intrinsic/),

No image from Guidance

I am using the following code, but I can not see the image. Please help me where I am doing wrong.
Information such as "obstacle_distance" and "ultrasonic" comes up but the image does not come.

#include <stdio.h>
#include <string.h>
#include <ros/ros.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/image_encodings.h>

#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

#include <geometry_msgs/TransformStamped.h> //IMU
#include <geometry_msgs/Vector3Stamped.h> //velocity
#include <sensor_msgs/LaserScan.h> //obstacle distance && ultrasonic

ros::Subscriber left_image_sub;
ros::Subscriber right_image_sub;
ros::Subscriber depth_image_sub;
ros::Subscriber imu_sub;
ros::Subscriber velocity_sub;
ros::Subscriber obstacle_distance_sub;
ros::Subscriber ultrasonic_sub;
ros::Subscriber position_sub;

// Matching
#include <opencv2/features2d.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/opencv.hpp>
#include
#include
#include
#include
#include

const double ransac_thresh = 2.5f; // RANSAC inlier threshold
const double nn_match_ratio = 0.8f; // Nearest-neighbour matching ratio
const int bb_min_inliers = 100; // Minimal number of inliers to draw bounding box
const int stats_update_period = 10; // On-screen statistics are updated every 10 frames

using namespace cv_bridge;
#define WIDTH 320
#define HEIGHT 240

using namespace std;
using namespace cv;

cv::Mat imgCameraLeft;
cv::Mat imgCameraRight;

double *landingXY = (double ) malloc(2sizeof(double)); // saved home point

/* left greyscale image */
void left_image_callback(const sensor_msgs::ImageConstPtr& left_img)
{
cv_bridge::CvImagePtr cv_ptr;
try {
cv_ptr = cv_bridge::toCvCopy(left_img, sensor_msgs::image_encodings::MONO8);
}
catch (cv_bridge::Exception& e) {
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
imgCameraLeft = cv_ptr->image;
cv::imshow("left_image", cv_ptr->image);
cv::waitKey(1);
}

/* right greyscale image */
void right_image_callback(const sensor_msgs::ImageConstPtr& right_img)
{
cv_bridge::CvImagePtr cv_ptr;
try {
cv_ptr = cv_bridge::toCvCopy(right_img, sensor_msgs::image_encodings::MONO8);
}
catch (cv_bridge::Exception& e) {
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
imgCameraRight = cv_ptr->image;
cv::imshow("right_image", cv_ptr->image);
cv::waitKey(1);
}

/* depth greyscale image */
void depth_image_callback(const sensor_msgs::ImageConstPtr& depth_img)
{
cv_bridge::CvImagePtr cv_ptr;
try {
cv_ptr = cv_bridge::toCvCopy(depth_img, sensor_msgs::image_encodings::MONO16);
}
catch (cv_bridge::Exception& e) {
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}

cv::Mat depth8(HEIGHT, WIDTH, CV_8UC1);
cv_ptr->image.convertTo(depth8, CV_8UC1);
//cv::imshow("depth_image", depth8);
cv::waitKey(1);

}

/* imu */
void imu_callback(const geometry_msgs::TransformStamped& g_imu)
{
//printf( "frame_id: %s stamp: %d\n", g_imu.header.frame_id.c_str(), g_imu.header.stamp.sec );
//printf( "imu: [%f %f %f %f %f %f %f]\n", g_imu.transform.translation.x, g_imu.transform.translation.y, g_imu.transform.translation.z, g_imu.transform.rotation.x, g_imu.transform.rotation.y, g_imu.transform.rotation.z, g_imu.transform.rotation.w );
}

/* velocity */
void velocity_callback(const geometry_msgs::Vector3Stamped& g_vo)
{
//printf( "frame_id: %s stamp: %d\n", g_vo.header.frame_id.c_str(), g_vo.header.stamp.sec );
//printf( "velocity: [%f %f %f]\n", g_vo.vector.x, g_vo.vector.y, g_vo.vector.z );
}

/* obstacle distance */
void obstacle_distance_callback(const sensor_msgs::LaserScan& g_oa)
{
printf( "frame_id: %s stamp: %d\n", g_oa.header.frame_id.c_str(), g_oa.header.stamp.sec );
printf( "obstacle distance: [%f %f %f %f %f]\n", g_oa.ranges[0], g_oa.ranges[1], g_oa.ranges[2], g_oa.ranges[3], g_oa.ranges[4] );
}

/* ultrasonic */
void ultrasonic_callback(const sensor_msgs::LaserScan& g_ul)
{
printf( "frame_id: %s stamp: %d\n", g_ul.header.frame_id.c_str(), g_ul.header.stamp.sec );
for (int i = 0; i < 5; i++)
printf( "ultrasonic distance: [%f] reliability: [%d]\n", g_ul.ranges[i], (int)g_ul.intensities[i] );
}

/* motion */
void position_callback(const geometry_msgs::Vector3Stamped& g_pos)
{
//printf("frame_id: %s stamp: %d\n", g_pos.header.frame_id.c_str(), g_pos.header.stamp.sec);
//for (int i = 0; i < 5; i++)
//printf("global position: [%f %f %f]\n", g_pos.vector.x, g_pos.vector.y, g_pos.vector.z);
}

int main(int argc, char** argv)
{
ros::init(argc, argv, "GuidanceNodeTest");
ros::NodeHandle my_node;

left_image_sub        = my_node.subscribe("/guidance/left_image",  10, left_image_callback);
right_image_sub       = my_node.subscribe("/guidance/right_image", 10, right_image_callback);
depth_image_sub       = my_node.subscribe("/guidance/depth_image", 10, depth_image_callback);
imu_sub               = my_node.subscribe("/guidance/imu", 1, imu_callback);
velocity_sub          = my_node.subscribe("/guidance/velocity", 1, velocity_callback);
obstacle_distance_sub = my_node.subscribe("/guidance/obstacle_distance", 1, obstacle_distance_callback);
ultrasonic_sub = my_node.subscribe("/guidance/ultrasonic", 1, ultrasonic_callback);
position_sub = my_node.subscribe("/guidance/position", 1, position_callback);

ros::spinOnce();                

return 0;

}

e_disparity_not_allowed at 291

Hey guys,

When I try rosrun guidance guidanceNode after connecting to the guidance bundle using USB , I get the following error

aswath@aswath-HP-ENVY-m7-Notebook:~$ rosrun guidance guidanceNode llibusb_get_device_list ret = 6 !!! Waiting for board ready... Sensor online status: 1 1 1 1 1 cu cv focal baseline 161.182 119.527 225.564 0.149806 160.24 127.999 240.597 0.149597 159.087 129.332 246.825 0.149493 162.332 121.654 229.558 0.149414 152.014 117.394 234.919 0.149491 Error: e_disparity_not_allowed at 291,/home/aswath/ros/src/Guidance-SDK-ROS/src/GuidanceNode.cpp
nothing is being published on any of the topics. I just want to read the messages being published on the topics.

I am not able to caliberate the cameras on my own too as there is nothing being published on the /guidance/right/image_raw or /guidance/right/image_raw topics

Kindly help me rectify this issue.

Regards,
Aswath

Guidance UART ROS

Hello,
I'm able to setup guidance to work with ROS over USB, but I'm not able or even sure whether it is compatibe with ROS over UART

IMU code bug

Found below bug in GuidanceNodeCalibration.cpp. I think 2nd line should have x.

        g_imu.transform.rotation.w = imu_data->q[0];
        g_imu.transform.rotation.z = imu_data->q[1];
        g_imu.transform.rotation.y = imu_data->q[2];
        g_imu.transform.rotation.z = imu_data->q[3];

guidanceNode publishes only one message per topic (except image) upon startup

We are having an issue, where guidanceNode doesn't continuously publish messages on all topic except image topics. Once we run the node, we get a single message on all topics and then we just receive images. I checked and the sdk callback is simply receiving frames with data_type == e_image.

We are running the latest firmware 1.4.0 with DIY mode switched on, enough bandwidth on the USB bus and the output frequencies in the DJI Guidance software (v1.3) set to:

IMU: 20Hz
Ultrasonic: 20Hz
Velocity: 10Hz
Obstacle: 20Hz 

Strange thing is that we disabled all the cameras in the DJI Guidance Software, but we are still getting images on the topics.

Segmentation fault (core dumped)

Hi

When i try step2
rosrun guidance guidanceNode

The following was segmentation fault was encounter !
vc4@VC4:~/catkin_ws$ rosrun guidance guidanceNode
Segmentation fault (core dumped)

opencv3 and falied to contact master

I compiled the guidance sdk ros with opencv3, and I tried to run the guidancenode, it didn't work well,keeping saying failed to contact master ,retrying

Build (catkin_make) fails on Manifold

I'm trying to build Guidance-SDK-ROS on my Manifold computer that shipped with M100 but seems like it fails.

System information:

ubuntu@tegra-ubuntu:~$ uname -a
Linux tegra-ubuntu 3.10.40 #2 SMP PREEMPT Fri Oct 27 11:42:57 UTC 2017 armv7l armv7l armv7l GNU/Linux
ubuntu@tegra-ubuntu:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"

Steps to reproduce:

# Plug guidance to Manifold using USB
ubuntu@tegra-ubuntu:~$ sudo sh -c 'echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"fff0\", ATTR{idProduct}==\"d009\", MODE=\"0666\"" > /etc/udev/rules.d/51-guidance.rules'
(reboot manifold)
ubuntu@tegra-ubuntu:~$ mkdir -p catkin_ws_guidance/src && cd catkin_ws_guidance/src
ubuntu@tegra-ubuntu:~/catkin_ws_guidance/src$ git clone https://github.com/dji-sdk/Guidance-SDK-ROS.git
Cloning into 'Guidance-SDK-ROS'...
remote: Counting objects: 214, done.
remote: Total 214 (delta 0), reused 0 (delta 0), pack-reused 214
Receiving objects: 100% (214/214), 352.13 KiB | 335.00 KiB/s, done.
Resolving deltas: 100% (104/104), done.
Checking connectivity... done.
ubuntu@tegra-ubuntu:~/catkin_ws_guidance/src$ cd ..
ubuntu@tegra-ubuntu:~/catkin_ws_guidance$ catkin_make
Base path: /home/ubuntu/catkin_ws_guidance
Source space: /home/ubuntu/catkin_ws_guidance/src
Build space: /home/ubuntu/catkin_ws_guidance/build
Devel space: /home/ubuntu/catkin_ws_guidance/devel
Install space: /home/ubuntu/catkin_ws_guidance/install
Creating symlink "/home/ubuntu/catkin_ws_guidance/src/CMakeLists.txt" pointing to "/opt/ros/indigo/share/catkin/cmake/toplevel.cmake"
####
#### Running command: "cmake /home/ubuntu/catkin_ws_guidance/src -DCATKIN_DEVEL_PREFIX=/home/ubuntu/catkin_ws_guidance/devel -DCMAKE_INSTALL_PREFIX=/home/ubuntu/catkin_ws_guidance/install -G Unix Makefiles" in "/home/ubuntu/catkin_ws_guidance/build"
####
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /home/ubuntu/catkin_ws_guidance/devel
-- Using CMAKE_PREFIX_PATH: /home/ubuntu/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/ubuntu/catkin_ws/devel;/opt/ros/indigo
-- Found PythonInterp: /usr/bin/python (found version "2.7.6") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/ubuntu/catkin_ws_guidance/build/test_results
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.19
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - guidance
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'guidance'
-- ==> add_subdirectory(Guidance-SDK-ROS)
System is: armv7l
-- 32bit detected
-- armv7l detected
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/catkin_ws_guidance/build
####
#### Running command: "make -j4 -l4" in "/home/ubuntu/catkin_ws_guidance/build"
####
Scanning dependencies of target guidanceNode
Scanning dependencies of target guidanceNodeCalibration
Scanning dependencies of target guidanceNodeTest
[ 20%] [ 40%] [ 60%] [ 80%] Building CXX object Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/src/GuidanceNodeCalibration.cpp.o
Building CXX object Guidance-SDK-ROS/CMakeFiles/guidanceNodeTest.dir/src/GuidanceNodeTest.cpp.o
Building CXX object Guidance-SDK-ROS/CMakeFiles/guidanceNode.dir/src/GuidanceNode.cpp.o
Building CXX object Guidance-SDK-ROS/CMakeFiles/guidanceNode.dir/src/DJI_utility.cpp.o
[100%] Building CXX object Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/src/DJI_utility.cpp.o
/home/ubuntu/catkin_ws_guidance/src/Guidance-SDK-ROS/src/GuidanceNodeCalibration.cpp:24:65: fatal error: yaml-cpp/yaml.h: No such file or directory
 #include "yaml-cpp/yaml.h" // use to parse YAML calibration file
                                                                 ^
compilation terminated.
Linking CXX executable /home/ubuntu/catkin_ws_guidance/devel/lib/guidance/guidanceNode
/usr/bin/ld: skipping incompatible /home/ubuntu/catkin_ws_guidance/src/Guidance-SDK-ROS/lib/x86/libDJI_guidance.so when searching for -lDJI_guidance
/usr/bin/ld: cannot find -lyaml-cpp
collect2: error: ld returned 1 exit status
make[2]: *** [/home/ubuntu/catkin_ws_guidance/devel/lib/guidance/guidanceNode] Error 1
make[1]: *** [Guidance-SDK-ROS/CMakeFiles/guidanceNode.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX executable /home/ubuntu/catkin_ws_guidance/devel/lib/guidance/guidanceNodeTest
/usr/bin/ld: skipping incompatible /home/ubuntu/catkin_ws_guidance/src/Guidance-SDK-ROS/lib/x86/libDJI_guidance.so when searching for -lDJI_guidance
/usr/bin/ld: cannot find -lyaml-cpp
collect2: error: ld returned 1 exit status
make[2]: *** [/home/ubuntu/catkin_ws_guidance/devel/lib/guidance/guidanceNodeTest] Error 1
make[1]: *** [Guidance-SDK-ROS/CMakeFiles/guidanceNodeTest.dir/all] Error 2
make[2]: *** [Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/src/GuidanceNodeCalibration.cpp.o] Error 1
make[1]: *** [Guidance-SDK-ROS/CMakeFiles/guidanceNodeCalibration.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

after updating the guidance firmware to v1.4.0,data are published abnormally

Hi,
To use Guidance-SDK-ROS v1.4.0,I used the guidance assistance on windows to update the guidance firmware version to v1.4.0 ,calibrate the camera and upload parameters. However, I encoutered the following questions:
image
after rosrun guidance guidanceNode,there are only the output of the ultrasonic and IMU data, and IMU data is 0, no other data such as obstacle distance, etc. I'm sure I have selected data in guidanceNode.cpp: select_obstacle_distance(); select_velocity();
Besides, the left and right image can be published except depth image .
So, I tried changing the firmware vision back to v1.3.7, and use the corresponding Guidance -SDK v1.3.7, which could publish all data and image normally before. However it didn't work,and the same output as above,no depth image,no velocity data, no obstacle distance, the imu data are all 0.
Kindly help me solve the problem.

guidance node and stereo_image_proc package problem

My goal is to produce the pointclouds data by using guidance node and stereo_image_proc package(http://wiki.ros.org/stereo_image_proc).

I have successfully done with two usb webcam to produce the pointclouds data in the same ways.

I successfully calibrate dji guidance and run the following commands:

roslaunch guidance load_calib_file.launch  

rosrun guidance guidanceNodeCalibration  

It shows severals images including raw right and left image, and depth images with following messages:

frame index: 15507, stamp: 775667
ultrasonic distance: 0.096000, reliability: 1
ultrasonic distance: 1.691000, reliability: 1
ultrasonic distance: 0.470000, reliability: 1
ultrasonic distance: -0.001000, reliability: 0
ultrasonic distance: 1.502000, reliability: 1
frame index: 15508, stamp: 775716
obstacle distance: 20.000000  0.360000  0.400000  0.400000  1.500000 
frame index: 15508, stamp: 775716
vx:0.000000 vy:0.000000 vz:0.000000

The resulting topics are shown as followings:

wkyoun@wkyoun-15Z960-GA70K:~$ rostopic list -v

Published topics:
 * /guidance/imu [geometry_msgs/TransformStamped] 1 publisher
 * /guidance/left/camera_info [sensor_msgs/CameraInfo] 1 publisher
 * /guidance/left/image_raw [sensor_msgs/Image] 1 publisher
 * /guidance/depth_image [sensor_msgs/Image] 1 publisher
 * /guidance/obstacle_distance [sensor_msgs/LaserScan] 1 publisher
 * /guidance/velocity [geometry_msgs/Vector3Stamped] 1 publisher
 * /guidance/ultrasonic [sensor_msgs/LaserScan] 1 publisher
 * /guidance/right/image_raw [sensor_msgs/Image] 1 publisher
 * /rosout [rosgraph_msgs/Log] 2 publishers
 * /rosout_agg [rosgraph_msgs/Log] 1 publisher
 * /guidance/right/camera_info [sensor_msgs/CameraInfo] 1 publisher

Subscribed topics:
 * /rosout [rosgraph_msgs/Log] 1 subscriber
 * /statistics [rosgraph_msgs/TopicStatistics] 1 subscriber

Afterwards, In order to produce the pointclouds data, I run the stereo_image_proc packages which is supposed to subscribe the topics that is published by guidance node.

I run the following commands:

wkyoun@wkyoun-15Z960-GA70K:~$ ROS_NAMESPACE=guidance rosrun stereo_image_proc stereo_image_proc _approximate_sync:=True

The resulting topics are as follows:

wkyoun@wkyoun-15Z960-GA70K:~$ rostopic list -v

Published topics:
 * /guidance/disparity [stereo_msgs/DisparityImage] 1 publisher
 * /guidance/imu [geometry_msgs/TransformStamped] 1 publisher
 * /guidance/right/image_rect_color/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_color/compressed [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/right/image_rect [sensor_msgs/Image] 1 publisher
 * /guidance/left/camera_info [sensor_msgs/CameraInfo] 1 publisher
 * /guidance/left/image_mono/theora/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/stereo_image_proc_debayer_left/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_raw [sensor_msgs/Image] 1 publisher
 * /guidance/right/image_color [sensor_msgs/Image] 1 publisher
 * /guidance/right/image_mono [sensor_msgs/Image] 1 publisher
 * /guidance/left/image_rect/theora [theora_image_transport/Packet] 1 publisher
 * /guidance/right/image_rect_color/compressedDepth/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_mono/compressed [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/right/image_rect_color/compressed/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_mono/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_rect/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/image_rect/theora [theora_image_transport/Packet] 1 publisher
 * /guidance/right/image_rect_color/compressedDepth/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_rect_color [sensor_msgs/Image] 1 publisher
 * /guidance/left/image_rect/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/image_mono/compressedDepth [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/right/image_color/compressedDepth/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_rect_color/compressedDepth [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/left/image_color/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_mono [sensor_msgs/Image] 1 publisher
 * /guidance/stereo_image_proc_rectify_mono_right/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/stereo_image_proc_rectify_color_right/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/depth_image [sensor_msgs/Image] 1 publisher
 * /guidance/stereo_image_proc_debayer_right/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_color/compressed [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/right/image_rect/compressedDepth/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_rect_color/compressedDepth/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/points2 [sensor_msgs/PointCloud2] 1 publisher
 * /guidance/obstacle_distance [sensor_msgs/LaserScan] 1 publisher
 * /guidance/stereo_image_proc_rectify_color_left/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/stereo_image_proc/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_color/theora [theora_image_transport/Packet] 1 publisher
 * /guidance/left/image_mono/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_color/theora/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_rect_color/compressedDepth [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/left/image_color/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/stereo_image_proc_rectify_mono_left/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_color/compressedDepth/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/image_color/theora/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_color/theora [theora_image_transport/Packet] 1 publisher
 * /guidance/right/image_mono/compressed [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/left/image_rect/compressedDepth/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_rect/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/velocity [geometry_msgs/Vector3Stamped] 1 publisher
 * /guidance/right/image_rect_color/theora/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/ultrasonic [sensor_msgs/LaserScan] 1 publisher
 * /guidance/right/image_rect_color [sensor_msgs/Image] 1 publisher
 * /guidance/stereo_image_proc_rectify_color_left/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_color [sensor_msgs/Image] 1 publisher
 * /guidance/left/image_rect_color/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_rect_color/compressed [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/right/image_rect/compressedDepth/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_color/compressedDepth [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/right/image_rect/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/image_mono/compressedDepth/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/stereo_image_proc_debayer_right/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/image_raw [sensor_msgs/Image] 1 publisher
 * /guidance/left/image_rect_color/compressedDepth/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_mono/compressedDepth/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /rosout [rosgraph_msgs/Log] 3 publishers
 * /guidance/right/image_mono/theora/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_rect_color/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_mono/theora [theora_image_transport/Packet] 1 publisher
 * /guidance/right/image_rect_color/theora [theora_image_transport/Packet] 1 publisher
 * /guidance/left/image_rect_color/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_color/compressed/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/stereo_image_proc_rectify_mono_left/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_rect/compressed [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/left/image_mono/compressed/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/stereo_image_proc/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/stereo_image_proc_rectify_mono_right/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/image_color/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/image_rect_color/compressed [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/right/image_rect/theora/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /rosout_agg [rosgraph_msgs/Log] 1 publisher
 * /guidance/right/image_rect/compressedDepth [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/right/image_mono/compressed/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_mono/compressedDepth/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/image_mono/theora [theora_image_transport/Packet] 1 publisher
 * /guidance/left/image_mono/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_rect/compressed/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_mono/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_rect/compressedDepth/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_color/compressedDepth/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_rect_color/compressed/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_color/compressedDepth/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/image_color/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/right/camera_info [sensor_msgs/CameraInfo] 1 publisher
 * /guidance/right/image_rect/compressed [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/left/image_mono/compressedDepth/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /guidance/left/image_mono/compressedDepth [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/left/image_rect/theora/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/right/image_color/compressed/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_rect [sensor_msgs/Image] 1 publisher
 * /guidance/left/image_color/compressedDepth [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/left/image_rect_color/theora/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_rect_color/theora [theora_image_transport/Packet] 1 publisher
 * /guidance/right/image_rect/compressed/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/left/image_rect/compressedDepth [sensor_msgs/CompressedImage] 1 publisher
 * /guidance/stereo_image_proc_rectify_color_right/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /guidance/stereo_image_proc_debayer_left/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher

Subscribed topics:
 * /rosout [rosgraph_msgs/Log] 1 subscriber
 * /statistics [rosgraph_msgs/TopicStatistics] 1 subscriber

The problem is that according to http://wiki.ros.org/stereo_image_proc
(As you can see the above, stereo_image_proc package subscribe only /rosout and /statistics)

stereo_image_proc package should subscribe the topics that are published by guidance nodes as followings:

Published topics:

 * /guidance/left/camera_info [sensor_msgs/CameraInfo] 1 publisher
 * /guidance/left/image_raw [sensor_msgs/Image] 1 publisher
 * /guidance/right/image_raw [sensor_msgs/Image] 1 publisher
 * /guidance/right/camera_info [sensor_msgs/CameraInfo] 1 publisher

When I look the node graph by rqt_graph, stereo_image_proc package does not subscribe the topics.

Would any of you explain why this happens?

Thank you in advances

rosrun guidance guidanceNode Error

I've been getting this error for a couple of days now. Unable to debug.

Running via guidance sdk work fine, but I get this via the ros wrapper:

wkyoun@wkyoun-15Z960-GA70K:~$ rosrun guidance guidanceNode
hdev NULL!  usb.cpp 351
open failed   001!
usb write error!: Interrupted system call
llibusb_get_device_list ret = 7 !!! 
open failed   001!
llibusb_get_device_list ret = 7 !!! 
open failed   001!
llibusb_get_device_list ret = 7 !!! 
open failed   001!
Error: e_timeout at 237,/home/wkyoun/catkin_ws/src/Guidance-SDK-ROS/src/GuidanceNode.cpp

release usb,usb.cpp 301

but when executing following:

wkyoun@wkyoun-15Z960-GA70K:~$ rosrun guidance guidanceNodeTest

It does not produce any errors;

I have not done any calibration yet,

I am trying to run basic ros node for dji guidance.
(is the cause of above problem due to calibration problem?)

guidance uses with localization for m100 and sdk simultaneously

预备条件

系统 版本
Jetson tk1 L4T r24.1 (jetpack2.2)
Guidance 固件1.4.0
DJI M100 1.2.0.90
ros indigo
我使用的代码和一些图片,见这里,Guidance SDK做了一些显示和配置上的修改,核心代码没有改变。

已测试的情况

  1. Guidance和飞机单独配合工作正常。表现为飞机屏蔽GPS,使用Guidance,悬停很稳。
  2. Guidance和SDK(运行于TK1,上述表格中的配置),工作正常。
  3. Guidance和飞机链接(can),同时链接至电脑,使用调参软件,可以读出图像。

运行步骤

  1. 编译catkin_make,注意我在TK1上使用的是另外一个branch(tegra-ubuntu)的代码。
  2. 使用对应的launch文件,启动节点。

问题

单独启动节点 guidanceNode 错误为
Error: e_disparity_not_allowed at 297,/home/ubuntu/catkin_ws/src/Guidance-SDK-ROS/src/GuidanceNode.cpp

Obstacle Avoidance?

Just new to guidance ROS. Does the ROS package contains the build-in function of obstacle avoidance ?
I want to have it work on my own DIY drone.

Any comment is appreciate.

Thanks,

e_disparity_not_allowed

I've been getting this error for a couple of days now. Unable to debug.
Running via guidance sdk work fine, but I get this via the ros wrapper:

$ rosrun guidance guidanceNode
llibusb_get_device_list ret = 10 !!! 
Waiting for board ready...
Sensor online status: 1 1 1 1 1 
cu  cv  focal   baseline
155.784 114.505 195.721 0.148784
177.886 101.42  303.124 0.150098
172.085 87.0126 336.415 0.148536
167.922 101.562 306.625 0.148215
164.785 89.875  319.882 0.148857
Error: e_disparity_not_allowed at 272,/home/ratneshmadaan/projects/dji_ros_ws_orig/src/Guidance-SDK-ROS/src/GuidanceNode.cpp

The calib params are also quite different from what I got earlier https://github.com/dji-sdk/Guidance-SDK-ROS/blob/master/calibration_files/camera_params_left.yaml
The difference is this time I calibrated it with the drone, and earlier I was calibrating without the drone.

Edit: Yeah, I just recalibrated without the drone using the DIY mode and it works. Calibrating with the drone is leading to the above error.

Could SDK add the support for latest TX1?

Hi guys,

Now I am using NVIDIA TX1 with JetPack L4T 2.3, which install Ubuntu 16.04, Arm 64bits and ROS Kinetic.
But the libDJI_guidance.so could not support current system.
Could you add this support? Because I think TX1 is becoming a popular and powerful platform for M100.

Thx!

How to get the calibration params from the DJI Windows utility for Guidance?

Hi,

I'm new to ROS but I got everything working. I now need to go back and calibrate things...

In the readme.md file it reads:
(...)
"- Alternatively if you don't want to recalibrate, you can also manually enter the current calibration params in the YAML, which you would have from using the DJI Windows utility for Guidance. The same is printed out in the terminal from either node - the official guidanceNode or the experimental guidanceNodeCalibration. "
(...)

I looked everywhere but I can't find the required YAML parameters in the windows utility. Could you please advice how/where to get them from the windows utility?

Thanks,
Eric

Modifying API to better use existing ROS tools

Thanks for adding the camera calibration parameter access in 1.3.7.
Now that we have access to these params, one could use http://wiki.ros.org/stereo_image_proc effectively to get point clouds, etc quickly.

What could be useful would be to have camera info topics published and existing topics renamed to

  • /guidance/right/image_raw, instead of /guidance/right_image
  • /guidance/right/camera_info, got from the new stereo_cali struct.
  • etc, for reusing them with existing tools without having to make changes

Another much appreciated feature would be calibration via ROS. It would be nice if one could use http://wiki.ros.org/camera_calibration directly. Or if from the windows tool, we could get all these params - http://docs.ros.org/api/sensor_msgs/html/msg/CameraInfo.html and http://wiki.ros.org/image_pipeline/CameraInfo (this can be done with only camera_info)

Also it would be great if the commits could be broken down into addition of features, and the messages could be feature driven as well, instead of something like "updated to 1.3.7".

Finally, some questions:

I have these params(got from the Windows utility, I guess I messed up a little for the second and third sensor a bit)

    cu      cv  focal   baseline
161.027 126.507 230.969 0.150264
149.911 115.413 252.47  0.149167
152.967 121.818 236.998 0.150177
163.841 126.252 233.432 0.149859
165.338 123.442 231.71  0.149611

But my depth image is relatively more screwed up. (got from the usb example, running in Ubuntu)

Where am I going wrong?
dji_guidance_issue

Update: I am publishing the camera info manually and getting segfaults. :\
See comments in issue #1

I renamed topics to /guidance/right/image_raw, etc.
If I try to calibrate via ROS (http://wiki.ros.org/camera_calibration/Tutorials/StereoCalibration) using rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 right:=/guidance/right/image_raw left:=/guidance/left/image_raw right_camera:=/guidance/right left_camera:=/guidance/left --no-service-check, nothing happens.
(--no-service-check as I just want to save the calibration results, or else one uses cam_info_manager)

But if I run a monocular calib using either right or left, it runs well.

Problem in catkin_make the package

/usr/bin/ld: warning: libpcre.so.1, needed by //home/li/anaconda2/lib/libgobject-2.0.so.0, not found (try using -rpath or -rpath-link) CMakeFiles/guidanceNodeCalibration.dir/src/GuidanceNodeCalibration.cpp.o: In function my_callback(int, int, char*)':
GuidanceNodeCalibration.cpp:(.text+0x9a7): undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' GuidanceNodeCalibration.cpp:(.text+0xb9e): undefined reference to cv::imshow(cv::String const&, cv::InputArray const&)'
GuidanceNodeCalibration.cpp:(.text+0xddf): undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadRGBAStrip@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadDirectory@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFWriteEncodedStrip@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFIsTiled@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFWriteScanline@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFGetField@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFNumberOfStrips@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFScanlineSize@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadRGBATile@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFClose@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFClientOpen@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFRGBAImageOK@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFOpen@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFSetField@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFSetWarningHandler@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFSetErrorHandler@LIBTIFF_4.0' collect2: error: ld returned 1 exit status Guidance-SDK-ROS-master/CMakeFiles/guidanceNodeCalibration.dir/build.make:146: recipe for target '/home/li/catkin_ws/devel/lib/guidance/guidanceNodeCalibration' failed make[2]: *** [/home/li/catkin_ws/devel/lib/guidance/guidanceNodeCalibration] Error 1 CMakeFiles/Makefile2:357: recipe for target 'Guidance-SDK-ROS-master/CMakeFiles/guidanceNodeCalibration.dir/all' failed make[1]: *** [Guidance-SDK-ROS-master/CMakeFiles/guidanceNodeCalibration.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: warning: libpcre.so.1, needed by //home/li/anaconda2/lib/libgobject-2.0.so.0, not found (try using -rpath or -rpath-link) CMakeFiles/guidanceNode.dir/src/GuidanceNode.cpp.o: In function my_callback(int, int, char*)':
GuidanceNode.cpp:(.text+0x1ce): undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' GuidanceNode.cpp:(.text+0x382): undefined reference to cv::imshow(cv::String const&, cv::InputArray const&)'
GuidanceNode.cpp:(.text+0x580): undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadRGBAStrip@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadDirectory@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFWriteEncodedStrip@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFIsTiled@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFWriteScanline@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFGetField@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFNumberOfStrips@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFScanlineSize@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadRGBATile@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFClose@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFClientOpen@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFRGBAImageOK@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFOpen@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFSetField@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFSetWarningHandler@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFSetErrorHandler@LIBTIFF_4.0' collect2: error: ld returned 1 exit status Guidance-SDK-ROS-master/CMakeFiles/guidanceNode.dir/build.make:146: recipe for target '/home/li/catkin_ws/devel/lib/guidance/guidanceNode' failed make[2]: *** [/home/li/catkin_ws/devel/lib/guidance/guidanceNode] Error 1 CMakeFiles/Makefile2:394: recipe for target 'Guidance-SDK-ROS-master/CMakeFiles/guidanceNode.dir/all' failed make[1]: *** [Guidance-SDK-ROS-master/CMakeFiles/guidanceNode.dir/all] Error 2 /usr/bin/ld: warning: libpcre.so.1, needed by //home/li/anaconda2/lib/libgobject-2.0.so.0, not found (try using -rpath or -rpath-link) CMakeFiles/guidanceNodeTest.dir/src/GuidanceNodeTest.cpp.o: In function left_image_callback(boost::shared_ptr<sensor_msgs::Image
<std::allocator > const> const&)':
GuidanceNodeTest.cpp:(.text+0xa9): undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' CMakeFiles/guidanceNodeTest.dir/src/GuidanceNodeTest.cpp.o: In function right_image_callback(boost::shared_ptr<sensor_msgs::Image
<std::allocator > const> const&)':
GuidanceNodeTest.cpp:(.text+0x37a): undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' CMakeFiles/guidanceNodeTest.dir/src/GuidanceNodeTest.cpp.o: In function depth_image_callback(boost::shared_ptr<sensor_msgs::Image_<std::allocator > const> const&)':
GuidanceNodeTest.cpp:(.text+0x6d0): undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadRGBAStrip@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadDirectory@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFWriteEncodedStrip@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFIsTiled@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFWriteScanline@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFGetField@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFNumberOfStrips@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFScanlineSize@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadRGBATile@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFClose@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFClientOpen@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFRGBAImageOK@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFOpen@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFSetField@LIBTIFF_4.0' /opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFSetWarningHandler@LIBTIFF_4.0'
/opt/ros/lunar/lib/libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFSetErrorHandler@LIBTIFF_4.0' collect2: error: ld returned 1 exit status Guidance-SDK-ROS-master/CMakeFiles/guidanceNodeTest.dir/build.make:120: recipe for target '/home/li/catkin_ws/devel/lib/guidance/guidanceNodeTest' failed make[2]: *** [/home/li/catkin_ws/devel/lib/guidance/guidanceNodeTest] Error 1 CMakeFiles/Makefile2:655: recipe for target 'Guidance-SDK-ROS-master/CMakeFiles/guidanceNodeTest.dir/all' failed make[1]: *** [Guidance-SDK-ROS-master/CMakeFiles/guidanceNodeTest.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed
Then when I try to rosrun guidance guidanceNode,
[rosrun] Couldn't find executable named GuidanceNode below /home/li/catkin_ws/src/Guidance-SDK-ROS-master
What would go wrong? Please help me. I will offer more information if needed.

Image from guidance abnormal

When I took my first try to run the Guidance ROS Node on my Manifold,the image I saw was like this:
image
ROS indigo Ubuntu 14.04
Can anyone tell me what's wrong with it?
Thanks guys!

Publishing topics for all 5 cameras

Hello, I have been trying to modify GuidanceNode.cpp in order to have a different topic for every camera.
I noticed there's a pull request with a modified node FullCameras.cpp, which I tested, but I am getting the following error:

FullCameras.cpp:75:25: error: no match for ‘operator=’ (operand types are ‘cv::Mat’ and ‘char*’)
         images[j].image = data->m_greyscale_image_left[i];

Has anyone figured out how to split the node to publish 5 separate topics? Thanks.

Safely kill the node

How can I exit and rerun the node safely ? When I terminate the guidanceNode (ctrl-c) after running rosrun guidance guidanceNode successfully for a while, the error message shows up when I rerun the guidanceNode.

llibusb_get_device_list ret = 9 !!!
Waiting for board ready ...
Error: e_timeout at 247, /.........../guidanceNode.cpp

and the line 247 is the code for guidance initialization.

follow naming conventions

ros gets angry whatever launch i run. he says,
"WARNING: Package name "GuidanceRos" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits and underscores."

methods of transfer the image to PC

hi, I want to use my PC to process the image transferred from the M100, but I do not know the method can I take ? a wifi module is ok?
Thanks

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.