bebop_autonomy - ROS Driver for Parrot Bebbop Drone (quadrocopter) 1.0 & 2.0¶
bebop_autonomy is a ROS driver for Parrot Bebop drone (quadrocopter), based on Parrot’s official ARDroneSDK3. This driver has been developed in Autonomy Lab of Simon Fraser University by Mani Monajjemi.
[Source Code] [ROS wiki page] [Support] [Bug Tracker] [Developer Forum]
Features and Roadmap¶
Feature | Status | Notes |
---|---|---|
Core piloting | Yes | |
H264 video decoding | Yes | Enhancement: #1 |
ROS Camera Interface | Yes | |
Nodelet implementation | Yes | |
Publish Bebop states as ROS topics | Yes | |
Dynamically reconfigurable Bebop settings | Yes | Configuring the Drone |
Inline build of ARDroneSDK3 | Yes | Enhancement: #2 |
Bebop In The Loop tests | Yes | Tests |
Joystick teleop demo | Yes | |
TF Publisher | No (Planned) | #3 |
Odometry Publisher | No (Planned) | #4 |
Provide ROS API for on-board picture/video recording | No (Planned) | #5 |
GPS Support | Partial | Not fully tested |
Mavlink Support | No | |
Binary Release | No | |
Support for Parrot Sky Controller | No |
Table of Contents¶
Changelog and Release History¶
Changelog for package bebop_driver¶
0.4.0 (2016-01-17)¶
- Update Parrot SDK to 3.7.5 (from 3.6) - Remove upstream XML hash from .msg files to minmize msg type changes from now on - New Topic and Message type for DefaultCameraOrientation
- Add cmd_vel timeout for safety - The driver now sends stop command if no new cmd_vel is received within a pre-defined timeout period. This timeout is set to 0.1s by default and can be changed via cmd_vel_timeout parameter.
- Fix right-jand rule bug of angular.z @jacobperron (fixes #26)
- Patch ARSDK to fix Sanselan’s old URL - This is temporary and must be reverted when this is fixed upstream. Issue reported here: Parrot-Developers/ARSDKBuildUtils#61
- Add bebop ip address as ROS parameter (fixes #19) - (Param name: bebop_ip, default value: 192.168.42.1)
- Fix CameraInfo issues (closes #10) - Fix bugs in loading camera calibration data and update the tests - Add a sample calibration file for bebop camera: bebop_camera_calib.yaml - Load camera calibration file by default in both node/nodelet launch files
- Remove redundant bebop.launch file (closes #11)
- Fix coordinate system inconsistencies (fixes #13) - Fix cmd_vel.linear.y sign error - Use attitude values in tests instead of velocities
- Contributors: Anup, Mani Monajjemi, Jacob Perron
0.3.0 (2015-09-17)¶
- Renamed package to bebop_driver
- Built against ARSDK3_version_3_6
- bebop_autonomy is now a metapackage - bebop_autonomy is the ROS metapackage name - Rename bebop_autonomy package to bebop_driver - Rename bebop_autonomy_msgs to bebop_msgs
- Contributors: Mani Monajjemi
0.2.0 (2015-09-10)¶
- Finalized documentation
- Remove bebop_autonomy’s dependency to image_view
- Imrovements to code autogeneration scripts.
- CLAMP values for cmd_vels and anim_id
- Added contents to almost all doc pages
- Bebop In The Loop tests (first revision)
- Fixed more style (lint) issues
- Finalized the first revision of tests
- Add autogenerated docs for Settings, Topics and Params
- Contributors: Mani Monajjemi
0.1.2 (2015-09-05)¶
- Move ‘state’ params to their own param namespace
- Add missing unzip dep to package.xml
- Contributors: Mani Monajjemi
0.1.1 (2015-09-04)¶
- Add support for downloading and building ARDroneSDK3 during the build process
- Add flattrim, flip and navigatehome interfaces
- Add forward declaration to classes where it is possible
- Major bug fixes and improvements - Dynamic Reconfigure: Convert all two state int_t values to enum - Fix the private nodehandle bugs in State and Settings handlers - Fix the data flow of Settings between rosparam and dynamic reconfigure and bebop - Fix SDK enum types in C (I32 instead of U8) - Add Start/Stop streaming to Bebop interface class
- Add bebop_nodelet launch with image_view
- Organized DynR configs into groups + Moved the autogeneration report to a seperated file + build speed improvements
- Dynamically reconfigurable Bebop settings
- Add support to enable publishing of a specific State
- Add support to propogate states from bebop to ROS
- Auto-generated .msg and .h files based on libARCommands XML files
- New threading model for data retreival and publishing - Nodelet now manages its own thread to receive frames from Bebop - GetFrame() function abstracts all sync to access the rgb frame - All subscribers send commands to the Bebop in their callbacks
- Integreate ARSAL logs into ROS_LOG - Fix sync issues between frame grabber and publisher
- Improve video decode/publish pipeline - Adopt frame decoding from official examples - Thread safe access to raw frame ptr - Synchronised frame decoding and publishing
- Proof of concept ROS driver for bebop drone
- Contributors: Mani Monajjemi
Changelog for package bebop_tools¶
0.4.0 (2016-01-17)¶
- Fix cmd_vel.linear.y sign issue in joystick config file
- Contributors: Mani Monajjemi
0.3.0 (2015-09-17)¶
- Renamed package to bebop_tools
- Contributors: Mani Monajjemi
0.2.0 (2015-09-10)¶
- Move image_view nodelet demo to bebop_tools package
- Contributors: Mani Monajjemi
0.1.2 (2015-09-05)¶
- Initial release of joystick teleop for bebop_autonomy
- Contributors: Mani Monajjemi
0.1.1 (2015-09-04)¶
Changelog for package bebop_msgs¶
0.4.0 (2016-01-17)¶
- Update Parrot SDK to 3.7.5 (from 3.6)
- New Topic and Message type for DefaultCameraOrientation
- Contributors: Mani Monajjemi
0.3.0 (2015-09-17)¶
- Renamed to bebop_msgs
- Contributors: Mani Monajjemi
0.2.0 (2015-09-10)¶
- Contributors: Mani Monajjemi
0.1.2 (2015-09-05)¶
- Contributors: Mani Monajjemi
0.1.1 (2015-09-04)¶
- Auto-generated .msg and .h files based on libARCommands XML files
- Contributors: Mani Monajjemi
Installation¶
Compiling From Source¶
Pre-requirements:
- ROS Indigo or Jade (Only tested on Ubuntu)
- Internet connection
- Ubuntu packages:
build-esstential
,python-rosdep
,python-catkin-tools
- Basic familiarity with building ROS packages
$ sudo apt-get install build-essential python-rosdep python-catkin-tools
To compile from source, you need to clone the source code in a new or existing catkin
workspace, use rosdep
to install dependencies and finally compile the workspace using catkin. The following commands demonstrate this procedure in a newly created catkin
workspace.
# Create and initialize the workspace
$ mkdir -p ~/bebop_ws/src && cd ~/bebop_ws
$ catkin init
$ git clone https://github.com/AutonomyLab/bebop_autonomy.git src/bebop_autonomy
# Update rosdep database and install dependencies
$ rosdep update
$ rosdep install --from-paths src -i
# Build the workspace
$ catkin build -DCMAKE_BUILD_TYPE=RelWithDebInfo
The first time build may take up to 15 minutes, since ARDroneSDK3’s build script downloads and compiles ~20 packages from Internet.
$ cd ~/bebop_ws/src
$ git clone https://github.com/ros-teleop/teleop_tools.git
# Do rosdep steps again
Running the Driver¶
You can run Bebop’s ROS drivereither as a ROS Nodelet or as a standalone ROS Node. The former is recommended if you intend to perform any kind of processing on Bebop’s video stream.
Note
If you compile the driver form source, do not forget to source your catkin workspace prior to running the driver. (i.e. source ~/bebop_ws/devel/setup.[bash|zsh]
)
Note
Ensure that your Bebop’s firmware is at least 2.0.29 and your computer is connected to Bebop’s wireless network.
Running the driver as a Node¶
The executable node is called bebop_driver_node
and exists in bebop_driver
package. It’s recommended to run the Node in its own namespace and with default configuration. The driver package comes with a sample launch file bebop_driver/launch/bebop_node.launch
which demonstrates the procedure.
$ roslaunch bebop_driver bebop_node.launch
<?xml version="1.0"?>
<launch>
<group ns="bebop">
<node pkg="bebop_driver" name="bebop_driver" type="bebop_driver_node" output="screen">
<param name="camera_info_url" value="package://bebop_driver/data/bebop_camera_calib.yaml" />
<param name="bebop_ip" value="192.168.42.1" />
<rosparam command="load" file="$(find bebop_driver)/config/defaults.yaml" />
</node>
</group>
</launch>
Running the driver as a Nodelet¶
To run the driver as a ROS Nodelet, you need to first run a Nodelet manager, then load the driver’s Nodelet (bebop_driver/BebopDriverNodelet
) in it, along with other Nodelets that need to communicate with the driver. bebop_tools/launch/bebop_nodelet_iv.launch is a sample launch file that demonstrates these steps by visualizing Bebop’s video stream using an instance of image_view/image Nodelet. Similar to bebop_node.launch, it also runs everything in its own namespace and loads the default configuration.
$ roslaunch bebop_tools bebop_nodelet_iv.launch
<?xml version="1.0"?>
<launch>
<!-- include the nodelet launch file from bebop_driver -->
<include file="$(find bebop_driver)/launch/bebop_nodelet.launch" />
<!-- use the same nodelet manager and namespace, then load image_view nodelet -->
<group ns="bebop">
<node pkg="nodelet" type="nodelet" name="bebop_image_view_nodelet"
args="load image_view/image bebop_nodelet_manager">
<remap from="image" to="image_raw" />
</node>
</group>
</launch>
<?xml version="1.0"?>
<launch>
<group ns="bebop">
<!-- nodelet manager -->
<node pkg="nodelet" type="nodelet" name="bebop_nodelet_manager" args="manager" output="screen"/>
<!-- bebop_nodelet -->
<node pkg="nodelet" type="nodelet" name="bebop_nodelet"
args="load bebop_driver/BebopDriverNodelet bebop_nodelet_manager">
<param name="camera_info_url" value="package://bebop_driver/data/bebop_camera_calib.yaml" />
<param name="bebop_ip" value="192.168.42.1" />
<rosparam command="load" file="$(find bebop_driver)/config/defaults.yaml" />
</node>
</group>
</launch>
Sending Commands to Bebop¶
Note
bebop_tools
package comes with a launch file for tele-operating Bebop with a joystick using ROS joy_teleop package. The configuration file (key-action map) is written for Logitech F710 controller and is located in bebop_tools/config
folder. Adapting the file to your own controller is straightforward. To teleop Bebop while the driver is running execute roslaunch bebop_tools joy_teleop.launch
.
Takeoff¶
Publish a message of type std_msgs/Empty
to takeoff
topic.
$ rostopic pub --once std_msgs/Empty [namespace]/takeoff
Land¶
Publish a message of type std_msgs/Empty
to land
topic.
$ rostopic pub --once std_msgs/Empty [namespace]/land
Emergency¶
Publish a message of type std_msgs/Empty
to reset
topic.
$ rostopic pub --once std_msgs/Empty [namespace]/reset
Piloting¶
To move Bebop around, publish messages of type geometry_msgs/Twist to cmd_vel topic while Bebop is flying. The effect of each field of the message on Bebop’s movement is listed below:
linear.x (+) Translate forward
(-) Translate backward
linear.y (+) Translate to left
(-) Translate to right
linear.z (+) Ascend
(-) Descend
angular.z (+) Rotate counter clockwise
(-) Rotate clockwise
Acceptable range for all fields are [-1..1]
. The drone executes the last received command as long as the driver is running. This command is reset to when Takeoff, Land or Emergency command is received. To make Bebop hover and maintain its current position, you need to publish a message with all fields set to zero to cmd_vel
.
Note
Since version 0.4, sign of angular.z
has been negated to conform with ROS Standard Message Types (i.e Twisl) - REP 103 and ardrone_autonomy.
Moving the Virtual Camera¶
To move Bebop’s virtual camera, publish a message of type geometry_msgs/Twist to camera_control topic. angular.y
and angular.z
fields of this message set absolute tilt and pan of the camera in degrees respectively. The field of view of this virtual camera (based on our measurements) is ~80 (horizontal) and ~50 (vertical) degrees.
Warning
The API for this command is not stable. We plan to use JointState
message in future versions.
angular.y (+) tilt down
(-) tilt up
angular.z (+) pan left
(-) pan right
Flat Trim¶
Error
Test fails, probably not working.
Publish a message of type std_msgs/Empty
to flattrim
topic.
$ rostopic pub --once std_msgs/Empty [namespace]/flattrim
Flight Animations¶
Warning
Be extra cautious when performing any flight animations, specially in indoor environments.
Bebop can perform four different types of flight animation (flipping). To perform an animation, publish a message of type std_msgs/UInt8 to flip topic while drone is flying. The data field determines the requested animation type.
0 Flip Forward
1 Flip Backward
2 Flip Right
3 Flip Left
Reading from Bebop¶
Camera¶
The video stream from Bebop’s front camera is published on image_raw
topic as sensor_msgs/Image
messages. bebop_driver complies with ROS camera interface specifications and publishes camera information and calibration data to camera_info
topic. Due to limitations in Parrot’s ARDroneSDK3, the quality of video stream is limited to 640 x 368 @ 30 Hz. The field of view of this virtual camera (based on our measurements) is ~80 (horizontal) and ~50 (vertical) degrees.
To set the location of camera calibration data, please check this page: Configuring Bebop and the Driver. Since v0.4, the package ships with a default camera caliberation file located at bebop_driver/data/bebop_front_calib.yaml
. Both default node/nodelet launch files, load this file when executing the driver.
Configuring Bebop and the Driver¶
Driver Parameters¶
Following parameters are set during driver’s startup:
~bebop_ip¶
Sets the IP addres of the Bebop. The default value is 192.168.42.1
.
~reset_settings¶
Setting this parameter to true
will reset all Bebop configurations to factory defaults. Default value is false
.
~camera_info_url¶
Sets the location of the camera caliberation data. Default is empty string. For more information check this documentation.
Note
Since v0.4, the package comes with a default camera caliberation file located at bebop_driver/data/bebop_front_calib.yaml
.
~camera_frame_id¶
Sets the frame_id
of camera and image messages. Default value is camera
.
~cmd_vel_timeout¶
New in version 0.4.
Sets the safety timeout for piloting cmd_vel
commands in seconds. Deafult is set to 0.1 seconds (100 miliseconds). If no piloting command is received by the driver within this timeout period, the driver issues a stop command which causes the drone to hover.
Dynamically Reconfigurable Parameters for Bebop¶
Following ROS parameters change Bebop’s settings. They can be tweaked during runtime using dynamic reconfigure GUI. Setting ~reset_settings parameter to true
will reset all these settings to factory defaults.
Coordinate System Conventions¶
ROS Standard Message Types (i.e Twisl) - REP 103¶
+x | forward |
+y | left |
+z | up |
+yaw | CCW |
Bebop Velocities¶
+x | East |
+y | South |
+z | Down |
Bebop Attitude¶
+x | forward |
+y | right |
+z | down |
+yaw | CW |
SDK’s setPilotingPCMD¶
+roll | right |
+pitch | forward |
+gaz | up |
+yaw | CW |
Contribute¶
Contribute to bebop_autonomy¶
You can contribute to bebop_autonomy by:
- Reporting bugs using driver’s Issue Tracker on Github.
- Submitting patches, new features, sample codes, documentation and supplementary materials (i.e. launch and configuration files) as Github Pull Requests.
- Please check current open issues and Features and Roadmap section for a list of known bugs and feature request.
- Joining driver’s developers forum and participate in technical discussions on new features, bugs and roadmap.
List of Developers¶
List of Contributers¶
Acknowledgments¶
- Mike Purvis for his help with designing the initial architecture of the driver.
Frequently Asked Questions¶
Is bebop_autonomy based on ardrone_autonomy?¶
No. ardrone_autonomy is based on Parrot’s legacy SDK for AR-Drone 1.0 and 2.0, while bebop_autonomy uses Parrot’s new SDK for its third generation drones. Since these two SDKs and their underlying protocols are totally different and incompatible, we had to develop bebop_autonomy from scrath.
Is bebop_autonomy compatible with ardrone_autonomy?¶
Not completely.
- Topic names, types and coordinate frame conventions for core piloting tasks are identical, however there is no explicit namespacing (i.e.
takeoff
instead ofardrone/takeoff
) - bebop_autonomy does not expose services for Flight Animations or Flat Trim; topics are used instead.
- Front camera video stream is published on
image_raw
topic only. - Parameter names, types and effects are different.
- AR-Drone Navdata is replaced by Bebop States (see States (aka Navdata))
Under The Hood¶
This page contains information about the architecture of the driver and different techniques used for its development.
Automatic Code Generation¶
TBA
Threading Model¶
TBA
Publishing States¶
TBA
Configuring the Drone¶
TBA
Tests¶
Upgrading Bebop SDK¶
- Update
GIT_TAG
ofARDroneSDK3
inbebop_driver/CMakeLists.txt::ExternalProject_Add
to your desired commit hash, branch or tag (release). The official upstream repository is hosted here. - Checkout (or browse) the upstream repository at the same hash used in step (1) and open
repos.xml
file. From this file, extract the commit hash oflibARCommands
fromrev
property of this XML tag:<repo name="libARCommands" rev="" />
. - Open
bebop_driver/scripts/meta/generate.py
and updateLIBARCOMMANDS_GIT_HASH
variable to the hash obtained in step (2). - Change the working diretory to
bebop_driver/scripts/meta
, then executegenerate.py
from command line. This will regenerate all automatically generated message definitions, header files and documentations. - Copy the generated files to their target locations by calling
install.sh
. - In
bebop_driver/include/bebop_driver/autogenerated/ardrone3_setting_callbacks.h
changeARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSETTINGSSTATE_MAXDISTANCECHANGED_VALUE
toARCONTROLLER_DICTIONARY_KEY_ARDRONE3_PILOTINGSETTINGSSTATE_MAXDISTANCECHANGED_CURRENT
. This is due to a bug in upstream XML definitions. - Remove
build
anddevel
space of yourcatkin
workspace, then re-build it.
License¶
Parrot ARDrone3 SDK¶
Copyright (C) 2014 Parrot SA
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Parrot nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior writtenpermission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bebop_autonomy (driver and tools)¶
Copyright (c) 2015, Mani Monajjemi (AutonomyLab, Simon Fraser University) All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of [project] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.