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

AP_DDS: Status Message #28337

Merged
merged 1 commit into from
Nov 12, 2024
Merged

Conversation

tizianofiorenzani
Copy link
Contributor

@tizianofiorenzani tizianofiorenzani commented Oct 7, 2024

Test

  • Launch the SITL.
  • Open a new terminal and echo the new topic.
  • Verify that only one message is published.
  • Now change the vehicle's mode and verify that a new message has been published.
  • Arm and takeoff, verify that a new message has been published only when armed flag changes.

Test a failsafe:

  • Change the parameter BATT_LOW_VOLT to 11.0
  • Set the parameter SIM_BATT_VOLTAGE to 10.6.
  • Verify that the status topics reports a failsafe of type 22
  • Disable the RC setting SIM_RC_FAIL to 1.
  • Verify that the failsafe array now reports 22 and 21

image

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Oct 8, 2024

Clean commits before merge.

libraries/AP_DDS/AP_DDS_Client.cpp Outdated Show resolved Hide resolved
libraries/AP_DDS/AP_DDS_Client.cpp Outdated Show resolved Hide resolved
libraries/AP_DDS/AP_DDS_Client.cpp Outdated Show resolved Hide resolved
@tizianofiorenzani
Copy link
Contributor Author

tizianofiorenzani commented Oct 8, 2024

I applied all the suggestions and tested in SITL/Plane again. Here is when a Low battery and RC failsafe has been triggered:

image

bool flying # True if flying/driving/diving/tracking.
bool external_control # True is external control is enabled.

uint8 FS_RADIO = 21
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's supposed to match something, mind adding a comment?

@tridge tridge merged commit 601d9ef into ArduPilot:master Nov 12, 2024
99 checks passed
msg.external_control = true; // Always true for now. To be filled after PR#28429.
uint8_t fs_iter = 0;
msg.failsafe_size = 0;
if (AP_Notify::flags.failsafe_radio) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add another comment that "TODO move from AP_Notify to vehicle functions"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

virtual bool in_rc_failsafe() const { return true; }

Copy link
Collaborator

@Ryanf55 Ryanf55 Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the radio failsafe using this call to RC_Channel rather than AP_Notify:

virtual bool in_rc_failsafe() const { return true; };

The devs do not want us using notify unless there is no other option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants