Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop queuing ap_message ids which can't be sent #25540

Merged
merged 43 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3642e0d
GCS_MAVLink: tidy sending of queued mount messages
peterbarker Oct 27, 2023
a4f46b7
ArduCopter: tidy sending of queued mount messages
peterbarker Oct 27, 2023
632ef01
ArduPlane: tidy sending of queued mount messages
peterbarker Oct 27, 2023
3377d75
ArduSub: tidy sending of queued mount messages
peterbarker Oct 27, 2023
b182bef
Blimp: tidy sending of queued mount messages
peterbarker Oct 27, 2023
0b5627e
Rover: tidy sending of queued mount messages
peterbarker Oct 27, 2023
80efa36
GCS_MAVLink: tidy sending of queued opticalflow messages
peterbarker Oct 27, 2023
0b6f793
ArduCopter: tidy sending of queued opticalflow messages
peterbarker Oct 27, 2023
ecaceb8
ArduPlane: tidy sending of queued opticalflow messages
peterbarker Oct 27, 2023
07284b9
ArduSub: tidy sending of queued opticalflow messages
peterbarker Oct 27, 2023
8d742f9
Blimp: tidy sending of queued opticalflow messages
peterbarker Oct 27, 2023
b8536dd
Rover: tidy sending of queued opticalflow messages
peterbarker Oct 27, 2023
1c0bc93
GCS_MAVLink: tidy sending of queued mcu status messages
peterbarker Oct 27, 2023
2633697
AntennaTracker: tidy sending of queued mcu status messages
peterbarker Oct 27, 2023
21a58ec
ArduCopter: tidy sending of queued mcu status messages
peterbarker Oct 27, 2023
5aad25a
ArduPlane: tidy sending of queued mcu status messages
peterbarker Oct 27, 2023
510498a
ArduSub: tidy sending of queued mcu status messages
peterbarker Oct 27, 2023
92186d1
Blimp: tidy sending of queued mcu status messages
peterbarker Oct 27, 2023
cf83dbc
Rover: tidy sending of queued mcu status messages
peterbarker Oct 27, 2023
5e533b0
GCS_MAVLink: tidy sending of queued SIM messages
peterbarker Oct 27, 2023
5ee7cb8
GCS_MAVLink: tidy sending of queued generator messages
peterbarker Oct 27, 2023
ca5e536
ArduCopter: tidy sending of queued generator messages
peterbarker Oct 27, 2023
38a4648
Blimp: tidy sending of queued generator messages
peterbarker Oct 27, 2023
f92bcd3
GCS_MAVLink: tidy sending of esc telem generator messages
peterbarker Oct 27, 2023
3299dc7
ArduCopter: tidy sending of esc telem generator messages
peterbarker Oct 27, 2023
29d87ff
ArduPlane: tidy sending of esc telem generator messages
peterbarker Oct 27, 2023
c63965c
ArduSub: tidy sending of esc telem generator messages
peterbarker Oct 27, 2023
098b307
Blimp: tidy sending of esc telem generator messages
peterbarker Oct 27, 2023
a168243
Rover: tidy sending of esc telem generator messages
peterbarker Oct 27, 2023
ec157cb
GCS_MAVLink: tidy sending of efi messages
peterbarker Oct 27, 2023
bfb974c
GCS_MAVLink: tidy sending of winch messages
peterbarker Oct 27, 2023
2160aab
ArduCopter: tidy sending of winch messages
peterbarker Oct 27, 2023
bd17d88
GCS_MAVLink: tidy sending of WATER_DEPTH messages
peterbarker Oct 27, 2023
05fc31d
Rover: tidy sending of WATER_DEPTH messages
peterbarker Oct 27, 2023
04f75ae
GCS_MAVLink: tidy sending of HIGH_LATENCY2 messages
peterbarker Oct 27, 2023
627ed60
GCS_MAVLink: tidy sending of ADSB messages
peterbarker Oct 27, 2023
63aede3
GCS_Common: remove mappings for non-supported messages
peterbarker Oct 27, 2023
2fc7f88
AntennaTracker: stop streaming trying SIM_STATE messages outside sim
peterbarker Nov 19, 2023
0f9d724
ArduCopter: stop streaming trying SIM_STATE messages outside sim
peterbarker Nov 19, 2023
dd2adbd
ArduPlane: stop streaming trying SIM_STATE messages outside sim
peterbarker Nov 19, 2023
a1fe773
ArduSub: stop streaming trying SIM_STATE messages outside sim
peterbarker Nov 19, 2023
7341d99
Blimp: stop streaming trying SIM_STATE messages outside sim
peterbarker Nov 19, 2023
b73c7d9
Rover: stop streaming trying SIM_STATE messages outside sim
peterbarker Nov 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AntennaTracker/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ static const ap_message STREAM_RAW_SENSORS_msgs[] = {
static const ap_message STREAM_EXTENDED_STATUS_msgs[] = {
MSG_SYS_STATUS,
MSG_POWER_STATUS,
#if HAL_WITH_MCU_MONITORING
MSG_MCU_STATUS,
#endif
MSG_MEMINFO,
MSG_NAV_CONTROLLER_OUTPUT,
MSG_GPS_RAW,
Expand All @@ -301,7 +303,9 @@ static const ap_message STREAM_EXTRA1_msgs[] = {
};
static const ap_message STREAM_EXTRA3_msgs[] = {
MSG_AHRS,
#if AP_SIM_ENABLED
MSG_SIMSTATE,
#endif
MSG_SYSTEM_TIME,
MSG_AHRS2,
#if COMPASS_CAL_ENABLED
Expand Down
16 changes: 14 additions & 2 deletions ArduCopter/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,17 @@ void GCS_MAVLINK_Copter::send_pid_tuning()
}
}

#if AP_WINCH_ENABLED
// send winch status message
void GCS_MAVLINK_Copter::send_winch_status() const
{
#if AP_WINCH_ENABLED
AP_Winch *winch = AP::winch();
if (winch == nullptr) {
return;
}
winch->send_status(*this);
#endif
}
#endif

uint8_t GCS_MAVLINK_Copter::sysid_my_gcs() const
{
Expand Down Expand Up @@ -503,7 +503,9 @@ static const ap_message STREAM_RAW_SENSORS_msgs[] = {
static const ap_message STREAM_EXTENDED_STATUS_msgs[] = {
MSG_SYS_STATUS,
MSG_POWER_STATUS,
#if HAL_WITH_MCU_MONITORING
MSG_MCU_STATUS,
#endif
MSG_MEMINFO,
MSG_CURRENT_WAYPOINT, // MISSION_CURRENT
MSG_GPS_RAW,
Expand All @@ -529,7 +531,9 @@ static const ap_message STREAM_RC_CHANNELS_msgs[] = {
};
static const ap_message STREAM_EXTRA1_msgs[] = {
MSG_ATTITUDE,
#if AP_SIM_ENABLED
MSG_SIMSTATE,
#endif
MSG_AHRS2,
MSG_PID_TUNING // Up to four PID_TUNING messages are sent, depending on GCS_PID_MASK parameter
};
Expand All @@ -548,8 +552,12 @@ static const ap_message STREAM_EXTRA3_msgs[] = {
#if AP_BATTERY_ENABLED
MSG_BATTERY_STATUS,
#endif
#if HAL_MOUNT_ENABLED
MSG_GIMBAL_DEVICE_ATTITUDE_STATUS,
#endif
#if AP_OPTICALFLOW_ENABLED
MSG_OPTICAL_FLOW,
#endif
#if COMPASS_CAL_ENABLED
MSG_MAG_CAL_REPORT,
MSG_MAG_CAL_PROGRESS,
Expand All @@ -559,8 +567,12 @@ static const ap_message STREAM_EXTRA3_msgs[] = {
#if AP_RPM_ENABLED
MSG_RPM,
#endif
#if HAL_WITH_ESC_TELEM
MSG_ESC_TELEMETRY,
#endif
#if HAL_GENERATOR_ENABLED
MSG_GENERATOR_STATUS,
#endif
MSG_WINCH_STATUS,
#if HAL_EFI_ENABLED
MSG_EFI_STATUS,
Expand Down
2 changes: 2 additions & 0 deletions ArduCopter/GCS_Mavlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class GCS_MAVLINK_Copter : public GCS_MAVLINK

void send_pid_tuning() override;

#if AP_WINCH_ENABLED
void send_winch_status() const override;
#endif

void send_wind() const;

Expand Down
10 changes: 10 additions & 0 deletions ArduPlane/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,9 @@ static const ap_message STREAM_RAW_SENSORS_msgs[] = {
static const ap_message STREAM_EXTENDED_STATUS_msgs[] = {
MSG_SYS_STATUS,
MSG_POWER_STATUS,
#if HAL_WITH_MCU_MONITORING
MSG_MCU_STATUS,
#endif
MSG_MEMINFO,
MSG_CURRENT_WAYPOINT,
MSG_GPS_RAW,
Expand Down Expand Up @@ -647,15 +649,19 @@ static const ap_message STREAM_RC_CHANNELS_msgs[] = {
};
static const ap_message STREAM_EXTRA1_msgs[] = {
MSG_ATTITUDE,
#if AP_SIM_ENABLED
MSG_SIMSTATE,
#endif
MSG_AHRS2,
#if AP_RPM_ENABLED
MSG_RPM,
#endif
MSG_AOA_SSA,
MSG_PID_TUNING,
MSG_LANDING,
#if HAL_WITH_ESC_TELEM
MSG_ESC_TELEMETRY,
#endif
#if HAL_EFI_ENABLED
MSG_EFI_STATUS,
#endif
Expand All @@ -678,8 +684,12 @@ static const ap_message STREAM_EXTRA3_msgs[] = {
#if AP_BATTERY_ENABLED
MSG_BATTERY_STATUS,
#endif
#if HAL_MOUNT_ENABLED
MSG_GIMBAL_DEVICE_ATTITUDE_STATUS,
#endif
#if AP_OPTICALFLOW_ENABLED
MSG_OPTICAL_FLOW,
#endif
#if COMPASS_CAL_ENABLED
MSG_MAG_CAL_REPORT,
MSG_MAG_CAL_PROGRESS,
Expand Down
10 changes: 10 additions & 0 deletions ArduSub/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ static const ap_message STREAM_RAW_SENSORS_msgs[] = {
static const ap_message STREAM_EXTENDED_STATUS_msgs[] = {
MSG_SYS_STATUS,
MSG_POWER_STATUS,
#if HAL_WITH_MCU_MONITORING
MSG_MCU_STATUS,
#endif
MSG_MEMINFO,
MSG_CURRENT_WAYPOINT,
MSG_GPS_RAW,
Expand All @@ -372,7 +374,9 @@ static const ap_message STREAM_RC_CHANNELS_msgs[] = {
};
static const ap_message STREAM_EXTRA1_msgs[] = {
MSG_ATTITUDE,
#if AP_SIM_ENABLED
MSG_SIMSTATE,
#endif
MSG_AHRS2,
MSG_PID_TUNING
};
Expand All @@ -390,8 +394,12 @@ static const ap_message STREAM_EXTRA3_msgs[] = {
#if AP_BATTERY_ENABLED
MSG_BATTERY_STATUS,
#endif
#if HAL_MOUNT_ENABLED
MSG_GIMBAL_DEVICE_ATTITUDE_STATUS,
#endif
#if AP_OPTICALFLOW_ENABLED
MSG_OPTICAL_FLOW,
#endif
#if COMPASS_CAL_ENABLED
MSG_MAG_CAL_REPORT,
MSG_MAG_CAL_PROGRESS,
Expand All @@ -401,7 +409,9 @@ static const ap_message STREAM_EXTRA3_msgs[] = {
#if AP_RPM_ENABLED
MSG_RPM,
#endif
#if HAL_WITH_ESC_TELEM
MSG_ESC_TELEMETRY,
#endif
};
static const ap_message STREAM_PARAMS_msgs[] = {
MSG_NEXT_PARAM
Expand Down
13 changes: 13 additions & 0 deletions Blimp/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "GCS_Mavlink.h"
#include <AP_RPM/AP_RPM_config.h>
#include <AP_OpticalFlow/AP_OpticalFlow_config.h>

MAV_TYPE GCS_Blimp::frame_type() const
{
Expand Down Expand Up @@ -315,7 +316,9 @@ static const ap_message STREAM_RAW_SENSORS_msgs[] = {
static const ap_message STREAM_EXTENDED_STATUS_msgs[] = {
MSG_SYS_STATUS,
MSG_POWER_STATUS,
#if HAL_WITH_MCU_MONITORING
MSG_MCU_STATUS,
#endif
MSG_MEMINFO,
MSG_CURRENT_WAYPOINT, // MISSION_CURRENT
MSG_GPS_RAW,
Expand All @@ -341,7 +344,9 @@ static const ap_message STREAM_RC_CHANNELS_msgs[] = {
};
static const ap_message STREAM_EXTRA1_msgs[] = {
MSG_ATTITUDE,
#if AP_SIM_ENABLED
MSG_SIMSTATE,
#endif
MSG_AHRS2,
MSG_PID_TUNING // Up to four PID_TUNING messages are sent, depending on GCS_PID_MASK parameter
};
Expand All @@ -357,8 +362,12 @@ static const ap_message STREAM_EXTRA3_msgs[] = {
#if AP_BATTERY_ENABLED
MSG_BATTERY_STATUS,
#endif
#if HAL_MOUNT_ENABLED
MSG_GIMBAL_DEVICE_ATTITUDE_STATUS,
#endif
#if AP_OPTICALFLOW_ENABLED
MSG_OPTICAL_FLOW,
#endif
#if COMPASS_CAL_ENABLED
MSG_MAG_CAL_REPORT,
MSG_MAG_CAL_PROGRESS,
Expand All @@ -368,8 +377,12 @@ static const ap_message STREAM_EXTRA3_msgs[] = {
#if AP_RPM_ENABLED
MSG_RPM,
#endif
#if HAL_WITH_ESC_TELEM
MSG_ESC_TELEMETRY,
#endif
#if HAL_GENERATOR_ENABLED
MSG_GENERATOR_STATUS,
#endif
};
static const ap_message STREAM_PARAMS_msgs[] = {
MSG_NEXT_PARAM
Expand Down
10 changes: 10 additions & 0 deletions Rover/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,9 @@ static const ap_message STREAM_RAW_SENSORS_msgs[] = {
static const ap_message STREAM_EXTENDED_STATUS_msgs[] = {
MSG_SYS_STATUS,
MSG_POWER_STATUS,
#if HAL_WITH_MCU_MONITORING
MSG_MCU_STATUS,
#endif
MSG_MEMINFO,
MSG_CURRENT_WAYPOINT,
MSG_GPS_RAW,
Expand Down Expand Up @@ -554,7 +556,9 @@ static const ap_message STREAM_RC_CHANNELS_msgs[] = {
};
static const ap_message STREAM_EXTRA1_msgs[] = {
MSG_ATTITUDE,
#if AP_SIM_ENABLED
MSG_SIMSTATE,
#endif
MSG_AHRS2,
MSG_PID_TUNING,
};
Expand All @@ -570,8 +574,12 @@ static const ap_message STREAM_EXTRA3_msgs[] = {
#if AP_BATTERY_ENABLED
MSG_BATTERY_STATUS,
#endif
#if HAL_MOUNT_ENABLED
MSG_GIMBAL_DEVICE_ATTITUDE_STATUS,
#endif
#if AP_OPTICALFLOW_ENABLED
MSG_OPTICAL_FLOW,
#endif
#if COMPASS_CAL_ENABLED
MSG_MAG_CAL_REPORT,
MSG_MAG_CAL_PROGRESS,
Expand All @@ -582,7 +590,9 @@ static const ap_message STREAM_EXTRA3_msgs[] = {
MSG_RPM,
#endif
MSG_WHEEL_DISTANCE,
#if HAL_WITH_ESC_TELEM
MSG_ESC_TELEMETRY,
#endif
#if HAL_EFI_ENABLED
MSG_EFI_STATUS,
#endif
Expand Down
2 changes: 2 additions & 0 deletions Rover/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ void Rover::Log_Write_Depth()
(double)(s->distance()),
temp_C);
}
#if AP_RANGEFINDER_ENABLED
// send water depth and temp to ground station
gcs().send_message(MSG_WATER_DEPTH);
#endif
}

// guided mode logging
Expand Down
5 changes: 5 additions & 0 deletions libraries/GCS_MAVLink/GCS.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <AP_Mount/AP_Mount_config.h>
#include <AP_SerialManager/AP_SerialManager.h>
#include <AP_RangeFinder/AP_RangeFinder_config.h>
#include <AP_Winch/AP_Winch_config.h>

#include "ap_message.h"

Expand Down Expand Up @@ -385,7 +386,9 @@ class GCS_MAVLINK
void send_set_position_target_global_int(uint8_t target_system, uint8_t target_component, const Location& loc);
void send_rpm() const;
void send_generator_status() const;
#if AP_WINCH_ENABLED
virtual void send_winch_status() const {};
#endif
void send_water_depth() const;
int8_t battery_remaining_pct(const uint8_t instance) const;

Expand Down Expand Up @@ -811,7 +814,9 @@ class GCS_MAVLINK
} deferred_message[3] = {
{ MSG_HEARTBEAT, },
{ MSG_NEXT_PARAM, },
#if HAL_HIGH_LATENCY2_ENABLED
{ MSG_HIGH_LATENCY2, },
#endif
};
// returns index of id in deferred_message[] or -1 if not present
int8_t get_deferred_message_index(const ap_message id) const;
Expand Down
Loading