Easily extendable package for interacting with and defining state machines for autonomous aerial systems
Clone or download
Latest commit 3dfc9bd Dec 12, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cfg Remove saturation gain and add saturation value Sep 14, 2017
cmake Add glog Mar 11, 2017
doxygen
events Add setting home action Jun 10, 2018
include/aerial_autonomy Add velocity based relative pose connector Dec 11, 2018
launch Add remote launch for aerial autonomy gui Dec 11, 2018
logs
markdown Move diagram Mar 21, 2017
msg Remove unused variable, fix comments, update tests Sep 4, 2017
neural_network_model_data/tensorflow_model_vars_16_8_tanh Update nn arch should be used with corresponding gcop branch Jun 15, 2018
param Set mpc debug to false Dec 12, 2018
proto Remove unused proto import. Initialize config for uav basic functor t… Dec 12, 2018
scripts
src Fix comments Dec 7, 2018
tests Remove unused proto import. Initialize config for uav basic functor t… Dec 12, 2018
.clang-format
.gitignore
CMakeLists.txt Merge branch 'master' of github.com:jhu-asco/aerial_autonomy into int… Nov 27, 2018
Doxyfile Add documentation, update doxyfile Jun 6, 2018
LICENSE.txt Create LICENSE.txt Mar 17, 2017
README.md Update deps in README May 15, 2018
package.xml
plugin.xml Add GUI to trigger events, receive status Feb 7, 2017
setup.py Add comments for files, fix names of variables Feb 8, 2017

README.md

ASCO Aerial Autonomy

Introduction

The doxygen documentation to the project can be found here.

Setup

Run the setup script in scripts/setup/setup.sh to configure Git hooks.

Install the following dependencies (lcov, protobuf, doxygen, doxypy, coverxygen, google-glog, class-loader). On Ubuntu 14.04 run the following line in a terminal (replacing indigo with your ROS version)

sudo apt-get install lcov protobuf-compiler libprotobuf-dev doxygen doxypy libgoogle-glog-dev ros-indigo-class-loader ros-indigo-ar-track-alvar-msgs autoconf
sudo pip install coverxygen

Install protobuf 3.1:

git clone https://github.com/google/protobuf.git
cd protobuf
git checkout v3.1.0
./autogen.sh
./configure
make
sudo make install
sudo ldconfig

Install googletest release 1.8.0. This version fixes a bug with ASSERT_TRUE as explained here. To install googletest, follow these steps

git  clone https://github.com/google/googletest.git
cd googletest
git checkout release-1.8.0
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_GMOCK=ON -DBUILD_GTEST=ON
make
sudo make install
sudo ldconfig

Run the following in your ROS workspace src folder to setup UAV hardware drivers

git clone -b hydro-devel https://git.lcsr.jhu.edu/ggarime1/rqt_quadcopter_parsers.git
git clone -b 3.2.3 https://github.com/jhu-asco/Onboard-SDK-ROS.git

Optional: Manipulator packages

Optionally, to install drivers related to aerial manipulation, run the following in your ROS src folder

git clone https://git.lcsr.jhu.edu/mshecke1/arm_plugins.git
git clone https://git.lcsr.jhu.edu/ggarime1/controllers.git
git clone https://git.lcsr.jhu.edu/ggarime1/dynamixelsdk.git

Install our GCOP (Geometric Control, Optimization, and Planning) package

git clone https://github.com/jhu-asco/gcop.git
cd gcop
mkdir build
cd build
cmake ..
sudo make install

Running Executables

The package provides a uav_system_node executable which loads a state machine and hardware and waits for event commands from a ROS topic. The rqt_aerial_autonomy_gui script provides a GUI to generate events for the state machine. The rqt plugin can be loaded along with rqt_rviz in the rqt_gui framework.

The simulator.launch file in the launch folder executes the state machine node using simulated hardware. The GUI can be launched individually using rosrun. The steps to launch a simulated quadrotor with the state machine are

