Skip to content

Commit 66234e7

Browse files
committed
fix bugs detected by copilot
1 parent 02dd553 commit 66234e7

File tree

10 files changed

+86
-104
lines changed

10 files changed

+86
-104
lines changed

comms/mavlink/rosflight.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ See the generating_v1.0_instructions.txt to regenerate mavlink headers based off
210210
<message id="180" name="OFFBOARD_CONTROL">
211211
<description>Offboard Control (10-DOF)</description>
212212
<field type="uint8_t" name="mode" enum="OFFBOARD_CONTROL_MODE">Offboard control mode, see OFFBOARD_CONTROL_MODE</field>
213-
<field type="uint8_t" name="ignore" enum="OFFBOARD_CONTROL_IGNORE">Bitfield specifying which fields should be ignored, see OFFBOARD_CONTROL_IGNORE</field>
213+
<field type="uint16_t" name="ignore" enum="OFFBOARD_CONTROL_IGNORE">Bitfield specifying which fields should be ignored, see OFFBOARD_CONTROL_IGNORE</field>
214214
<field type="float[10]" name="u">u control channel interpreted according to mode</field>
215215
</message>
216216
<message id="181" name="SMALL_IMU">

comms/mavlink/v1.0/rosflight/mavlink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef MAVLINK_H
77
#define MAVLINK_H
88

9-
#define MAVLINK_PRIMARY_XML_HASH 4604780551857209085
9+
#define MAVLINK_PRIMARY_XML_HASH 2561919675776321086
1010

1111
#ifndef MAVLINK_STX
1212
#define MAVLINK_STX 254

comms/mavlink/v1.0/rosflight/mavlink_msg_offboard_control.h

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
typedef struct __mavlink_offboard_control_t {
88
float u[10]; /*< u control channel interpreted according to mode*/
9+
uint16_t ignore; /*< Bitfield specifying which fields should be ignored, see OFFBOARD_CONTROL_IGNORE*/
910
uint8_t mode; /*< Offboard control mode, see OFFBOARD_CONTROL_MODE*/
10-
uint8_t ignore; /*< Bitfield specifying which fields should be ignored, see OFFBOARD_CONTROL_IGNORE*/
1111
} mavlink_offboard_control_t;
1212

13-
#define MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN 42
14-
#define MAVLINK_MSG_ID_OFFBOARD_CONTROL_MIN_LEN 42
15-
#define MAVLINK_MSG_ID_180_LEN 42
16-
#define MAVLINK_MSG_ID_180_MIN_LEN 42
13+
#define MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN 43
14+
#define MAVLINK_MSG_ID_OFFBOARD_CONTROL_MIN_LEN 43
15+
#define MAVLINK_MSG_ID_180_LEN 43
16+
#define MAVLINK_MSG_ID_180_MIN_LEN 43
1717

18-
#define MAVLINK_MSG_ID_OFFBOARD_CONTROL_CRC 209
19-
#define MAVLINK_MSG_ID_180_CRC 209
18+
#define MAVLINK_MSG_ID_OFFBOARD_CONTROL_CRC 90
19+
#define MAVLINK_MSG_ID_180_CRC 90
2020

2121
#define MAVLINK_MSG_OFFBOARD_CONTROL_FIELD_U_LEN 10
2222

