29 #define DEBUG_PRINT printf
37 #include <mavlink/mavlink_types.h>
38 #include "mavlink/paparazzi/mavlink.h"
42 #include "generated/modules.h"
54 #define MAVLINK_SYSID 1
130 pprz_msg_send_VISUALTARGET(trans,
dev, AC_ID, &cnt,
131 &tx, &ty, &w, &
h, &
s);
141 pprz_msg_send_VISION_POSITION_ESTIMATE(trans,
dev, AC_ID,
176 #ifndef JEVOIS_MAVLINK_ABI_ID
177 #define JEVOIS_MAVLINK_ABI_ID 34
184 mavlink_message_t
msg;
190 if (mavlink_parse_char(MAVLINK_COMM_1,
c, &
msg, &
status)) {
193 case MAVLINK_MSG_ID_HEARTBEAT: {
201 case MAVLINK_MSG_ID_DEBUG: {
202 mavlink_debug_t jevois_mavlink_debug;
203 mavlink_msg_debug_decode(&
msg, &jevois_mavlink_debug);
205 DEBUG_PRINT(
"[jevois mavlink] debug value is %f\n", jevois_mavlink_debug.value);
206 DEBUG_PRINT(
"[jevois mavlink] debug ind is %d\n", jevois_mavlink_debug.ind);
209 case MAVLINK_MSG_ID_HIGHRES_IMU: {
210 mavlink_highres_imu_t jevois_mavlink_visual_target;
211 mavlink_msg_highres_imu_decode(&
msg, &jevois_mavlink_visual_target);
231 DEBUG_PRINT(
"[jevois mavlink] VISUAL_DETECTION %f,%f\n", jevois_mavlink_visual_target.xacc,
232 jevois_mavlink_visual_target.yacc);
237 case MAVLINK_MSG_ID_MANUAL_SETPOINT: {
238 mavlink_manual_setpoint_t jevois_mavlink_manual_setpoint;
239 mavlink_msg_manual_setpoint_decode(&
msg, &jevois_mavlink_manual_setpoint);
242 jevois_mavlink_manual_setpoint.roll,
243 jevois_mavlink_manual_setpoint.pitch,
244 jevois_mavlink_manual_setpoint.yaw);
246 DEBUG_PRINT(
"[jevois mavlink] phi_cmd = %f\n", DegOfRad(jevois_mavlink_manual_setpoint.roll));
247 DEBUG_PRINT(
"[jevois mavlink] theta_cmd = %f\n", DegOfRad(jevois_mavlink_manual_setpoint.pitch));
248 DEBUG_PRINT(
"[jevois mavlink] psi_cmd = %f\n", DegOfRad(jevois_mavlink_manual_setpoint.yaw));
249 DEBUG_PRINT(
"[jevois mavlink] alt_cmd = %f\n", jevois_mavlink_manual_setpoint.thrust);
255 case MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE: {
256 mavlink_vision_position_estimate_t jevois_mavlink_vision_position_estimate;
257 mavlink_msg_vision_position_estimate_decode(&
msg, &jevois_mavlink_vision_position_estimate);
296 mavlink_msg_attitude_send(MAVLINK_COMM_0,
310 mavlink_msg_set_mode_send(MAVLINK_COMM_0,
320 mavlink_msg_heartbeat_send(MAVLINK_COMM_0,
323 MAV_MODE_FLAG_AUTO_ENABLED,
325 MAV_STATE_CALIBRATING);
332 mavlink_msg_highres_imu_send(MAVLINK_COMM_0,