5 #ifndef UALBERTA_TESTSUITE_H
6 #define UALBERTA_TESTSUITE_H
12 #ifndef MAVLINK_TEST_ALL
13 #define MAVLINK_TEST_ALL
14 static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
15 static void mavlink_test_ualberta(uint8_t, uint8_t, mavlink_message_t *last_msg);
17 static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
19 mavlink_test_common(system_id, component_id, last_msg);
20 mavlink_test_ualberta(system_id, component_id, last_msg);
24 #include "../common/testsuite.h"
27 static void mavlink_test_nav_filter_bias(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
29 mavlink_message_t msg;
33 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
36 memset(&packet1, 0,
sizeof(packet1));
47 memset(&packet2, 0,
sizeof(packet2));
48 mavlink_msg_nav_filter_bias_encode(system_id, component_id, &msg, &packet1);
49 mavlink_msg_nav_filter_bias_decode(&msg, &packet2);
52 memset(&packet2, 0,
sizeof(packet2));
54 mavlink_msg_nav_filter_bias_decode(&msg, &packet2);
57 memset(&packet2, 0,
sizeof(packet2));
58 mavlink_msg_nav_filter_bias_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
usec , packet1.
accel_0 , packet1.
accel_1 , packet1.
accel_2 , packet1.
gyro_0 , packet1.
gyro_1 , packet1.
gyro_2 );
59 mavlink_msg_nav_filter_bias_decode(&msg, &packet2);
62 memset(&packet2, 0,
sizeof(packet2));
64 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
67 mavlink_msg_nav_filter_bias_decode(last_msg, &packet2);
70 memset(&packet2, 0,
sizeof(packet2));
72 mavlink_msg_nav_filter_bias_decode(last_msg, &packet2);
76 static void mavlink_test_radio_calibration(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
78 mavlink_message_t msg;
82 { 17235, 17236, 17237 },{ 17547, 17548, 17549 },{ 17859, 17860, 17861 },{ 18171, 18172 },{ 18379, 18380, 18381, 18382, 18383 },{ 18899, 18900, 18901, 18902, 18903 }
85 memset(&packet1, 0,
sizeof(packet1));
87 mav_array_memcpy(packet1.
aileron, packet_in.
aileron,
sizeof(uint16_t)*3);
89 mav_array_memcpy(packet1.
rudder, packet_in.
rudder,
sizeof(uint16_t)*3);
90 mav_array_memcpy(packet1.
gyro, packet_in.
gyro,
sizeof(uint16_t)*2);
91 mav_array_memcpy(packet1.
pitch, packet_in.
pitch,
sizeof(uint16_t)*5);
95 memset(&packet2, 0,
sizeof(packet2));
96 mavlink_msg_radio_calibration_encode(system_id, component_id, &msg, &packet1);
97 mavlink_msg_radio_calibration_decode(&msg, &packet2);
100 memset(&packet2, 0,
sizeof(packet2));
102 mavlink_msg_radio_calibration_decode(&msg, &packet2);
105 memset(&packet2, 0,
sizeof(packet2));
107 mavlink_msg_radio_calibration_decode(&msg, &packet2);
110 memset(&packet2, 0,
sizeof(packet2));
112 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
115 mavlink_msg_radio_calibration_decode(last_msg, &packet2);
118 memset(&packet2, 0,
sizeof(packet2));
120 mavlink_msg_radio_calibration_decode(last_msg, &packet2);
124 static void mavlink_test_ualberta_sys_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
126 mavlink_message_t msg;
133 memset(&packet1, 0,
sizeof(packet1));
140 memset(&packet2, 0,
sizeof(packet2));
141 mavlink_msg_ualberta_sys_status_encode(system_id, component_id, &msg, &packet1);
142 mavlink_msg_ualberta_sys_status_decode(&msg, &packet2);
145 memset(&packet2, 0,
sizeof(packet2));
146 mavlink_msg_ualberta_sys_status_pack(system_id, component_id, &msg , packet1.
mode , packet1.
nav_mode , packet1.
pilot );
147 mavlink_msg_ualberta_sys_status_decode(&msg, &packet2);
150 memset(&packet2, 0,
sizeof(packet2));
152 mavlink_msg_ualberta_sys_status_decode(&msg, &packet2);
155 memset(&packet2, 0,
sizeof(packet2));
157 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
160 mavlink_msg_ualberta_sys_status_decode(last_msg, &packet2);
163 memset(&packet2, 0,
sizeof(packet2));
165 mavlink_msg_ualberta_sys_status_decode(last_msg, &packet2);
169 static void mavlink_test_ualberta(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
171 mavlink_test_nav_filter_bias(system_id, component_id, last_msg);
172 mavlink_test_radio_calibration(system_id, component_id, last_msg);
173 mavlink_test_ualberta_sys_status(system_id, component_id, last_msg);
178 #endif // __cplusplus
179 #endif // UALBERTA_TESTSUITE_H
Definition: mavlink_types.h:180
Definition: mavlink_types.h:179
float accel_2
b_f[2]
Definition: mavlink_msg_nav_filter_bias.h:10
uint16_t pitch[5]
Pitch curve setpoints (every 25%)
Definition: mavlink_msg_radio_calibration.h:11
Definition: mavlink_msg_nav_filter_bias.h:5
uint8_t mode
System mode, see UALBERTA_AUTOPILOT_MODE ENUM.
Definition: mavlink_msg_ualberta_sys_status.h:7
uint8_t pilot
Pilot mode, see UALBERTA_PILOT_MODE.
Definition: mavlink_msg_ualberta_sys_status.h:9
float gyro_2
b_f[2]
Definition: mavlink_msg_nav_filter_bias.h:13
float accel_0
b_f[0]
Definition: mavlink_msg_nav_filter_bias.h:8
uint16_t elevator[3]
Elevator setpoints: nose down, center, nose up.
Definition: mavlink_msg_radio_calibration.h:8
uint16_t aileron[3]
Aileron setpoints: left, center, right.
Definition: mavlink_msg_radio_calibration.h:7
uint64_t usec
Timestamp (microseconds)
Definition: mavlink_msg_nav_filter_bias.h:7
#define MAVLINK_ASSERT(x)
Definition: protocol.h:26
uint16_t rudder[3]
Rudder setpoints: nose left, center, nose right.
Definition: mavlink_msg_radio_calibration.h:9
#define MAVLINK_MAX_PACKET_LEN
Maximum packet length.
Definition: mavlink_types.h:33
Definition: mavlink_msg_ualberta_sys_status.h:5
uint8_t nav_mode
Navigation mode, see UALBERTA_NAV_MODE ENUM.
Definition: mavlink_msg_ualberta_sys_status.h:8
uint16_t throttle[5]
Throttle curve setpoints (every 25%)
Definition: mavlink_msg_radio_calibration.h:12
MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg)
Pack a message to send it over a serial byte stream.
Definition: mavlink_helpers.h:174
Definition: mavlink_msg_radio_calibration.h:5
float gyro_0
b_f[0]
Definition: mavlink_msg_nav_filter_bias.h:11
float gyro_1
b_f[1]
Definition: mavlink_msg_nav_filter_bias.h:12
uint16_t gyro[2]
Tail gyro mode/gain setpoints: heading hold, rate mode.
Definition: mavlink_msg_radio_calibration.h:10
float accel_1
b_f[1]
Definition: mavlink_msg_nav_filter_bias.h:9