@@ -25,17 +25,17 @@ typedef struct __mavlink_offboard_control_t {
2525
180, \
2626
"OFFBOARD_CONTROL", \
2727
3, \
28-
{ { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_offboard_control_t, mode) }, \
29-
{ "ignore", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_offboard_control_t, ignore) }, \
28+
{ { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_offboard_control_t, mode) }, \
29+
{ "ignore", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_offboard_control_t, ignore) }, \
3030
{ "u", NULL, MAVLINK_TYPE_FLOAT, 10, 0, offsetof(mavlink_offboard_control_t, u) }, \
3131
} \
3232
}
3333
#else
3434
#define MAVLINK_MESSAGE_INFO_OFFBOARD_CONTROL { \
3535
"OFFBOARD_CONTROL", \
3636
3, \
37-
{ { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_offboard_control_t, mode) }, \
38-
{ "ignore", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_offboard_control_t, ignore) }, \
37+
{ { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_offboard_control_t, mode) }, \
38+
{ "ignore", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_offboard_control_t, ignore) }, \
3939
{ "u", NULL, MAVLINK_TYPE_FLOAT, 10, 0, offsetof(mavlink_offboard_control_t, u) }, \
4040
} \
4141
}
@@ -53,18 +53,18 @@ typedef struct __mavlink_offboard_control_t {
5353
* @return length of the message in bytes (excluding serial stream start sign)
5454
*/
5555
static inline uint16_t mavlink_msg_offboard_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
56-
uint8_t mode, uint8_t ignore, const float *u)
56+
uint8_t mode, uint16_t ignore, const float *u)
5757
{
5858
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
5959
char buf[MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN];
60-
_mav_put_uint8_t(buf, 40, mode);
61-
_mav_put_uint8_t(buf, 41, ignore);
60+
_mav_put_uint16_t(buf, 40, ignore);
61+
_mav_put_uint8_t(buf, 42, mode);
6262
_mav_put_float_array(buf, 0, u, 10);
6363
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN);
6464
#else
6565
mavlink_offboard_control_t packet;
66-
packet.mode = mode;
6766
packet.ignore = ignore;
67+
packet.mode = mode;
6868
mav_array_memcpy(packet.u, u, sizeof(float)*10);
6969
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN);
7070
#endif
@@ -86,18 +86,18 @@ static inline uint16_t mavlink_msg_offboard_control_pack(uint8_t system_id, uint
8686
* @return length of the message in bytes (excluding serial stream start sign)
8787
*/
8888
static inline uint16_t mavlink_msg_offboard_control_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
89-
uint8_t mode, uint8_t ignore, const float *u)
89+
uint8_t mode, uint16_t ignore, const float *u)
9090
{
9191
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
9292
char buf[MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN];
93-
_mav_put_uint8_t(buf, 40, mode);
94-
_mav_put_uint8_t(buf, 41, ignore);
93+
_mav_put_uint16_t(buf, 40, ignore);
94+
_mav_put_uint8_t(buf, 42, mode);
9595
_mav_put_float_array(buf, 0, u, 10);
9696
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN);
9797
#else
9898
mavlink_offboard_control_t packet;
99-
packet.mode = mode;
10099
packet.ignore = ignore;
100+
packet.mode = mode;
101101
mav_array_memcpy(packet.u, u, sizeof(float)*10);
102102
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN);
103103
#endif
@@ -123,18 +123,18 @@ static inline uint16_t mavlink_msg_offboard_control_pack_status(uint8_t system_i
123123
*/
124124
static inline uint16_t mavlink_msg_offboard_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
125125
mavlink_message_t* msg,
126-
uint8_t mode,uint8_t ignore,const float *u)
126+
uint8_t mode,uint16_t ignore,const float *u)
127127
{
128128
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
129129
char buf[MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN];
130-
_mav_put_uint8_t(buf, 40, mode);
131-
_mav_put_uint8_t(buf, 41, ignore);
130+
_mav_put_uint16_t(buf, 40, ignore);
131+
_mav_put_uint8_t(buf, 42, mode);
132132
_mav_put_float_array(buf, 0, u, 10);
133133
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN);
134134
#else
135135
mavlink_offboard_control_t packet;
136-
packet.mode = mode;
137136
packet.ignore = ignore;
137+
packet.mode = mode;
138138
mav_array_memcpy(packet.u, u, sizeof(float)*10);
139139
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN);
140140
#endif
@@ -194,18 +194,18 @@ static inline uint16_t mavlink_msg_offboard_control_encode_status(uint8_t system
194194
*/
195195
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
196196

197-
static inline void mavlink_msg_offboard_control_send(mavlink_channel_t chan, uint8_t mode, uint8_t ignore, const float *u)
197+
static inline void mavlink_msg_offboard_control_send(mavlink_channel_t chan, uint8_t mode, uint16_t ignore, const float *u)
198198
{
199199
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
200200
char buf[MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN];
201-
_mav_put_uint8_t(buf, 40, mode);
202-
_mav_put_uint8_t(buf, 41, ignore);
201+
_mav_put_uint16_t(buf, 40, ignore);
202+
_mav_put_uint8_t(buf, 42, mode);
203203
_mav_put_float_array(buf, 0, u, 10);
204204
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OFFBOARD_CONTROL, buf, MAVLINK_MSG_ID_OFFBOARD_CONTROL_MIN_LEN, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN, MAVLINK_MSG_ID_OFFBOARD_CONTROL_CRC);
205205
#else
206206
mavlink_offboard_control_t packet;
207-
packet.mode = mode;
208207
packet.ignore = ignore;
208+
packet.mode = mode;
209209
mav_array_memcpy(packet.u, u, sizeof(float)*10);
210210
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OFFBOARD_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_OFFBOARD_CONTROL_MIN_LEN, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN, MAVLINK_MSG_ID_OFFBOARD_CONTROL_CRC);
211211
#endif
@@ -233,18 +233,18 @@ static inline void mavlink_msg_offboard_control_send_struct(mavlink_channel_t ch
233233
is usually the receive buffer for the channel, and allows a reply to an
234234
incoming message with minimum stack space usage.
235235
*/
236-
static inline void mavlink_msg_offboard_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t mode, uint8_t ignore, const float *u)
236+
static inline void mavlink_msg_offboard_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t mode, uint16_t ignore, const float *u)
237237
{
238238
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
239239
char *buf = (char *)msgbuf;
240-
_mav_put_uint8_t(buf, 40, mode);
241-
_mav_put_uint8_t(buf, 41, ignore);
240+
_mav_put_uint16_t(buf, 40, ignore);
241+
_mav_put_uint8_t(buf, 42, mode);
242242
_mav_put_float_array(buf, 0, u, 10);
243243
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OFFBOARD_CONTROL, buf, MAVLINK_MSG_ID_OFFBOARD_CONTROL_MIN_LEN, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN, MAVLINK_MSG_ID_OFFBOARD_CONTROL_CRC);
244244
#else
245245
mavlink_offboard_control_t *packet = (mavlink_offboard_control_t *)msgbuf;
246-
packet->mode = mode;
247246
packet->ignore = ignore;
247+
packet->mode = mode;
248248
mav_array_memcpy(packet->u, u, sizeof(float)*10);
249249
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OFFBOARD_CONTROL, (const char *)packet, MAVLINK_MSG_ID_OFFBOARD_CONTROL_MIN_LEN, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN, MAVLINK_MSG_ID_OFFBOARD_CONTROL_CRC);
250250
#endif
@@ -263,17 +263,17 @@ static inline void mavlink_msg_offboard_control_send_buf(mavlink_message_t *msgb
263263
*/
264264
static inline uint8_t mavlink_msg_offboard_control_get_mode(const mavlink_message_t* msg)
265265
{
266-
return _MAV_RETURN_uint8_t(msg, 40);
266+
return _MAV_RETURN_uint8_t(msg, 42);
267267
}
268268

269269
/**
270270
* @brief Get field ignore from offboard_control message
271271
*
272272
* @return Bitfield specifying which fields should be ignored, see OFFBOARD_CONTROL_IGNORE
273273
*/
274-
static inline uint8_t mavlink_msg_offboard_control_get_ignore(const mavlink_message_t* msg)
274+
static inline uint16_t mavlink_msg_offboard_control_get_ignore(const mavlink_message_t* msg)
275275
{
276-
return _MAV_RETURN_uint8_t(msg, 41);
276+
return _MAV_RETURN_uint16_t(msg, 40);
277277
}
278278

279279
/**
@@ -296,8 +296,8 @@ static inline void mavlink_msg_offboard_control_decode(const mavlink_message_t*
296296
{
297297
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
298298
mavlink_msg_offboard_control_get_u(msg, offboard_control->u);
299-
offboard_control->mode = mavlink_msg_offboard_control_get_mode(msg);
300299
offboard_control->ignore = mavlink_msg_offboard_control_get_ignore(msg);
300+
offboard_control->mode = mavlink_msg_offboard_control_get_mode(msg);
301301
#else
302302
uint8_t len = msg->len < MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN;
303303
memset(offboard_control, 0, MAVLINK_MSG_ID_OFFBOARD_CONTROL_LEN);

comms/mavlink/v1.0/rosflight/rosflight.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#error Wrong include order: MAVLINK_ROSFLIGHT.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call.
1111
#endif
1212

13-
#define MAVLINK_ROSFLIGHT_XML_HASH 4604780551857209085
13+
#define MAVLINK_ROSFLIGHT_XML_HASH 2561919675776321086
1414

1515
#ifdef __cplusplus
1616
extern "C" {
@@ -19,11 +19,11 @@ extern "C" {
1919
// MESSAGE LENGTHS AND CRCS
2020

2121
#ifndef MAVLINK_MESSAGE_L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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 0, 0}
2727
#endif
2828

2929
#include "../protocol.h"

comms/mavlink/v1.0/rosflight/testsuite.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ static void mavlink_test_offboard_control(uint8_t system_id, uint8_t component_i
3737
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3838
uint16_t i;
3939
mavlink_offboard_control_t packet_in = {
40-
{ 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0 },125,192
40+
{ 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0 },19315,3
4141
};
4242
mavlink_offboard_control_t packet1, packet2;
4343
memset(&packet1, 0, sizeof(packet1));
44-
packet1.mode = packet_in.mode;
4544
packet1.ignore = packet_in.ignore;
45+
packet1.mode = packet_in.mode;
4646

4747
mav_array_memcpy(packet1.u, packet_in.u, sizeof(float)*10);
4848

comms/mavlink/v1.0/rosflight/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef MAVLINK_VERSION_H
88
#define MAVLINK_VERSION_H
99

10-
#define MAVLINK_BUILD_DATE "Fri Jan 23 2026"
10+
#define MAVLINK_BUILD_DATE "Mon Jan 26 2026"
1111
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
1212
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 70
1313

include/command_manager.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,17 @@ class CommandManager : public ParamListenerInterface
102102
control_channel_t * combined;
103103
} mux_t;
104104

105-
mux_t muxes_[6] = {{&rc_command_.u[0], &offboard_command_.u[0], &combined_command_.u[0]},
105+
mux_t muxes_[10] = {
106+
{&rc_command_.u[0], &offboard_command_.u[0], &combined_command_.u[0]},
106107
{&rc_command_.u[1], &offboard_command_.u[1], &combined_command_.u[1]},
107108
{&rc_command_.u[2], &offboard_command_.u[2], &combined_command_.u[2]},
108109
{&rc_command_.u[3], &offboard_command_.u[3], &combined_command_.u[3]},
109110
{&rc_command_.u[4], &offboard_command_.u[4], &combined_command_.u[4]},
110-
{&rc_command_.u[5], &offboard_command_.u[5], &combined_command_.u[5]}};
111+
{&rc_command_.u[5], &offboard_command_.u[5], &combined_command_.u[5]},
112+
{&rc_command_.u[6], &offboard_command_.u[6], &combined_command_.u[6]},
113+
{&rc_command_.u[7], &offboard_command_.u[7], &combined_command_.u[7]},
114+
{&rc_command_.u[8], &offboard_command_.u[8], &combined_command_.u[8]},
115+
{&rc_command_.u[9], &offboard_command_.u[9], &combined_command_.u[9]}};
111116

112117
// clang-format off
113118
control_t rc_command_ = {0,

include/mixer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Mixer : public ParamListenerInterface
8989
{
9090
output_type_t (*output_type)[NUM_MIXER_OUTPUTS];
9191
float (*default_pwm_rate)[NUM_MIXER_OUTPUTS];
92-
float (*u[NUM_MIXER_OUTPUTS])[NUM_MIXER_OUTPUTS];
92+
float *u[NUM_MIXER_OUTPUTS];
9393
} mixer_selection_t;
9494

9595
typedef struct

src/command_manager.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ void CommandManager::do_muxing(uint16_t rc_override)
261261
for (uint8_t channel{0}; channel < NUM_MUX_CHANNELS; ++channel) {
262262
do_channel_muxing(static_cast<MuxChannel>(channel), rc_override);
263263
}
264+
for (uint8_t channel{NUM_MUX_CHANNELS}; channel < Mixer::NUM_MIXER_OUTPUTS; ++channel) {
265+
do_channel_muxing(static_cast<MuxChannel>(channel), 0);
266+
}
264267
}
265268

266269
void CommandManager::do_channel_muxing(MuxChannel channel, uint16_t rc_override )
@@ -313,12 +316,9 @@ bool CommandManager::run()
313316
if (RF_.board_.clock_millis()
314317
> offboard_command_.stamp_ms + RF_.params_.get_param_int(PARAM_OFFBOARD_TIMEOUT)) {
315318
// If it has been longer than 100 ms, then disable the offboard control
316-
offboard_command_.u[0].active = false;
317-
offboard_command_.u[1].active = false;
318-
offboard_command_.u[2].active = false;
319-
offboard_command_.u[3].active = false;
320-
offboard_command_.u[4].active = false;
321-
offboard_command_.u[5].active = false;
319+
for (int i=0; i<Mixer::NUM_MIXER_OUTPUTS; ++i) {
320+
offboard_command_.u[i].active = false;
321+
}
322322
}
323323

324324
// Perform muxing

0 commit comments

Comments
 (0)