From e8c4648e733dac1b5394e8c742b5b156f703f033 Mon Sep 17 00:00:00 2001 From: Mani Monajjemi Date: Wed, 13 Feb 2013 19:17:03 -0800 Subject: [PATCH] Motor PWM added to Navdata. README updated. --- README.md | 6 ++++-- msg/Navdata.msg | 6 ++++++ src/ardrone_driver.cpp | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6167c5b..7929f3a 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ - [Flight Animations ](#flight-animations-new) :new: - [IMU Calibration](#imu-calibration) - [Flat Trim](#flat-trim) - - [Record to USB Stick](#record-usb) + - [Record to USB Stick](#record-usb) :new: - [Parameters](#parameters) - [AR-Drone Specific Parameters](#ar-drone-specific-parameters) - [Other Parameters](#other-parameters) @@ -39,6 +39,7 @@ ## Updates +- *February 13 2013*: Support for USB key recording ([More info](https://github.com/AutonomyLab/ardrone_autonomy/pull/53)). Motor PWM added to legacy Navdata. - *January 9 2013*: ROS Groovy support. Support for zero-command without hovering ([More info](https://github.com/AutonomyLab/ardrone_autonomy/pull/34)). Full configurable Navdata support ([More info](https://github.com/AutonomyLab/ardrone_autonomy/pull/31)). Support for "Flight Animations". Support for Real-time navdata and video publishing ([More info](https://github.com/AutonomyLab/ardrone_autonomy/pull/44)). Support for configurable data publishing rate. - *November 9 2012*: Critical Bug in sending configurations to drone fixed and more parameters are supported ([More info](https://github.com/AutonomyLab/ardrone_autonomy/issues/24)). Separate topic for magnetometer data added ([More info](https://github.com/AutonomyLab/ardrone_autonomy/pull/25)). - *September 5 2012*: Experimental automatic IMU bias removal. @@ -135,6 +136,7 @@ Information received from the drone will be published to the `ardrone/navdata` t * `wind_angle`: Estimated wind angle (AR-Drone 2.0 Only) (TBA: Unit) * `wind_comp_angle`: Estimated wind angle compensation (AR-Drone 2.0 Only) (TBA: Unit) * `altd`: Estimated altitude (mm) +* `motor1..4`: Motor PWM values * `vx`, `vy`, `vz`: Linear velocity (mm/s) [TBA: Convention] * `ax`, `ay`, `az`: Linear acceleration (g) [TBA: Convention] * `tm`: Timestamp of the data returned by the Drone returned as number of micro-seconds passed since Drone's boot-up. @@ -319,7 +321,7 @@ The Parrot's license, copyright and disclaimer for `ARDroneLib` are included wit - [Mike Hamer](https://github.com/mikehamer) - Added support for proper SDK2 way of configuring the Drone via parameter (critical bug fix) ([More Info](https://github.com/AutonomyLab/ardrone_autonomy/pull/26)). Support for zero-command without hovering ([More info](https://github.com/AutonomyLab/ardrone_autonomy/pull/34)). Full configurable Navdata support ([More info](https://github.com/AutonomyLab/ardrone_autonomy/pull/31)). Support for Real-time navdata and video publishing ([More info](https://github.com/AutonomyLab/ardrone_autonomy/pull/44)). Support for configurable data publishing rate. - [Jacokb Engel](https://github.com/JakobEngel) -- [Sameer Parekh](https://github.com/sameerparekh) - [Seperate Magnetometer Topic](https://github.com/AutonomyLab/ardrone_autonomy/pull/25) +- [Sameer Parekh](https://github.com/sameerparekh) - [Turn on and off USB stick recording](https://github.com/AutonomyLab/ardrone_autonomy/pull/53) - [Seperate Magnetometer Topic](https://github.com/AutonomyLab/ardrone_autonomy/pull/25) - [Devmax](https://github.com/devmax) - [Flat Trim](https://github.com/AutonomyLab/ardrone_autonomy/issues/18) + Various comments for enhancements - [Rachel Brindle](https://github.com/younata) - [Enhanced Navdata for AR-Drone 2.0](https://github.com/AutonomyLab/ardrone_autonomy/pull/2) diff --git a/msg/Navdata.msg b/msg/Navdata.msg index 3ae8b20..98a6e8a 100644 --- a/msg/Navdata.msg +++ b/msg/Navdata.msg @@ -52,6 +52,12 @@ float32 ax float32 ay float32 az +#motor commands (unit 0 to 255) +uint8 motor1 +uint8 motor2 +uint8 motor3 +uint8 motor4 + #Tags in Vision Detectoion uint32 tags_count uint32[] tags_type diff --git a/src/ardrone_driver.cpp b/src/ardrone_driver.cpp index 5fa5220..8bc9c45 100644 --- a/src/ardrone_driver.cpp +++ b/src/ardrone_driver.cpp @@ -659,6 +659,11 @@ void ARDroneDriver::publish_navdata(navdata_unpacked_t &navdata_raw, const ros:: legacynavdata_msg.ay = -navdata_raw.navdata_phys_measures.phys_accs[ACC_Y] / 1000.0; // g legacynavdata_msg.az = -navdata_raw.navdata_phys_measures.phys_accs[ACC_Z] / 1000.0; // g + legacynavdata_msg.motor1 = navdata_raw.navdata_pwm.motor1; + legacynavdata_msg.motor2 = navdata_raw.navdata_pwm.motor2; + legacynavdata_msg.motor3 = navdata_raw.navdata_pwm.motor3; + legacynavdata_msg.motor4 = navdata_raw.navdata_pwm.motor4; + // New stuff if (IS_ARDRONE2)