-
Notifications
You must be signed in to change notification settings - Fork 988
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'mavros/master'
* mavros/master: (275 commits) move mavros to subdirectory, #101 save changes before moving, #101 plugins: setpoint: Update setpoint message name. plugin: setpoint_attitude: Update message name. Add link to ros-*-mavlink package wiki page. plugin: gps: Fix gcc 4.6 build (atomic). plugin: sys_status: Implement PX4 mode decoding. plugin: gps: Add EPH & EPV to diagnostic. plugin: gps: Move message processing to individual handlers. plugin: rc_io: Replace override service with topic. (ROS API change). Add dialect selection notes plugins: Change severity for param & wp done messages. plugins: Store raw autopilot & mav type values. plugins: init ctor (coverity) plugin: imu_pub: Add ATTITUDE_QUATERNION support. scriptis: mavcmd: Spelling scripits: Add mavcmd tool Add links to mavros_extras param: sys_status: Option to disable diagnostics (except heartbeat) plugin: command: Add takeoff and land aliases. ...
- Loading branch information
Showing
78 changed files
with
10,891 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# thanks to jsk-ros-pkg | ||
language: cpp | ||
compiler: | ||
- gcc | ||
# - clang | ||
env: | ||
global: | ||
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created | ||
# via the "travis encrypt" command using the project repo's public key | ||
- secure: "ORA0MsiEB+R3pk8qKFRllVDK7eEQGo0LoRy6VtdyU0SOw00lEWCSD8FFJM922H5e18ZME9fIfc0ttKvbEhRwPx/AUCME+0lLkcHmogc7UyB8Gu6yqXfcp0XLVKPeLK/9+9geFmb5v9P0CH3cX4PYzimzt1ay0BVfomXX4+NkipE=" | ||
- ROS_DISTRO=hydro | ||
before_install: | ||
- export CI_SOURCE_PATH=$(pwd) | ||
- export REPOSITORY_NAME=${PWD##*/} | ||
- echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME" | ||
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list' | ||
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add - | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -qq -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin ros-$ROS_DISTRO-ros python-rosinstall | ||
# MongoDB hack - I don't fully understand this but its for moveit_warehouse | ||
- sudo apt-get remove -y mongodb mongodb-10gen | ||
- sudo apt-get install -y mongodb-clients mongodb-server -o Dpkg::Options::="--force-confdef" # default actions | ||
##### quick hack for missing python-tk on hrpsys/waitInput.py | ||
- sudo apt-get install -qq -y python-tk | ||
# Setup rosdep | ||
- sudo rosdep init | ||
- rosdep update | ||
install: | ||
# Create workspace | ||
- mkdir -p ~/ros/ws_$REPOSITORY_NAME/src | ||
- cd ~/ros/ws_$REPOSITORY_NAME/src | ||
- wstool init . | ||
- wstool set $REPOSITORY_NAME --git https://github.com/vooon/mavros.git -y | ||
- wstool update -j10 | ||
#- ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace | ||
- cd ../ | ||
# Install dependencies for source repos | ||
- find -L src -name package.xml -exec dirname {} \; | xargs -n 1 -i find {} -name manifest.xml | xargs -n 1 -i mv {} {}.deprecated | ||
- rosdep install -r -n --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y | ||
- find -L src -name manifest.xml.deprecated | xargs -n 1 -i dirname {} | xargs -n 1 -i ln -sf `pwd`/{}/manifest.xml.deprecated `pwd`/{}/manifest.xml | ||
before_script: # Use this to prepare your build for testing e.g. copy database configurations, environment variables, etc. | ||
- source /opt/ros/$ROS_DISTRO/setup.bash | ||
- export CATKIN_PACKAGES="`find $CI_SOURCE_PATH -name package.xml | xargs -n 1 dirname | xargs -n 1 basename`" | ||
script: # All commands must exit with code 0 on success. Anything else is considered failure. | ||
- cd ~/ros/ws_$REPOSITORY_NAME | ||
- rospack profile | ||
- catkin_make -j4 | ||
# - if [ "$CATKIN_PACKAGES" != "" ]; then catkin_make test --pkg $CATKIN_PACKAGES; fi | ||
- catkin_make install | ||
- rm -fr devel src build; source install/setup.bash | ||
after_failure: | ||
- if [ -e ./build/Testing/Temporary/LastTest.log ]; then cat ./build/Testing/Temporary/LastTest.log; fi | ||
- find ${HOME}/.ros/test_results -type f -exec echo "== {} ==" \; -exec cat {} \; | ||
- for file in ${HOME}/.ros/log/rostest-*; do echo "=== $file ==="; cat $file; done | ||
addons: | ||
coverity_scan: | ||
project: | ||
name: "vooon/mavros" | ||
description: "Build submitted via Travis CI" | ||
notification_email: vooon341@gmail.com | ||
build_command_prepend: "cd ~/ros/ws_$REPOSITORY_NAME/src/mavros && cmake ." | ||
build_command: "make -j4" | ||
branch_pattern: coverity_scan |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,288 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(mavros) | ||
|
||
## Find catkin macros and libraries | ||
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) | ||
## is used, also find other catkin packages | ||
find_package(catkin REQUIRED COMPONENTS | ||
diagnostic_msgs | ||
diagnostic_updater | ||
message_generation | ||
message_runtime | ||
pluginlib | ||
roscpp | ||
sensor_msgs | ||
std_msgs | ||
tf | ||
angles | ||
) | ||
|
||
## System dependencies are found with CMake's conventions | ||
# find_package(Boost REQUIRED COMPONENTS system) | ||
find_package(Boost REQUIRED COMPONENTS system) | ||
find_package(mavlink REQUIRED) | ||
|
||
## Uncomment this if the package has a setup.py. This macro ensures | ||
## modules and global scripts declared therein get installed | ||
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html | ||
# catkin_python_setup() | ||
|
||
################################################ | ||
## Declare ROS messages, services and actions ## | ||
################################################ | ||
|
||
## To declare and build messages, services or actions from within this | ||
## package, follow these steps: | ||
## * Let MSG_DEP_SET be the set of packages whose message types you use in | ||
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). | ||
## * In the file package.xml: | ||
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET | ||
## * If MSG_DEP_SET isn't empty the following dependencies might have been | ||
## pulled in transitively but can be declared for certainty nonetheless: | ||
## * add a build_depend tag for "message_generation" | ||
## * add a run_depend tag for "message_runtime" | ||
## * In this file (CMakeLists.txt): | ||
## * add "message_generation" and every package in MSG_DEP_SET to | ||
## find_package(catkin REQUIRED COMPONENTS ...) | ||
## * add "message_runtime" and every package in MSG_DEP_SET to | ||
## catkin_package(CATKIN_DEPENDS ...) | ||
## * uncomment the add_*_files sections below as needed | ||
## and list every .msg/.srv/.action file to be processed | ||
## * uncomment the generate_messages entry below | ||
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) | ||
|
||
## Generate messages in the 'msg' folder | ||
add_message_files( | ||
FILES | ||
Mavlink.msg | ||
Waypoint.msg | ||
WaypointList.msg | ||
BatteryStatus.msg | ||
State.msg | ||
RCIn.msg | ||
RCOut.msg | ||
RadioStatus.msg | ||
OverrideRCIn.msg | ||
) | ||
|
||
## Generate services in the 'srv' folder | ||
add_service_files( | ||
FILES | ||
ParamSet.srv | ||
ParamGet.srv | ||
ParamPull.srv | ||
ParamPush.srv | ||
WaypointSetCurrent.srv | ||
WaypointClear.srv | ||
WaypointPull.srv | ||
WaypointPush.srv | ||
WaypointGOTO.srv | ||
CommandLong.srv | ||
CommandBool.srv | ||
CommandMode.srv | ||
CommandHome.srv | ||
CommandTOL.srv | ||
StreamRate.srv | ||
) | ||
|
||
## Generate actions in the 'action' folder | ||
# add_action_files( | ||
# FILES | ||
# Action1.action | ||
# Action2.action | ||
# ) | ||
|
||
## Generate added messages and services with any dependencies listed here | ||
generate_messages( | ||
DEPENDENCIES | ||
diagnostic_msgs | ||
sensor_msgs | ||
std_msgs | ||
) | ||
|
||
## Select MAVLink dialect | ||
# | ||
# fallback for older mavlink package. | ||
if(NOT DEFINED mavlink_DIALECTS) | ||
list(APPEND mavlink_DIALECTS "ardupilotmega") | ||
list(APPEND mavlink_DIALECTS "pixhawk") | ||
list(APPEND mavlink_DIALECTS "common") | ||
endif() | ||
|
||
set(MAVLINK_DIALECT "ardupilotmega" CACHE STRING "MAVLink dialect selector") | ||
set_property(CACHE MAVLINK_DIALECT PROPERTY STRINGS ${mavlink_DIALECTS}) | ||
|
||
|
||
################################### | ||
## catkin specific configuration ## | ||
################################### | ||
## The catkin_package macro generates cmake config files for your package | ||
## Declare things to be passed to dependent projects | ||
## INCLUDE_DIRS: uncomment this if you package contains header files | ||
## LIBRARIES: libraries you create in this project that dependent projects also need | ||
## CATKIN_DEPENDS: catkin_packages dependent projects also need | ||
## DEPENDS: system dependencies of this project that dependent projects also need | ||
catkin_package( | ||
INCLUDE_DIRS include | ||
LIBRARIES mavconn mavros_plugins | ||
CATKIN_DEPENDS diagnostic_msgs diagnostic_updater pluginlib roscpp sensor_msgs std_msgs tf geometry_msgs | ||
DEPENDS Boost mavlink | ||
) | ||
|
||
########### | ||
## Build ## | ||
########### | ||
|
||
## Specify additional locations of header files | ||
## Your package locations should be listed before other locations | ||
# include_directories(include) | ||
# TODO: Check names of system library include directories (boost) | ||
include_directories( | ||
include | ||
${catkin_INCLUDE_DIRS} | ||
${Boost_INCLUDE_DIRS} | ||
${mavlink_INCLUDE_DIRS} | ||
) | ||
|
||
add_definitions( | ||
-DMAVLINK_DIALECT=${MAVLINK_DIALECT} | ||
) | ||
|
||
## Enable C++11 on gcc 4.6 too | ||
# thanks for: http://www.guyrutenberg.com/2014/01/05/enabling-c11-c0x-in-cmake/ | ||
include(CheckCXXCompilerFlag) | ||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) | ||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) | ||
if(COMPILER_SUPPORTS_CXX11) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
elseif(COMPILER_SUPPORTS_CXX0X) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | ||
else() | ||
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") | ||
endif() | ||
|
||
## Declare a cpp library | ||
add_library(mavconn | ||
src/mavconn/mavconn_interface.cpp | ||
src/mavconn/mavconn_serial.cpp | ||
src/mavconn/mavconn_udp.cpp | ||
src/mavconn/mavconn_tcp.cpp | ||
) | ||
add_dependencies(mavconn | ||
mavros_generate_messages_cpp | ||
) | ||
target_link_libraries(mavconn | ||
${catkin_LIBRARIES} | ||
${Boost_LIBRARIES} | ||
) | ||
|
||
add_library(mavros_plugins | ||
src/plugins/dummy.cpp | ||
src/plugins/sys_status.cpp | ||
src/plugins/imu_pub.cpp | ||
src/plugins/gps.cpp | ||
src/plugins/param.cpp | ||
src/plugins/waypoint.cpp | ||
src/plugins/rc_io.cpp | ||
src/plugins/command.cpp | ||
src/plugins/local_position.cpp | ||
src/plugins/vision_position.cpp | ||
src/plugins/setpoint_position.cpp | ||
src/plugins/safety_area.cpp | ||
src/plugins/3dr_radio.cpp | ||
src/plugins/setpoint_velocity.cpp | ||
src/plugins/setpoint_accel.cpp | ||
src/plugins/setpoint_attitude.cpp | ||
src/plugins/vision_speed.cpp | ||
) | ||
add_dependencies(mavros_plugins | ||
mavros_generate_messages_cpp | ||
mavconn | ||
) | ||
target_link_libraries(mavros_plugins | ||
mavconn | ||
${catkin_LIBRARIES} | ||
${Boost_LIBRARIES} | ||
) | ||
|
||
|
||
## Declare a cpp executable | ||
add_executable(mavros_node | ||
src/mavros_node.cpp | ||
src/uas.cpp | ||
) | ||
add_dependencies(mavros_node | ||
mavros_generate_messages_cpp | ||
mavconn | ||
) | ||
target_link_libraries(mavros_node | ||
mavconn | ||
${catkin_LIBRARIES} | ||
${Boost_LIBRARIES} | ||
) | ||
|
||
add_executable(gcs_bridge | ||
src/gcs_bridge.cpp | ||
) | ||
add_dependencies(gcs_bridge | ||
mavconn | ||
) | ||
target_link_libraries(gcs_bridge | ||
mavconn | ||
${catkin_LIBRARIES} | ||
${Boost_LIBRARIES} | ||
) | ||
|
||
############# | ||
## Install ## | ||
############# | ||
|
||
# all install targets should use catkin DESTINATION variables | ||
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html | ||
|
||
## Mark executable scripts (Python etc.) for installation | ||
## in contrast to setup.py, you can choose the destination | ||
install(PROGRAMS | ||
scripts/mavparam | ||
scripts/mavwp | ||
scripts/mavsafety | ||
scripts/mavcmd | ||
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
) | ||
|
||
## Mark executables and/or libraries for installation | ||
install(TARGETS mavconn mavros_plugins mavros_node gcs_bridge | ||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
) | ||
|
||
## Mark cpp header files for installation | ||
install(DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
FILES_MATCHING PATTERN "*.h" | ||
) | ||
|
||
## Mark other files for installation (e.g. launch and bag files, etc.) | ||
install(FILES | ||
mavros_plugins.xml | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
) | ||
|
||
install(DIRECTORY launch/ | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch | ||
) | ||
|
||
|
||
############# | ||
## Testing ## | ||
############# | ||
|
||
## Add gtest based cpp test target and link libraries | ||
catkin_add_gtest(mavconn-test test/test_mavconn.cpp) | ||
if(TARGET mavconn-test) | ||
target_link_libraries(mavconn-test mavconn) | ||
endif() | ||
|
||
## Add folders to be run by python nosetests | ||
# catkin_add_nosetests(test) |
Oops, something went wrong.