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: Service to check if vehicle is armable #28401

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

tizianofiorenzani
Copy link
Contributor

@tizianofiorenzani tizianofiorenzani commented Oct 14, 2024

Issue

Closes #28286

What Changed

Response:

  • success (true if armable)
  • message: a string message (Vehicle is armable or Vehicle is NOT armable).

Test

Run the SITL and then use the DDS test to verify that vehicle is armable:

colcon build --packages-up-to ardupilot_dds_tests 
source install/setup.bash
ros2 run ardupilot_dds_tests pre_arm_check

Or call the service manually:

ros2 service list

/ap/arm_motors
/ap/mode_switch
/ap/prearm_check

ros2 service call /ap/prearm_check std_srvs/srv/Trigger 
requester: making request: std_srvs.srv.Trigger_Request()

response:
std_srvs.srv.Trigger_Response(success=True, message='Vehicle is Armable')

@tizianofiorenzani tizianofiorenzani marked this pull request as draft October 14, 2024 16:54
@tizianofiorenzani
Copy link
Contributor Author

@Ryanf55 I have trouble getting the services working with the pytest fixture. I have added a runtime test that can be run with

ros2 run ardupilot_dds_tests pre_arm_check

@tizianofiorenzani tizianofiorenzani force-pushed the wips/dds-is-armable branch 2 times, most recently from 91ad75c to b69f09c Compare October 15, 2024 15:54
@tizianofiorenzani tizianofiorenzani marked this pull request as ready for review October 15, 2024 15:55
@tizianofiorenzani tizianofiorenzani force-pushed the wips/dds-is-armable branch 3 times, most recently from 4045955 to 1f865e4 Compare October 18, 2024 18:42
@tizianofiorenzani tizianofiorenzani force-pushed the wips/dds-is-armable branch 3 times, most recently from b7d445a to 942cf23 Compare November 5, 2024 01:02
@Ryanf55
Copy link
Collaborator

Ryanf55 commented Nov 18, 2024

@Ryanf55 I have trouble getting the services working with the pytest fixture. I have added a runtime test that can be run with

ros2 run ardupilot_dds_tests pre_arm_check

Is this resolved or still an issue? Seems like CI is happy.

@tizianofiorenzani
Copy link
Contributor Author

It seems to be working and passing CI as well.

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Nov 18, 2024

For dev call: Can we merge as-is with strcpy (which we know is safe from the tests, and is already used in DDS), and handle strncpy conversion in a follow up?

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Nov 18, 2024

For dev call: Can we merge as-is with strcpy (which we know is safe from the tests, and is already used in DDS), and handle strncpy conversion in a follow up?

A: Yes, switch all to strcpy. We can use a macro if we need.

@Ryanf55 Ryanf55 requested a review from peterbarker November 19, 2024 19:55
@tizianofiorenzani
Copy link
Contributor Author

rebased, cleaned and pushed again.

@peterbarker peterbarker merged commit dff0f6f into ArduPilot:master Nov 21, 2024
99 checks passed
@rmackay9
Copy link
Contributor

this is included in ArduPilot-4.6.0-beta3 at @Ryanf55's request

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

Successfully merging this pull request may close these issues.

AP_DDS - Prearm - Is Vehicle Armable DDS Interface
5 participants