mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 11:03:34 +08:00
MAVLink app: Fix usage of static struct, make streams list const
This commit is contained in:
@@ -2231,7 +2231,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
StreamListItem *streams_list[] = {
|
const StreamListItem *streams_list[] = {
|
||||||
new StreamListItem(&MavlinkStreamHeartbeat::new_instance, &MavlinkStreamHeartbeat::get_name_static),
|
new StreamListItem(&MavlinkStreamHeartbeat::new_instance, &MavlinkStreamHeartbeat::get_name_static),
|
||||||
new StreamListItem(&MavlinkStreamStatustext::new_instance, &MavlinkStreamStatustext::get_name_static),
|
new StreamListItem(&MavlinkStreamStatustext::new_instance, &MavlinkStreamStatustext::get_name_static),
|
||||||
new StreamListItem(&MavlinkStreamCommandLong::new_instance, &MavlinkStreamCommandLong::get_name_static),
|
new StreamListItem(&MavlinkStreamCommandLong::new_instance, &MavlinkStreamCommandLong::get_name_static),
|
||||||
|
|||||||
@@ -56,6 +56,6 @@ public:
|
|||||||
~StreamListItem() {};
|
~StreamListItem() {};
|
||||||
};
|
};
|
||||||
|
|
||||||
extern StreamListItem *streams_list[];
|
extern const StreamListItem *streams_list[];
|
||||||
|
|
||||||
#endif /* MAVLINK_MESSAGES_H_ */
|
#endif /* MAVLINK_MESSAGES_H_ */
|
||||||
|
|||||||
@@ -822,7 +822,7 @@ MavlinkReceiver::handle_message_set_attitude_target(mavlink_message_t *msg)
|
|||||||
|
|
||||||
/* Publish attitude setpoint if attitude and thrust ignore bits are not set */
|
/* Publish attitude setpoint if attitude and thrust ignore bits are not set */
|
||||||
if (!(_offboard_control_mode.ignore_attitude)) {
|
if (!(_offboard_control_mode.ignore_attitude)) {
|
||||||
static struct vehicle_attitude_setpoint_s att_sp = {};
|
struct vehicle_attitude_setpoint_s att_sp = {};
|
||||||
att_sp.timestamp = hrt_absolute_time();
|
att_sp.timestamp = hrt_absolute_time();
|
||||||
mavlink_quaternion_to_euler(set_attitude_target.q,
|
mavlink_quaternion_to_euler(set_attitude_target.q,
|
||||||
&att_sp.roll_body, &att_sp.pitch_body, &att_sp.yaw_body);
|
&att_sp.roll_body, &att_sp.pitch_body, &att_sp.yaw_body);
|
||||||
|
|||||||
Reference in New Issue
Block a user