3 * @author sylvain.gaeremynck@parrot.com
6 #include <ardrone_testing_tool.h>
9 #include <ardrone_tool/ardrone_time.h>
10 #include <ardrone_tool/Navdata/ardrone_navdata_client.h>
11 #include <ardrone_tool/Control/ardrone_control.h>
12 #include <ardrone_tool/UI/ardrone_input.h>
16 #include <ardrone_api.h>
19 #include <ATcodec/ATcodec_api.h>
20 #include <VP_Os/vp_os_print.h>
21 #include <VP_Api/vp_api_thread_helper.h>
22 #include <VP_Os/vp_os_signal.h>
25 #include <UI/gamepad.h>
26 #include <Video/video_stage.h>
28 static int32_t exit_ihm_program = 1;
30 /* Implementing Custom methods for the main function of an ARDrone application */
32 /* The delegate object calls this method during initialization of an ARDrone application */
33 C_RESULT ardrone_tool_init_custom(int argc, char **argv)
35 /* Registering for a new device of game controller */
36 ardrone_tool_input_add( &gamepad );
38 /* Start all threads of your application */
39 START_THREAD( video_stage, NULL );
44 /* The delegate object calls this method when the event loop exit */
45 C_RESULT ardrone_tool_shutdown_custom()
47 /* Relinquish all threads of your application */
48 JOIN_THREAD( video_stage );
50 /* Unregistering for the current device */
51 ardrone_tool_input_remove( &gamepad );
56 /* The event loop calls this method for the exit condition */
57 bool_t ardrone_tool_exit()
59 return exit_ihm_program == 0;
62 C_RESULT signal_exit()
69 /* Implementing thread table in which you add routines of your application and those provided by the SDK */
71 THREAD_TABLE_ENTRY( ardrone_control, 20 )
72 THREAD_TABLE_ENTRY( navdata_update, 20 )
73 THREAD_TABLE_ENTRY( video_stage, 20 )