-
Notifications
You must be signed in to change notification settings - Fork 193
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
Embedded ROS 2 Design Page #197
base: gh-pages
Are you sure you want to change the base?
Conversation
…to embedded_ROS2
Fixes ARM processor name.
Updates architecture diagram and fixes text typo.
Call it "wishlist" instead of requirements.
Split 'MCU-SPEC'. Fix ANDROID->ARDUINO
Embedded ros2 tables
Refs #2616. Fixes deliverable link.
@clalancette I see that the action's PR is on a branch in this repo. Maybe more people can add commits that way? If yes, maybe we could re-target this to a branch, merge it there without discussion, and then do a PR from that branch to gh2-pages and re-commence the discussion on that? Just let me know. |
Reformatted wishlist table into sections, to comply with OSRF's "short lines" requirement.
@clalancette I saw that it is easily possible to re-target the PR to a different branch. If you guys would be willing to give me access to the design repo, I'd very much prefer creating an "embedded_ROS2" branch there and continue the discussion in that. |
I'll check what our policy with that is. For now, I'll just pull this PR and push directly to a branch on this repo. |
All right, closing this in favor of #198 |
It looks like the discussion is going to move back here, so I'll leave my comments on this pull request. First, some general comments. I read both this document and the linked OFERA report. The biggest problem I have is that there is an inherent assumption right from the start that something else needs to be created to support small-scale embedded devices, i.e. rmw/rcl cannot be used directly even with modifications. I haven't seen any evidence to support this assumption and without seeing some I can't agree with the direction this document proposes for how ROS2 will support small-scale devices. I would prefer to see rmw/rcl used directly and modified where necessary, unless it can be shown that making them work at a small scale will compromise them for medium and large scales. Not using rcl directly does two things that I don't like:
For the linked report's statements and requirements, I have some additional comments relevant to the above:
So to sum up, if someone can show a compelling argument why rmw/rcl cannot satisfy the very small scale devices use case that this document targets, then I can agree with the need for a separate implementation. But so far I have only seen this as an unsupported assumption, and the listed requirements seem reasonable for rmw/rcl. Similarly, the wishlist are all things that I would want at larger scales as well. |
@gbiggs I think we got off a bit on the wrong foot here, most likely because you recall an earlier discussion on discourse whether rcl could be re-used or whether there's going to be a ucrlc. Because, really, it has not been my intention to convey that there is a decision to do a ucrlc. If there's text in this document that says otherwise please point it out (and I've taken note on the sentence with "specialized" above). That said, there is observable evidence from existing embedded implementations for small and tiny devices that should give us pause on whether barging ahead and porting rmw/rcl at all costs is the right approach. That's why this document is using fuzzy language that postpones such a decision and instead commits to measuring it. FWIW, right now, as part of the OFERA project, eprosima has provided an rmw implementation for Micro XRCE-DDS. They also ported rcl, and there is ongoing work to port rclcpp. We have identified several issues with that (e.g., related to 64bit atomics) and are talking to the OSRF about it. @BorjaOuterelo can probably provide more info. In addition to that, several people, including Robotis, Amazon, and myself, have also pursued alternatives to that, for various reasons. You may not like it, but I would argue that you actually should, because these alternatives provide concrete examples of how to do things differently, which IMHO is a much better foundation for discussion than "what if's". This is ongoing work, and benchmarking results will trickle in, so that we get more evidence for decision-making. btw, let me also note that this is not only about resource use, but also about how to get rid of the plethora of checks in rcl and rmw on whether a pointer is still valid ,-) I very much hope that at least some of that will get into rcl proper :-) |
This document is more ambiguous about the intended approach. The linked OFERA report is not. It seems quire clear in that report that the intention is to create a separate software stack that is ROS2-compatible to meet the requirements. There are statements like:
and even a requirement:
I don't know how I can read these any other way than that OFERA has decided from the outset that a separate software stack will be created. It's making this decision with any evidence for why it is necessary that bugs me. Of course I have no input into OFERA so if that project wants to do that, then it can go right ahead. However, when it comes for how ROS2 is going to define its tiny-scale embedded support, then I think more evidence needs to be provided to support such a decision. The problem comes from using that report as support for this design document, and this document also being written in a way that implies creating a separate software stack is the goal due to statements like the one near the very start that talks about creating a ROS2-interoperable stack. Perhaps such statements could be rephrased to include reusing the existing client libraries as much as possible, and making modifications where possible, and using as little custom code as possible?
I don't think I said I don't like that work being done. If it seems like I did, then that was not my intention and I apologise for the confusion. I want to see these approaches tried and I want to see using rmw/rcl as much as possible tried, so we have numbers that can be used to make a decision. I even said as much in one of my previous comments. |
Update: I had some more text here earlier, but it's really besides the point. In the OFERA project, we're hedging our bets with regard to how much we can re-use, because there's some technical and organizational uncertainty. Please do not overinterpret this, and instead lets move on to the technical discussion. If we didn't want to play by the communities terms, we wouldn't be here.
That's mainly the XRCE-DDS agent. Because we're not using the same middleware, we have to bridge. People have tried to bring DDS to small devices, and it didn't work. That's not just a matter of memory, it's also about enabling power-saving etc. (which doesn't go well with a protocol that assumes you're always listening). Things which might distinguish this bridge from the "plain" XRCE DDS agent include ROS-specific things, such as TF filtering, etc. |
I think that the changes made in 2b7cb6c address my concerns about the planned direction for the work. |
Why don't you discuss the rmw (or rcl) plugging multiple middlewares? I think the embedded ROS aims to support non-DDS or non-XRCE DDS middlewares. This function is apparently needed in the embedded system where suitable middlewares and/or wire protocols tend to vary for each purpose. |
This would be an RCL topic in general, wouldn't it? In my experience, for MCUs, this is decided at deployment time. Do you have use cases where it's decided at runtime?
In our systems, we have an agent that does such things. It is running on the Linux side. This is not something we burden then MCU with. Maybe I should add a system sketch early on in the document, to show the overall system architecture and eco-system. |
Adds new projects.
Thanks for your comments.
Currently, I don't have any idea about which layer (rmw or rcl) is better to add the function.
To avoid misunderstanding, I'd like to mention that those plural middlewares have to be used concurrently (not exclusively) in runtime. Of course, the set of middlewares to be used in runtime has to be decided until deployment time.
It may be true if we choose the set of standard DDS and XRCE DDS. But, there are some middlewares which have no functions of the agent publishing/subscrinbing standard DDS topic. |
@clalancette What's your view on this? Can we merge? AFAICT, we resolved all major issues with this version of the document. We also had a SIG telco a while ago where we agreed on the further direction (i.e., sticking with stock rcl/rmw). Of course, as design documents go, it definitely needs further work and we're going to further develop it as we go along. However, since there have been no more issues identified, I think this version could go in as a baseline for now. |
@gbiggs would you agree that we have addressed your points? You made one comment in this direction, but I'm not sure whether the PR as a whole has been marked valid. |
## Important Differences / Assumptions | ||
|
||
One of the major difference for the embedded stack is to be able to | ||
run not (only) on Linux, but also on Real-Time Operating Systems, or |
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 don't see a reason why the existing ROS 2 code couldn't run on a Real-Time Operating Systems? I guess this is aiming for a very specific sub-category of OSes. Maybe it makes sense to state them here explicitly.
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.
The answer to this depends on what you mean by "existing ROS 2". See our design diagram for the layers we expect to be able to re-use.
In more detail:
- We expect that RCL and RMW can run on RTOS's with POSIX APIs when targeting devices with at least 32kB of RAM. Some modifications might be useful to make them run better, but that's a different topic.
- DDS cannot run on most target devices, as is well known, hence the use of XRCE-DDS. This then also excludes the corresponding rmw_ and type_support_ layers implementations. We did rmw_ and type_support_ implementations based on Micro-XRCE-DDS, however, so in principle this runs.
- rclcpp is tricky, because of the C++ standard library, which is large and not trivial to port. Borja from eProsima did some experiments with libcxx and it doesn't look too bad, but there's also a few issues. Moreover, it might take so much FLASH and RAM that most people want to avoid it. This is something where we still need more benchmarks. An alternative might be rclc.
After that, we get into the realm of libraries above rclcpp.
- TF is important, and I've already done a bit of work on that, with more to come in early 2019. Most likely I will produce a stripped down 'C' version, so that we don't require rclcpp just for TF.
- Executors could also benefit from specific support, as mentioned above
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.
Regarding TF on embedded systems, have you checked the https://github.com/ESROCOS/tools-transformer library from the ESROCOS (https://www.h2020-esrocos.eu/) European project?
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.
@traversaro: that seems to be C++ based?
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.
@traversaro thanks for the hint, I wasn't aware of that but will check it out. are you involved with the project, so that I could ask you about it?
@gavanderhoorn C++ is not strictly impossible, most embedded compilers support it. what's more problematic is the standard library. but yeah, it's always something to look critically at, unfortunately (I usually prefer C++ over 'C' due to its better consistency features, but have had to accept that it can be an issue).
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.
@traversaro thanks for the hint, I wasn't aware of that but will check it out. are you involved with the project, so that I could ask you about it?
I am not involved with the project at all, but I learned a lot about it by reading the deliverables, that are detailed but readable documents: https://www.h2020-esrocos.eu/publications/deliverable-documents/ .
@traversaro: that seems to be C++ based?
It is indeed C++, but if I remember correctly from the deliverable is meant to run on the top of RTEMS or similar OS, so I think it is still worth checking it out.
|
||
To cover the broad range of use-cases for MCUs in robotics, the embedded | ||
ROS 2 stack shall be usable with the default ROS 2 middleware standard | ||
DDS, simple (custom) serial communication protocols just as common |
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.
Imo the statement "usable with" is not specific enough in terms of goals. In the meaning of "compatible with on the wire" there is simple no other choice than DDS. In the meaning of "compatible using e.g. a bridge" I don't see much value in mentioning it - that part is explicitly covered by W-SEAMLESS
. Technically even ROS 1 is compatible in that sense using the ros1_bridge
.
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.
What's meant here is "usable" in the same way that you can exchange rmw_-implementations now.
Not sure how to rephrase that so it becomes clearer. Maybe just mentioning rmw would do the trick? Other suggestions welcome.
Yeah, I guess so. From your recent updates it sounds like you are going in the direction I prefer. |
Start of the design page for the ROS 2 Embedded effort.
Includes contributions by all of the OFERA consortium partners.