49 vp_stages_latency_estimation_config_t
vlat;
53 PRINT(
"Thread `update_ros` started \n ");
56 return (THREAD_RET) 0;
71 ardrone_application_default_config.video_codec = H264_360P_CODEC;
77 ardrone_application_default_config.video_codec = UVLC_CODEC;
83 printf(
"Something must be really wrong with the SDK!");
93 ardrone_application_default_config.bitrate_ctrl_mode = VBC_MODE_DISABLED;
96 ardrone_application_default_config.max_bitrate = 4000;
99 ardrone_application_default_config.navdata_options = NAVDATA_OPTION_FULL_MASK;
100 ardrone_application_default_config.video_channel = ZAP_CHANNEL_HORI;
101 ardrone_application_default_config.control_level = (0 << CONTROL_LEVEL_COMBINED_YAW);
102 ardrone_application_default_config.flying_mode = FLYING_MODE_FREE_FLIGHT;
108 ardrone_tool_input_add(&
teleop);
109 uint8_t post_stages_index = 0;
112 specific_parameters_t* params =
reinterpret_cast<specific_parameters_t*
>(
113 vp_os_calloc(1,
sizeof(specific_parameters_t)));
114 specific_stages_t* driver_pre_stages =
reinterpret_cast<specific_stages_t*
>(
115 vp_os_calloc(1,
sizeof(specific_stages_t)));
116 specific_stages_t* driver_post_stages =
reinterpret_cast<specific_stages_t*
>(
117 vp_os_calloc(1,
sizeof(specific_stages_t)));
118 vp_api_picture_t* in_picture =
reinterpret_cast<vp_api_picture_t*
>(
119 vp_os_calloc(1,
sizeof(vp_api_picture_t)));
120 vp_api_picture_t* out_picture =
reinterpret_cast<vp_api_picture_t*
>(
121 vp_os_calloc(1,
sizeof(vp_api_picture_t)));
123 in_picture->width = _w;
124 in_picture->height = _h;
126 out_picture->framerate = 20;
127 out_picture->format = PIX_FMT_RGB24;
128 out_picture->width = _w;
129 out_picture->height = _h;
131 out_picture->y_buf =
reinterpret_cast<uint8_t*
>(vp_os_malloc(_w * _h * 3));
132 out_picture->cr_buf = NULL;
133 out_picture->cb_buf = NULL;
135 out_picture->y_line_size = _w * 3;
136 out_picture->cb_line_size = 0;
137 out_picture->cr_line_size = 0;
140 driver_pre_stages->stages_list = NULL;
141 driver_post_stages->stages_list =
reinterpret_cast<vp_api_io_stage_t*
>(
153 driver_post_stages->stages_list[post_stages_index].name =
"ExtractData";
154 driver_post_stages->stages_list[post_stages_index].type = VP_API_OUTPUT_SDL;
155 driver_post_stages->stages_list[post_stages_index].cfg = NULL;
158 driver_pre_stages->length = 0;
159 driver_post_stages->length = post_stages_index;
161 params->in_pic = in_picture;
162 params->out_pic = out_picture;
163 params->pre_processing_stages_list = driver_pre_stages;
164 params->post_processing_stages_list = driver_post_stages;
165 params->needSetPriority = 1;
166 params->priority = 31;
168 START_THREAD(video_stage, params);
170 if (ARDRONE_VERSION() >= 2)
172 START_THREAD(video_recorder, NULL);
173 video_recorder_init();
174 video_recorder_resume_thread();
177 video_stage_resume_thread();
178 ardrone_tool_set_refresh_time(25);
180 START_THREAD(update_ros, ros_driver);
186 PRINT(
"Shutting down ... \n ");
187 JOIN_THREAD(update_ros);
189 video_stage_resume_thread();
190 ardrone_tool_input_remove(&
teleop);
210 ros_driver->PublishNavdataTypes(shared_raw_navdata, shared_navdata_receive_time);
211 ros_driver->
PublishNavdata(shared_raw_navdata, shared_navdata_receive_time);
212 ros_driver->
PublishOdometry(shared_raw_navdata, shared_navdata_receive_time);
231 THREAD_TABLE_ENTRY(video_stage, 31)
232 THREAD_TABLE_ENTRY(update_ros, 43)
233 THREAD_TABLE_ENTRY(video_recorder, 20)
234 THREAD_TABLE_ENTRY(navdata_update, 31)
236 THREAD_TABLE_ENTRY(ardrone_control, 31)
239 BEGIN_NAVDATA_HANDLER_TABLE
240 NAVDATA_HANDLER_TABLE_ENTRY(
245 END_NAVDATA_HANDLER_TABLE
#define NB_DRIVER_POST_STAGES
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
bool_t ardrone_tool_exit()
C_RESULT navdata_custom_release()
const vp_api_stage_funcs_t vp_stages_export_funcs
void PublishOdometry(const navdata_unpacked_t &navdata_raw, const ros::Time &navdata_receive_time)
const navdata_unpacked_t * shared_raw_navdata_ptr
int32_t current_navdata_id
C_RESULT ardrone_tool_shutdown_custom()
C_RESULT navdata_custom_process(const navdata_unpacked_t *const pnd)
DEFINE_THREAD_ROUTINE(update_ros, data)
printf("Deleting Profile %s\n", buffer)
ARDroneDriver * ros_driver
ros::Time shared_navdata_receive_time
vp_os_mutex_t navdata_lock
C_RESULT navdata_custom_init(void *data)
vp_stages_latency_estimation_config_t vlat
void PublishNavdata(const navdata_unpacked_t &navdata_raw, const ros::Time &navdata_receive_time)
C_RESULT ardrone_tool_init_custom(void)