Friday, November 2, 2018

Hello DroneCode

The Dronecode SDK is a MAVLink Library for the PX4 flight stack, with APIs for C++ The library provides a simple API for managing one or more vehicles, providing programmatic access to vehicle information and telemetry, and control over missions, movement and other operations. SDK Main page

Install SDK

Note: First I Install from Release (deb) and try to compile the example takeoff_amd_land - The code look for action_result.h file that wasn't exists

Install SDK from source

git clone https://github.com/Dronecode/DronecodeSDK.git cd DronecodeSDK #master branch contain code like the deb git checkout develop git submodule update --init --recursive make default #Install sudo make default install sudo ldconfig # update linker cache

Takeoff example

Project struct

├── bin ├── build ├── CMakeLists.txt ├── docs ├── README.md └── src ├── CMakeLists.txt └── takeoff_and_land.cpp
  • root Cmake file
cmake_minimum_required(VERSION 2.8.12) project(xdrone) set(CMAKE_CXX_STANDARD 11) include_directories(/usr/local/include/dronecode_sdk) link_directories(/usr/local/lib) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin) add_subdirectory(src)
  • src cmake file
add_executable(takeoff_and_land takeoff_and_land.cpp) target_link_libraries(takeoff_and_land dronecode_sdk dronecode_sdk_telemetry dronecode_sdk_action )

Paste code from takeoff_and_land

  • Run SITL make posix_sitl_default gazebo_iris from px4 Firmware folder
  • Run the code

No comments: