1 #include <ardrone_tool/Navdata/ardrone_navdata_client.h>
3 #include <Navdata/navdata.h>
6 /* Initialization local variables before event loop */
7 inline C_RESULT demo_navdata_client_init( void* data )
12 /* Receving navdata during the event loop */
13 inline C_RESULT demo_navdata_client_process( const navdata_unpacked_t* const navdata )
15 const navdata_demo_t*nd = &navdata->navdata_demo;
17 printf("=====================\nNavdata for flight demonstrations =====================\n\n");
19 printf("Control state : %i\n",nd->ctrl_state);
20 printf("Battery level : %i mV\n",nd->vbat_flying_percentage);
21 printf("Orientation : [Theta] %4.3f [Phi] %4.3f [Psi] %4.3f\n",nd->theta,nd->phi,nd->psi);
22 printf("Altitude : %i\n",nd->altitude);
23 printf("Speed : [vX] %4.3f [vY] %4.3f [vZPsi] %4.3f\n",nd->theta,nd->phi,nd->psi);
30 /* Relinquish the local resources after the event loop exit */
31 inline C_RESULT demo_navdata_client_release( void )
36 /* Registering to navdata client */
37 BEGIN_NAVDATA_HANDLER_TABLE
38 NAVDATA_HANDLER_TABLE_ENTRY(demo_navdata_client_init, demo_navdata_client_process, demo_navdata_client_release, NULL)
39 END_NAVDATA_HANDLER_TABLE