-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: Parameters service #28298
base: master
Are you sure you want to change the base?
AP_DDS: Parameters service #28298
Conversation
I have tested with the Plane SITL, trying to ask for a wrong parameter. I mispelled
Instead, if you ask for the correct parameter I have:
Overall seems correct. I have tried to set and get multiple parameters, changed the airspeed in flight, made sure it was effective. |
The error gets reported as a GCS message. It should read I was thinking of populating the fields in the response message with bogus entries if that sounds like an acceptable error response? |
I think it's fair to just use the |
Overall, this is looking great. Do you know what additional services would be required to get this call to work?
Seems like maybe just a topic name, you are already using the right interface: Consider making the topic this: We could also just change the node name to If you did one of those, then we get this awesome ability to use the ROS 2 CLI like so! ryan@ryan-thinkpad:~$ ros2 node info /ap
/ap
Subscribers:
/ap/cmd_gps_pose: ardupilot_msgs/msg/GlobalPosition
/ap/cmd_vel: geometry_msgs/msg/TwistStamped
/ap/joy: sensor_msgs/msg/Joy
/ap/tf: tf2_msgs/msg/TFMessage
Publishers:
/ap/battery/battery0: sensor_msgs/msg/BatteryState
/ap/clock: rosgraph_msgs/msg/Clock
/ap/geopose/filtered: geographic_msgs/msg/GeoPoseStamped
/ap/gps_global_origin/filtered: geographic_msgs/msg/GeoPointStamped
/ap/imu/experimental/data: sensor_msgs/msg/Imu
/ap/navsat/navsat0: sensor_msgs/msg/NavSatFix
/ap/pose/filtered: geometry_msgs/msg/PoseStamped
/ap/tf_static: tf2_msgs/msg/TFMessage
/ap/time: builtin_interfaces/msg/Time
/ap/twist/filtered: geometry_msgs/msg/TwistStamped
Service Servers:
/ap/arm_motors: ardupilot_msgs/srv/ArmMotors
/ap/get_parameters: rcl_interfaces/srv/GetParameters
/ap/mode_switch: ardupilot_msgs/srv/ModeSwitch
/ap/set_parameters: rcl_interfaces/srv/SetParameters
Service Clients:
Action Servers:
Action Clients:
ryan@ryan-thinkpad:~$ ros2 param get ap LOIT_SPEED
Double value is: 1250.0 |
1106239
to
4ce5403
Compare
Needs a rebase on |
a136426
to
4ce5403
Compare
a1d28d0
to
2efb833
Compare
I resolved the suggested changes and rebased onto master. I used @Ryanf55 suggested change to get the ros2 cli to work with the parameter management, now it can also perform the following:
|
strncpy(param_key, (char *)get_parameters_request.names[i], AP_MAX_NAME_SIZE); | ||
param_key[AP_MAX_NAME_SIZE] = 0; | ||
|
||
vp = AP_Param::find(param_key, &var_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a callback in the IO thread because this could take a few mS on hardware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a followup PR for debug verbosity and precision of int32 vars would be nice
needs fix for stack frame size on build |
I can help reproduce this if you need. |
I've been able to reproduce it. The last commit I pushed brought the frame size down quite a bit. Just need to bring it down a little more. I tried changing this file with container_prealloc_size = 8 changed to 2 and it can build fine. I tried to build Durandal and pixracer with that change and it worked. I also tried running the dds tests and nothing failed, but I wasn't sure if this is an appropriate path to take. |
Please leave that to 8, we need arrays larger than two for our dynamic transforms when doing SLAM. ardupilot/libraries/AP_DDS/AP_DDS_Client.cpp Line 621 in 12b761c
It's the stack size in this function: ardupilot/libraries/AP_HAL/Scheduler.h Line 124 in e232ccd
|
e4a424e
to
3ddb136
Compare
I fixed the stack frame size issue on build and reworked the integer precision in the get_parameter service and rebased on the latest master. All checks passed now. Per the dev call yesterday, I plan to put together a smaller follow on PR to move the GCS_SEND_TEXT statements to a DDS debug statement and will address the verbosity in there as well. |
ISSUE
#28292
Changes
-Add set parameters service call to AP_DDS library
Test
Using ros2 CLI, build and launch ardupilot sitl
Expected output
Expected output
mavproxy window:
service call window:
Expected output
mavproxy window:
service call window: