Acceleration data is now being published to navdata as well.
Esse commit está contido em:
@@ -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
|
||||
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário