-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add RTEMS TCP/UDP Support #283
Conversation
Signed-off-by: Bart Jimenez Vera <bjv@capra.ooo> Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
Add UCLIENT_PLATFORM_RTEMS_BSD_NET platform flag to use TCP/UDP implementation with only POSIX API and no poll() usage, to be able to compile against RTEMS 5.1 RTOS. Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
540bc28
to
395f73c
Compare
Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
Thanks @roncapat, let's review it and we can merge it in develop branch |
src/c/profile/discovery/transport/udp_transport_datagram_rtems_bsd_net.c
Outdated
Show resolved
Hide resolved
I will solve DCO after build passing and all reviews are closed. The last 3 commits address already some of your observations (thank you so much for the fast response to this PR :) ) |
Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com> Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
Thank you so much! 💯 |
@roncapat we are really interested in your use case. Will you be interested in talking about the purpose / use cases / projects where RTEMS is going to be used along with micro-ROS in our monthly ROS 2 Embedded Working Group? |
@pablogs9 of course I am. Note that currently, this is a low-priority and personal contribution, but is meant to pave the way to internal usage (at Thales Alenia Space Italy, where I currently work) in some robotic testbenches. Let me know more about the meeting at roncapat@gmail.com (so that I can then reply with my corporate mail). |
tv.tv_usec = (timeout % 1000) * 1000; | ||
|
||
|
||
int32_t poll_rv = select(transport->fd + 1, &transport->select_fd, NULL, NULL, &tv); |
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.
Bug: The same FD_ZERO FD_SET treatment before select() should be done here. Will post a new PR soon.
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.
Cool, thanks. We will handle it in a new PR.
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.
Yes! We missed that the set object is modified.
We also use a select approach on the multi-serial agent, where it is enough to copy the set on a local variable, check here: link (read_fds
is equivalent to your transport->select_fd
).
With this approach you avoid modifications on external data.
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 like it, cleaner! I will also then update the other two usages of select() like this.
With this PR, the DDS Client (and subsequently micro-ros) can build and run on RTEMS 5.
RTEMS is a Real Time Executive in use in multiple research and space exploration projects (satellites, rovers...).
This is the issue where I kept track of the progress.
micro-ROS/micro_ros_setup#397
Today I managed to run a 1:1 copy of the ping-pong example with 50 Hz ping rate.
RTEMS support is enabled by defining
UCLIENT_PLATFORM_RTEMS_BSD_NET
.Both TCP and UDP transports have been tested.