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: added support for UDP transport #23586
Conversation
nice! great to see this! |
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.
Thanks for this support! This one's been a long time coming.
Good news: serial still works
Bad news: Initialization didn't pass on UDP with the following settings.
Yes, I enabled DDS.
ros2 run micro_ros_agent micro_ros_agent udp4 -p 2019 -r dds_xrce_profile.xml
sim_vehicle.py -v ArduPlane --console --enable-dds
stuck on:
AP: DDS Client: Initialization waiting...
After Dev call tomorrow I will have time to drop into a GDB session if you need.
just tested it on my system..works fine for the udp transport running the following command
|
Checked on macOS and with updated ROS 2 launch scripts: https://github.com/srmainwaring/ardupilot/tree/wips/wip-dds-udp-launch (tests have not yet been updated). |
It was suspected that I didn't have the params set. After a reboot, still no luck.
|
2dd4930
to
77dcfca
Compare
Go ahead and merge. Everyone else has got this working. It's an issue on my side. |
libraries/AP_DDS/AP_DDS_Client.cpp
Outdated
reliable_in = uxr_create_input_reliable_stream(&session, input_reliable_stream, BUFFER_SIZE_SERIAL, STREAM_HISTORY); | ||
reliable_out = uxr_create_output_reliable_stream(&session, output_reliable_stream, BUFFER_SIZE_SERIAL, STREAM_HISTORY); |
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.
Remove? - creates a pair of streams which are not used (the pair ofuxrStreamId
created in the if-else below has uxrStreamId.index
incremented).
@Ryanf55 @arshPratap rewritten to use custom transport for both UDP and serial, so we only have to link one transport |
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.
I wasn't able to get either serial or udp to initialize properly.
On UDP, no topics show up, but the node is there.
ryan@ryan-B650:~/Development/ardu_ws$ ros2 node list
/Ardupilot_DDS_XRCE_Client
ryan@ryan-B650:~/Development/ardu_ws$ ros2 topic list
/parameter_events
/rosout
On serial, it does not pass initialization.
libraries/AP_DDS/README.md
Outdated
@@ -91,6 +92,7 @@ Run the simulator with the following command. Take note how two parameters need | |||
sim_vehicle.py -w -v ArduPlane |
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.
Can you add --enable-dds
too? It's missing.
@@ -126,9 +126,9 @@ const AP_Param::GroupInfo AP_Vehicle::var_info[] = { | |||
#endif | |||
|
|||
#if AP_DDS_ENABLED | |||
// @Group: XRCE | |||
// @Group: DDS | |||
// @Path: ../AP_DDS/AP_DDS_Client.cpp |
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.
Looks like some indent alignment issues here.
this allows for an DDS_ENABLED parameter
and switch serial transport to use custom transport
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.
Approved. Serial and UDP work.
Tested TCP failed, we can look into this later.
ryan@ryan-B650:~/Development/ardu_ws/src/ardupilot/libraries/AP_DDS$ ros2 run micro_ros_agent micro_ros_agent tcp4 -p 2019 -r dds_xrce_profile.xml -v 5
[1683082402.146296] info | TCPv4AgentLinux.cpp | init | running... | port: 2019
[1683082402.146669] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 5
[1683082441.202584] debug | TCPv4AgentLinux.cpp | recv_message | [==>> TCP <<==] | client_key: 0x00000000, len: 8240
[1683082442.100784] debug | TCPv4AgentLinux.cpp | recv_message | [==>> TCP <<==] | client_key: 0x00000000, len: 80
terminate called after throwing an instance of 'eprosima::fastcdr::exception::BadParamException'
what(): Unexpected byte value in Cdr::deserialize(bool), expected 0 or 1
[ros2run]: Aborted
sim_vehicle.py -v ArduPlane -D --console --enable-dds -A "--uartC=tcpclient:127.0.0.1:2019"
....
enable UDP transport on SITL. It will be enabled on ChibiOS once ethernet support is merged to master
pair programmed with @arshPratap