roslaunch aerial_autonomy simulator.launch
rosrun aerial_autonomy rqt_aerial_autonomy_gui  # In a separate tab

Running Tests

To build and run tests use catkin build aerial_autonomy --catkin-make-args run_tests. Output of individual tests can be checked using rosrun aerial_autonomy test_name. To see all test outputs run catkin run_tests --this.

Logging

GLOG is used to log messages from the state machine. The messages are divided into different levels (INFO, WARNING, ERROR, etc.,). The information messages are divided into different verbosity levels (0,1,2 and so on). The verbosity level can be adjusted using the environment variable GLOG_v. If the environment variable is set to 1 (export GLOG_v=1), then all the messages with verbosity 0 and 1 are streamed to stderr output.

The log messages are also recorded into log files in the logs folder. The symbolic links uav_system_node.INFO and uav_system_node.WARNING in the log folder point to the latest log files. The log directory can be changed using the GLOG_log_dir environment variable. More information about the log files can be found in the Google Log documentation.

The simulator launch file introduced above allows for specifying the log level and log directory using roslaunch arguments log_level and log_dir respectively. For example

roslaunch aerial_autonomy simulator.launch log_level:=1  # Prints all the verbose log messages with priority 0 and 1.

Style

This repository uses clang-format for style checking. Pre-commit hooks ensure that all staged files conform to the style conventions. To skip pre-commit hooks and force a commit, use git commit -n.

Documentation Coverage

We use coverxygen to generate documentation coverage for the doc: https://github.com/psycofdj/coverxygen

Use the script scripts/generate_documentation_coverage.bash to generate documentation into .documentation_coverage_info folder. Check the html page in .documentation_coverage_info/index.html to verify the documentation coverage of the code.

Documentation coverage is also added as a pre-push hook. This verifies that 95% of the code is covered with documentation before pushing to remote. It can be skipped for branches with their name starting with develop* and also by using git push --no-verify command.

Test Coverage

We use lcov to generate the test coverage report into the .test_coverage_info folder. The script scripts/generate_test_coverage.bash is used to run tests in the project and generate test coverage report into .test_coverage_info folder. The script is generated using CMake. Run catkin build aerial_autonomy to create the script. Check the html page .test_coverage_info/index.html to check the line and function coverage. The bash script is generated by running CMake using catkin build aerial_autonomy.

The test generation is integrated into the pre-push commit hook. This runs the above test coverage generation script and verifies that the coverage level is above 95% threshold. This can be skipped by either naming the branch as develop[your_branch_name] or using git push --no-verify.

Uploading documentation

The documentation is uploaded through gh-pages branch. The docs are created in master and passed to the gh-pages branch using scripts/applydocs.bash script. The script checks that there are not uncommited changes before uploading documentation to avoid issues with git. The script also requires that you explicitly link gh-pages branch to the remote using git branch --set-upstream-to=[GH_PAGES_REMOTE]

Generating Visual graphs from state machines

The script scripts/generate_dot_files.py converts the transition tables in state machines to dot format and also png format. The script automatically runs through all the state machines stored in the include/aerial_autonomy/state_machines folder.

Usage: ./generate_dot_files.py

Hand-eye Calibration

This section describes how to automatically calibrate a transform from a camera to an arm.

Data Collection

Attach an AR tag to the end effector of your arm.

Use rosbag record /ar_pose_marker /your_end_effector_position where /your_end_effector_position is published by your arm driver and gives the position of the end effector in the arm frame (probably based on forward kinematics).

Launch ar_track_alvar and move the arm around so that the end effector AR tag is visible in the camera.

Extract the AR marker data from the bag file to a csv: rostopic echo -b your_data.bag -p --nostr /ar_pose_marker > marker_data.csv

Calibration script

Use the matlab script scripts/calib/arm_camera_calib.m along with your_data.bag and marker_data.csv to generate a calibrated transformation. It uses non-linear least squares to find the hand-eye transformation.