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

Add RTEMS TCP/UDP Support #283

Merged
merged 10 commits into from
Nov 15, 2021
Merged

Add RTEMS TCP/UDP Support #283

merged 10 commits into from
Nov 15, 2021

Conversation

roncapat
Copy link
Contributor

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.

bjv-capra and others added 4 commits November 14, 2021 20:14
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>
@richiprosima
Copy link
Contributor

Build status:

  • Linux Build Status
  • Windows Build Status

@richiprosima
Copy link
Contributor

Build status:

  • Linux Build Status
  • Windows Build Status

Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
@richiprosima
Copy link
Contributor

Build status:

  • Linux Build Status
  • Windows Build Status

Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
@richiprosima
Copy link
Contributor

Build status:

  • Linux Build Status
  • Windows Build Status

@pablogs9
Copy link
Member

Thanks @roncapat, let's review it and we can merge it in develop branch

@roncapat
Copy link
Contributor Author

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 :) )

@richiprosima
Copy link
Contributor

Build status:

  • Linux Build Status
  • Windows Build Status

roncapat and others added 3 commits November 15, 2021 10:46
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>
@richiprosima
Copy link
Contributor

Build status:

  • Linux Build Status
  • Windows Build Status

@pablogs9 pablogs9 changed the base branch from foxy to develop November 15, 2021 09:54
@pablogs9 pablogs9 merged commit 86a5dda into eProsima:develop Nov 15, 2021
@roncapat
Copy link
Contributor Author

Thank you so much! 💯

@pablogs9
Copy link
Member

@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?

@roncapat
Copy link
Contributor Author

@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);
Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor

@Acuadros95 Acuadros95 Nov 16, 2021

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants