ASCO Aerial Autonomy
The doxygen documentation to the project can be found here.
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
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
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
provides a GUI to generate events for the state machine. The rqt plugin can be loaded along with
rqt_rviz in 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
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.
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.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.
simulator launch file introduced above allows for specifying the log level and log directory using roslaunch arguments
log_dir respectively. For example
roslaunch aerial_autonomy simulator.launch log_level:=1 # Prints all the verbose log messages with priority 0 and 1.
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.
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
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.
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.
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
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
This section describes how to automatically calibrate a transform from a camera to an arm.
Attach an AR tag to the end effector of your arm.
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
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.