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: use generated types for service serialisation #25148

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

srmainwaring
Copy link
Contributor

Use the generated types from ardupilot_msgs to de-serialise and serialise the requests and responses for the arm motors and mode switch services. This allows the generated serialisation code to handle byte alignment etc.

Testing

Run the iris runway world:

$ ros2 launch ardupilot_gz_bringup iris_runway.launch.py rviz:=true use_gz_tf:=true

Run MAVProxy:

$ mavproxy.py --master udp:127.0.0.1:14550  --console --moddebug 3

Switch mode to GUIDED (=4)

$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 4}"   
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=4)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=4)

Arm motors:

$ ros2 service call /ap/arm_motors ardupilot_msgs/srv/ArmMotors "{arm: true}"
requester: making request: ardupilot_msgs.srv.ArmMotors_Request(arm=True)

response:
ardupilot_msgs.srv.ArmMotors_Response(result=True)

@srmainwaring srmainwaring force-pushed the prs/pr-dds-use-srv-types branch from 8cb3396 to 6714279 Compare October 12, 2023 15:29
@tridge tridge merged commit fbdd4d6 into ArduPilot:master Oct 18, 2023
86 checks passed
@srmainwaring srmainwaring deleted the prs/pr-dds-use-srv-types branch October 19, 2023 20:10
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.

3 participants