Please select Into the mobile phone version | Continue to access the computer ver.
You need to log in before you can reply       Login | Register now

[Help] ROS & Compiling C++ [RPi]

Author: mndimuro 2017-6-9 06:53
3 1005
Hey I have a few development questions.
This is what I'm using:
UAS: Matrice 600 Pro
OES: Raspberry Pi 3 Model B over TTY

I'm looking to write my own onboard client in C++. I wrote a test client just to make sure it connects but it doesn't even compile. I've wrote code in Python and its working fine.

I tried two different things:
1. Replace the code in dji_sdk_demo/src/client.cpp with my client.cpp. I went back to ~/ros_catkin_ws/ and rebuilt with catkin_make_isolated (which takes forever if anyone knows how to make a single package, please let me know - I tried --pkg Onboard-SDK-ROS). When I run rosrun dji_sdk_demo dji_sdk_client, I'm still getting the output from the original client.cpp

2. I tried to compile client.cpp with g++. I get compilation errors because its trying to find include code.

I was told Visual Studio would work but I'm not going to/wouldn't want to have that on the OES. I want to keep my dev/build enviroments isolated.

Does anyone know how/where I need to compile my files to get this working?

I don't have a specific answer for you, but perhaps try building the demo client and add your own code (start with some cout's) and see if those changes show up... good luck! ... s/Linux/README.html

- Chris
2017-6-10 06:02
c.jagielski Posted at 2017-6-10 06:02
I don't have a specific answer for you, but perhaps try building the demo client and add your own co ...

You linked the Linux docs. Technically, I am using Linux but I'm also using the ROS package.

ROS uses catkin_make to build its packages. Should I still go with the Linux compilation?
2017-6-10 12:19
Last edited by c.jagielski In 2017-6-13 02:03 Editor

I'm not knowledgeable about the ROS package... but I know in the Linux Non-blocking example it has steps on how to build (they use cmake to create the actual make file). So hopefully if you have an acceptable compiler than you can follow DJI's process online and build it.

Per the website ... ocs/ROS/README.html this is all I can say to help:

Software Requirements:
•Install C, C++ Compiler and Development Tools by installing build-essential
•Install CMake 2.8.3 or newer
•Install ROS and its dependencies

1.Assuming you have ROS environment installed and configured, cd into your catkin workspace and run catkin_make. Make sure the source code is in the src directory of your catkin workspace.

2.Refer to our .travis.yml build script to install and configure ROS from scratch and then follow with running catkin_make from catkin workspace.
3.You can pass -DUSE_COLLISION_AVOIDANCE=ON for compiling with LiDAR Collision Avoidance and -DUSE_POINTCLOUD2LAS=ON for building with LiDAR Mapping.
2017-6-13 02:02
You need to log in before you can reply Login | Register now

Quick Reply Back to top Back to list
Quick Reply Back to top Back to list