Repository navigation
Closed
Description
ROS 2 Action Plan
At a high level the goal for actions in Crystal is to enable porting moveit and the navigation stack to ROS 2.
Required by Crystal release
- rclpy API for action client and action server
- rclcpp API for action client and action server
- rcl has code for action server and action client that is used by client libraries
- Action server and client support features needed to make it possible to write a bridge with ROS 1
- supports multiple goals simultaneously
- examples repo has action API examples for rclpy and rclcpp
- test_communication tests for cross client library actions
- test_communication tests for cross rmw implementation actions
- CLI
ros2 topic listandros2 service listshould not show action topics by default - Support ROS 1 .action files
- Support .idl files once the IDL pipeline for services and messages is fully functioning
Issues
- Actions rcl#306 rcl api for actions
g1
- Allow generating messages and services in the namespace
actionrosidl#301 Neeed to be able to generate msg and srv c and c++ code in anactionnamespace - Allow generating messages services in an
actionfolder rosidl_typesupport_fastrtps#9 Allow fastrtps typesupport to generate service in action folder - Allow generating messages services in an
actionfolder rosidl_typesupport_opensplice#6 Allow opensplice typesupport to generate services in action - Allow generating messages services in an
actionfolder rosidl_typesupport_connext#11 Allow connext typesupport to generate services in action folder
g2
- Parse .action files rosidl#305 Parse
.actionfiles into intermediate representation
g2.5
- Allow generating messages and services in the module
actionrosidl_python#13 Need to be able to generate msg and srv python code inactionmodule
g2.75
- Service and Message definitions for actions rcl_interfaces#40 Need message and service definitions for parts common to all actions
g3
- Generate C typesupport for Actions rosidl#302 C header files / typesupport for Actions
- Generate C++ typesupport for actions rosidl#303 C++ header files / typesupport for Actions
- Generate python typesupport for Actions rosidl_python#14 Python typesupport object for actions
g4
- IDL 4.2 description for actions rosidl#304 Decide how actions will be represented in IDL 4.2
folder - Change UUID type in action_msgs rcl_interfaces#49 Use unique_identifier_msgs for actions (Change UUID type in action_msgs rcl_interfaces#54 Change UUID type in action msgs rosidl#332 Change UUID type in action msgs rcl#338 )(held for IDL work)
g5
- Generate UUID in C that
rclcan depend on in ROS 2 There is https://github.com/ros-geographic-info/unique_identifier/tree/ros2 , but it depends on boost/rospy/roscpp , will need something with fewer dependencies. - (under consideration) Generate low-level action typesupport API rosidl#314 Generate type support conversion functions for C API
g5.5
- rclcpp API to add something which adds something to the wait set ([rclcpp] Add class Waitable rclcpp#589)
- rclpy API to add something which adds something to the wait set (Python thing that adds things to the wait set rclpy#250)
g6
- rclcpp Action Server implementation
- rclcpp Action Client implementation
g7
- rclpy (Action implementation rclpy#257)
- Action Server implementation
- Action Client implementation
g8
- Test communication with C++ actions across rmw implementations (add Fibonacci test for actions system_tests#316)
- Test communication with python actions accross rmw implementations (Add rclpy action communication tests system_tests#332)
- Test communication with C++ and Python action communications (Add rclpy action communication tests system_tests#332)
g9
- Create tutorial/demo (add to ROS index tutorials?)
Likely not included in Crystal release
Good places for community contribution
- ROS 1 bridge for actions
- CLI
ros2 action - SimpleActionServer and SimpleActionClient APIs in python or c++
Places for Action discussion
Reacted by Matt Hansen, Yutaka Kondo and Ronald Luc
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
jacobperron commentedon Oct 16, 2018
rcl implementation ticket: ros2/rcl#306
mkhansenbot commentedon Jan 10, 2019
@sloretz - I was looking for a status update on Actions, I believe that they have been implemented everywhere except for rclpy at this point, but not totally sure. Can you clarify? Also, I don't see anything here about adding tutorials or examples to the wiki pages, or any other documentation. Is usage documented somewhere? Sorry if this is the wrong place to ask this question you can redirect me.
jacobperron commentedon Jan 10, 2019
@mkhansen-intel
This is correct, all that remains is the rclpy implementation (currently in progress) along with some more communication tests.
Some minimal examples for rclcpp can be found here: https://github.com/ros2/examples/tree/master/rclcpp
Python examples (WIP): ros2/examples#222
I think it would be nice to add some tutorials to the wiki at some point. I can add it to the checklist.
In the meantime, for more detailed usage I think the code is fairly well documented.
You should be able to generate docs with Doxygen.
mkhansenbot commentedon Jan 10, 2019
@jacobperron - thank you for the update and for adding a line item for tutorials. I'll keep watching for updates.
mkhansenbot commentedon Jan 14, 2019
@jacobperron - Thanks for the pointers. I see that the rclcpp_actions.hpp is separate from rclcpp.hpp. Do you plan to include rclcpp_actions.hpp within rclcpp.hpp or keep them separate?
jacobperron commentedon Jan 14, 2019
We decided to keep them separate for flexibility. It allows the user to optionally depend on the ROS action library. This is following the same pattern as
rclcpp_lifecycle.mkhansenbot commentedon Jan 15, 2019
It still seems to me like actions is being treated like a second-class citizen then. I thought the goal for ROS2 Actions was for it to be a first-class citizen, equal to topics and services.
dirk-thomas commentedon Jan 15, 2019
First-class citizen doesn't need to imply monolithically build.
First-class citizen means that it is fully supported and conceptionally doesn't have any cases which don't fit the rest of the system. An example for second-class would be nodelets in ROS 1 because once you converted nodes into nodelets you wouldn't be able to introspect the topic between them anymore.
sloretz commentedon Jan 15, 2019
I remember a conversation with @wjwwood where
rclcppwould include everything, but everything would be moved to lower level packages (rclcpp_actionandrclcpp_lifecyclebeing the first withrclcpp_topic,rclcpp_service, etc to follow). Includingrclcpp_action.hppis required now, but I thoughtrclcpp.hppwould include everything in the future.mkhansenbot commentedon Jan 15, 2019
Sorry if I'm splitting hairs here, but I thought that rclcpp was a facade design pattern for the system, which implies to me that all first class features should be accessible through that interface.
mkhansenbot commentedon Jan 15, 2019
Actually, as long as I'm stirring the pot here, I may as well do it right. I think actions should be part of the node interface such that the code to use it would go from this:
To this:
9 remaining items
mkhansenbot commentedon Jan 17, 2019
@wjwwood - Early in the thread I asked if the intention was to move Actions into the rclcpp interface. I got conflicting answers.
Reply from @jacobperron:
Reply from @sloretz:
So I made the technical argument (which @davetcoleman has now also chimed in agreeing to) that putting it in the rclcpp interface and preferrably in the Node class interface is desirable from the users standpoint for consistency and ease of use.
I believe your latest response is saying that you agree that the ideal long-term design should be to put Actions in the rclcpp interface, but since you're resource constrained it hasn't been done yet and you don't know when it can or will be done.
SO we need to separate the technical design discussion from the resource discussion. I think we're in agreement on the technical design discussion at least up to the point of including it in the rclcpp interface. Am I right? I think the technical desire we have (Dave and I) is to go one step further to include it in the Node interface, but I won't die on that hill today, if we can at least agree on the rclcpp inclusion.
Separately, we can have a discussion on the resourcing of the work, if that's the real issue preventing this from being done. Maybe we can help with that.
wjwwood commentedon Jan 18, 2019
Yes, you're right. Though I think I should be as clear as possible on my position:
I think the code for actions should continue to live in
rclcpp_actions, but that should become an implementation detail for the user, and the tutorials for actions would just includerclcpp/rclcpp.hpp, and they would be able to create an action client or server from within therclcppnamespace (rather than therclcpp_actionnamespace). My preference would be a free function or a class constructor, but I can go along with a method in the Node class.Perhaps something missing from this discussion is why we haven't done what I described above yet (either for lifecycle or actions). Basically you cannot just
#include <rclcpp_action/rclcpp_action.hpp>inrclcpp/rclcpp.hpp, this is becauserclcpp_actionusesrclcppitself, therefore creating a circular dependency.So the actual (minimal) work to be done is to:
rclcppto something likerclcpp_corerclcpp_*to depend onrclcpp_coreinsteadrclcpppackage with at least a header that includesrclcpp_coreandrclcpp_action, etc...Now, that's also not that much work, though you have to schedule it at a time where it is least disruptive to other
rclcpppr's.But there's a lot of other design choices to be made too, e.g.:
rclcpp_core::namespace and then "renamespaced" in rclcpp's header?So, maybe if you didn't have this context, I would have sounded like I was making a mountain out of a mole hill, but it's actually more involved that it first appears.
We have discussed doing this already, that's when we came up with these issues blocking it.
I would also consider actually moving
rclcpp_action's code intorclcppas a short term solution, but it is similarly messy to do and actually moves us away from what we desired for it from the beginning. Feel free to try and convince me otherwise, I'll listen, but at this time I don't feel it's the right thing to do.Finally, I want to apologize for letting out some frustration in the previous comments, it pushed a few of my buttons, because I know our team worked really hard on actions (I actually did basically nothing on it) and I felt the criticism was accurate in places but in others not deserved. Either way, I almost derailed the conversation when we basically started out agreeing, which is silly. So sorry about that, and thanks for taking the time to give your feedback, it is helpful even if we've already thought about addressing this issue.
<3
davetcoleman commentedon Jan 18, 2019
@wjwwood sorry for taking this conversation off topic and being overly judgmental
If this is your stance than I totally understand
Again, my apologies
I do want to assure you that my overall opinion of the core ROS team's efforts / OSRF's efforts are very positive and understanding of limited resources. I'm a big proponent of ROS2 and am advocating its adoption worldwide. It greatly concerns me when ROS2 is harder to use than ROS1 and making a clear case for upgrading is difficult, and I think little examples like this one get me on a soap box. But now I feel like I fully understand your position and background reasoning so will shut up.
mkhansenbot commentedon Jan 18, 2019
@wjwwood - no apology needed. I do realize you guys have too much to do (thus the reason we're trying to engage more to help), and that @jacobperron and @sloretz did a lot of work on this. And I'm even OK with this being the "first release" version. I never meant anything to be critical of anyone's work. I just wanted to talk about this from a purely technical standpoint.
This points to another issue in my mind which is lack of a design forum. I know there's a github repo for design discussion but for things like this maybe we need a working group for more real-time discussion?
As far as the rclcpp circular dependency issue, can that be broken by relying on the underlying interfaces / headers that are contained within rclcpp instead of rclcpp itself?
wjwwood commentedon Jan 18, 2019
Possibly, but I think it currently uses the rclcpp versions of things. So we'd have to at least refactor it to not use those anymore if that's even possible.
jacobperron commentedon Jan 24, 2019
For those interested, the first iteration of
rclpy's action client is visible at ros2/rclpy#262.Example usage (ros2/examples#222) still needs to be updated to match the API.
mkhansenbot commentedon Jan 24, 2019
@gbiggs - this is the actions thread (and lifecycle discussion) I mentioned to you
gbiggs commentedon Jan 25, 2019
Did I miss another one of the Evil ROS Committee meetings? I'm going to get thrown to the lasersharkrobots if I miss too many more.
I completely missed this discussion because I have been changing jobs and took a month completely off from everything work related. Actually I guess I completely missed every discussion for the past month, but anyway.
In general I agree with the approach being advocated by @wjwwood. Splitting the different functionalities out and then composing them as needed, with an "all of it" option provided by the core source for ease of use, is the best approach. There are different use cases that want different sets of ROS2 features, and I don't believe there is any overlap between every use case, with the possible exception of topics (and I have my doubts about that).
Regarding the lifecycle node implementation, I have concerns about that.
Rather than inheriting the basic node interface, it re-defines the whole thing. This is going to be an increasingly annoying maintenance burden, I think. Different/new node types should not have to duplicate all of
node.hppto provide a compatible interface. Aggregation/composition for the implementation is fine and as @wjwwood said necessary sometimes, as it is for the lifecycle node ensuring the correct kind of publishers are created, etc. But in my opinion this does not preclude inheriting interfaces.The approach used by the lifecycle node implementation works for now, but what will happen when someone produces another type of node that alters another aspect of the basic node's behaviour? I won't be able to use that and lifecycle nodes together easily. As it currently stands that new type would have to inherit from the lifecycle node interface and use a lifecycle node internally for the node implementation. This becomes an increasing problem as new types of nodes get developed. Maybe we won't see many or any new types of nodes and this won't be a problem, but I think this is in the same boat as @wjwwood's wish to allow new features to be implemented by everyone: we should not preclude it just because we don't know if it will ever happen or not. The approach taken by the lifecycle node implementation is exactly the sort of thing Scott Meyer goes on about in his books all the time.
In languages that support interfaces, I would prefer to see an approach more like mixins or something similar. I should be able to create a new node type as an interface and an implementation, and allow (advanced) users to mix that interface with other node type interfaces that also exist. I know that this will require documentation of what each interface expects and careful implementation of the mixed node type by the user, which is why I say it's for advanced users. But I believe this sort of flexibility would be a benefit to the ROS2 API, and is achievable without making the API harder to use or maintain.
Another concern I have is that the lifecycle node definition being a redefinition of the basic node means that I have encountered situations where there were functions that worked with "standard" nodes but not lifecycle nodes. I forget exactly where and I was stupid to not ticket them as I found them because obviously they need to be fixed, but this sort of thing shouldn't happen at all and is an example of the maintenance burden created. It wouldn't happen if the lifecycle node used interface inheritence or the API followed a policy of making anything that operated on a node a template method (probably the former is better if we need to keep binaries smaller and compile times lower). Either approach provides for mixing interfaces and I would be happy with either.
The above is really rambly but I hope my points are understandable. 😃
I'm confused about this. Why doesn't the C++ client library also share an implementation with the C library? I thought the whole point was that every client library would have a common implementation through the C library ensuring consistency. Is this a resourcing issue where in the future the C++ library will just wrap the C library but for now a C++ API was the priority?
jacobperron commentedon Jan 25, 2019
@gbiggs
I think this is a misunderstanding. The C++ client library does use a common C library, rcl_action.
mkhansenbot commentedon Jan 29, 2019
So my team is planning to implement Actions and Lifecycle nodes in Navigation2 within the next few months, in time for the 'Dashing' release. I believe there is still discussion needed on both. However, I don't believe this is the correct place for the discussion. Please tell me what the correct place / thread is for that?
sloretz commentedon Jan 29, 2019
I'm sure you're familiar with this already, but for anyone else http://wiki.ros.org/Support has general guidelines.
Specifically for actions, ros2/design#193 is a good spot for issues with how actions are designed. Problems with how the implementation or feature requests would be good as issues on https://github.com/ros2/rcl or https://github.com/ros2/rclcpp . Questions about using actions would be good at https://answers.ros.org/questions/ . This issue is a good spot to talk about Actions features that will be released into Crystal. Anything else probably fits at https://discourse.ros.org/c/ng-ros
For lifecycle nodes, I think issues at
https://github.com/ros2/rcl orhttps://github.com/ros2/rclcpp, questions at https://answers.ros.org/questions/ , and general discussion at https://discourse.ros.org/c/ng-ros .jacobperron commentedon Mar 13, 2019
Python support for actions has been implemented and backported to Crystal. We have tickets for the unchecked tasks:
I don't think these are planned to be backported into Crystal and so I think we can lay this ticket to rest 🎉
ros-discourse commentedon Jun 13, 2025
This issue has been mentioned on ROS Discourse. There might be relevant details there:
https://discourse.ros.org/t/design-process-of-ros-2/7782/1