Acceleration data is now being published to navdata as well.

Esse commit está contido em:
Mani Monajjemi
2012-05-16 17:53:01 -07:00
commit 2b9a5c724e
4 arquivos alterados com 13 adições e 3 exclusões
+5
Ver Arquivo
@@ -24,6 +24,11 @@ float32 vy
# linear velocity (mm/sec)
float32 vz
#linear accelerations (unit: g)
float32 ax
float32 ay
float32 az
#time stamp
float32 tm
+4 -3
Ver Arquivo
@@ -53,7 +53,7 @@ void ARDroneDriver::run()
{
// For some unknown reason, sometimes the ardrone critical configurations are not applied
// when the commands are being sent during SDK initialization. This is a trick to send critical
// configurations sometime after SDK boots up.
// configurations sometime after SDK boots up.
if (configDone == false)
{
configWate--;
@@ -123,9 +123,10 @@ void ARDroneDriver::publish_navdata()
msg.vx = navdata.vx; // mm/sec
msg.vy = -navdata.vy; // mm/sec
msg.vz = -navdata.vz; // mm/sec
msg.tm = arnavtime.time;
msg.ax = navdata_phys.phys_accs[ACC_X] / 1000.0; // g
msg.ay = -navdata_phys.phys_accs[ACC_Y] / 1000.0; // g
msg.az = -navdata_phys.phys_accs[ACC_Z] / 1000.0; // g
// TODO: Ideally we would be able to figure out whether we are in an emergency state
// using the navdata.ctrl_state bitfield with the ARDRONE_EMERGENCY_MASK flag, but
// it seems to always be 0. The emergency state seems to be correlated with the
+3
Ver Arquivo
@@ -3,6 +3,8 @@
#include "video.h"
navdata_demo_t navdata;
navdata_phys_measures_t navdata_phys;
navdata_time_t arnavtime;
extern "C" {
@@ -20,6 +22,7 @@ extern "C" {
C_RESULT navdata_custom_process( const navdata_unpacked_t* const pnd )
{
navdata_phys = pnd->navdata_phys_measures;
navdata = pnd->navdata_demo;
arnavtime = pnd->navdata_time;
return C_OK;
+1
Ver Arquivo
@@ -36,6 +36,7 @@ extern "C" {
#include <ardrone_tool/Navdata/ardrone_navdata_client.h>
}
extern navdata_phys_measures_t navdata_phys;
extern navdata_demo_t navdata;
extern navdata_time_t arnavtime;