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

RC Connected Status Indicator Fix #18

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class Telemetry : public PluginBase {
struct VehicleStatus {
bool manual_control_signal_loss{false}; /**< @brief True if manual control signal is loss */
uint32_t mavlink_count{0}; /**< @brief Number of Mavlink connections providing setpoints (implying joystick connected). Should be < 2.*/
bool rc_signal_loss{false}; /**< @brief True if RC signal is loss */
uint32_t rc_count{0}; /**< @brief Number of RC connections providing setpoints (implying joystick connected). Should be < 2.*/
uint32_t sees_desired_control_source{0}; /**< @brief Desired type of manual control source, RC (1) or Mav (2) */
};

Expand Down
4 changes: 2 additions & 2 deletions src/mavsdk/plugins/telemetry/telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ bool operator==(const Telemetry::VehicleStatus& lhs, const Telemetry::VehicleSta
{
return (rhs.manual_control_signal_loss == lhs.manual_control_signal_loss) &&
(rhs.mavlink_count == lhs.mavlink_count) &&
(rhs.rc_signal_loss == lhs.rc_signal_loss) &&
(rhs.rc_count == lhs.rc_count) &&
(rhs.sees_desired_control_source == lhs.sees_desired_control_source);
}

Expand All @@ -991,7 +991,7 @@ std::ostream& operator<<(std::ostream& str, Telemetry::VehicleStatus const& vehi
str << "vehicle_status:" << '\n' << "{\n";
str << " manual_control_signal_loss: " << vehicle_status.manual_control_signal_loss << '\n';
str << " mavlink_count: " << vehicle_status.mavlink_count << '\n';
str << " rc_signal_loss: " << vehicle_status.rc_signal_loss << '\n';
str << " rc_count: " << vehicle_status.rc_count << '\n';
str << " sees_desired_control_source: " << vehicle_status.sees_desired_control_source << '\n';
str << '}';
return str;
Expand Down
2 changes: 1 addition & 1 deletion src/mavsdk/plugins/telemetry/telemetry_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ void TelemetryImpl::process_sys_status(const mavlink_message_t& message)
Telemetry::VehicleStatus new_vehicle_status;
new_vehicle_status.manual_control_signal_loss = sys_status.errors_count1; // No manual control setpoint messages arriving from the desired source
new_vehicle_status.mavlink_count = sys_status.errors_count2; // Number of (live) Mavlink Joysticks connected
new_vehicle_status.rc_signal_loss = sys_status.errors_count3; // No messages from RC TX received
new_vehicle_status.rc_count = sys_status.errors_count3; // Number of (live) RC Controllers connected
new_vehicle_status.sees_desired_control_source = sys_status.errors_count4; // Indicates desired manual control source, RC (1) or MAVLink (2)

set_vehicle_status(new_vehicle_status);
Expand Down
Loading