Skip to content

ashfaqfarooqui/crazyflie_ros

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crazyflie_ros

ROS Driver for Bitcraze Crazyflie (http://www.bitcraze.se/), with the following features:

  • Uses the official python SDK (which needs to be installed/copied separately)
  • Publishes on-board sensors in ROS standard message formats
  • Supports ROS parameters to reconfigure crazyflie parameters

Installation

Clone the package into your catkin workspace:

git clone https://github.com/whoenig/crazyflie_ros.git

Additionally, you should have the bitcraze SDK on your file system. See https://github.com/bitcraze/crazyflie-clients-python for details.

If you want to use joystick teleoperation, you should setup the hector_quadrotor package (http://wiki.ros.org/hector_quadrotor).

Usage

There are two packages included: crazyflie and crazyflie_demo. Crazyflie contains the driver and a launch file which can be used in your own projects.

Crazyflie_demo contains a small demo for teleoperating the crazyflie with a joystick and visualizing the sensor data in rviz.

You can use

roslaunch crazyflie_demo teleop_xbox360.launch

to teleoperate the crazyflie. Please note that there are (optional) arguments to change the device uri and path to the sdk. See crazyflie_demo/launch/teleop_xbox360.launch for details.

ROS Features

Parameters

The launch file supports the following arguments:

  • crazyflieSDK: Path to the official SDK from Bitcraze, e.g. ~/crazyflie/crazyflie-clients-python/lib
  • uri: Specifier for the crazyflie, e.g. radio://0/80/2M
  • tf_prefix: tf prefix for the crazyflie frame(s)
  • roll_trim: Trim in degrees, e.g. negative if flie drifts to the left
  • pitch_trim: Trim in degrees, e.g. negative if flie drifts forward

See http://wiki.bitcraze.se/projects:crazyflie:userguide:tips_and_tricks for details on how to obtain good trim values.

Subscribers

cmd_vel

Similar to the hector_quadrotor, package the fields are used as following:

  • linear.y: roll [e.g. -30 to 30 degrees]
  • linear.x: pitch [e.g. -30 to 30 degrees]
  • angular.z: yawrate [e.g. -200 to 200 degrees/second]
  • linear.z: thrust [10000 to 60000 (mapped to PWM output)]

Publishers

imu

  • sensor_msgs/IMU
  • contains the sensor readings of gyroscope and accelerometer
  • The covariance matrices are set to unknown
  • orientation is not set (this could be done by the magnetometer readings in the future.)
  • update: 10ms (time between crazyflie and ROS not synchronized!)
  • can be viewed in rviz

temperature

magnetic_field

  • sensor_msgs/MagneticField
  • update: 100ms (time between crazyflie and ROS not synchronized!)

pressure

  • Float32
  • hPa (or mbar)
  • update: 100ms (time between crazyflie and ROS not synchronized!)

battery

  • Float32
  • Volts
  • update: 100ms (time between crazyflie and ROS not synchronized!)

Similar Projects

Notes

  • The dynamic_reconfigure package (http://wiki.ros.org/dynamic_reconfigure/) seems like a good fit to map the parameters, however it has severe limitations:
    • Changed-Callback does not include which parameter(s) were changed. There is only a notion of a level which is a simple bitmask. This would cause that on any parameter change we would need to update all parameters on the Crazyflie.
    • Parameters are statically generated. There are hacks to add parameters at runtime, however those might not work with future versions of dynamic_reconfigure.
    • Groups not fully supported (ros-visualization/rqt_common_plugins#162; This seems to be closed now, however the Indigo binary packages did not pick up the fixes yet).

About

ROS Driver for Bitcraze Crazyflie

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 59.6%
  • CMake 40.4%