Skip to content

Actions #583

Closed
Closed

Description

@sloretz

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 list and ros2 service list should 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

g1

g2

g2.5

g2.75

g3

g4

g5

g5.5

g6

  • rclcpp Action Server implementation
  • rclcpp Action Client implementation

g7

g8

g9

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

Activity

  1. added
    enhancement
    on Oct 9, 2018
  2. added this to the crystal milestone on Oct 9, 2018
  3. jacobperron commented on Oct 16, 2018

    @jacobperron
    Member

    rcl implementation ticket: ros2/rcl#306

  4. added
    in progress
    on Oct 18, 2018
  5. self-assigned this
    on Oct 30, 2018
  6. mkhansenbot commented on Jan 10, 2019

    @mkhansenbot

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

  7. jacobperron commented on Jan 10, 2019

    @jacobperron
    Member

    @mkhansen-intel

    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?

    This is correct, all that remains is the rclpy implementation (currently in progress) along with some more communication tests.

    Also, I don't see anything here about adding tutorials or examples to the wiki pages, or any other documentation. Is usage documented somewhere?

    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.

  8. mkhansenbot commented on Jan 10, 2019

    @mkhansenbot

    @jacobperron - thank you for the update and for adding a line item for tutorials. I'll keep watching for updates.

  9. mkhansenbot commented on Jan 14, 2019

    @mkhansenbot

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

  10. jacobperron commented on Jan 14, 2019

    @jacobperron
    Member

    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?

    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.

  11. mkhansenbot commented on Jan 15, 2019

    @mkhansenbot

    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.

  12. dirk-thomas commented on Jan 15, 2019

    @dirk-thomas
    Member

    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.

    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.

  13. sloretz commented on Jan 15, 2019

    @sloretz
    ContributorAuthor

    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

    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

    I remember a conversation with @wjwwood where rclcpp would include everything, but everything would be moved to lower level packages ( rclcpp_action and rclcpp_lifecycle being the first with rclcpp_topic, rclcpp_service, etc to follow). Including rclcpp_action.hpp is required now, but I thought rclcpp.hpp would include everything in the future.

  14. mkhansenbot commented on Jan 15, 2019

    @mkhansenbot

    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.

  15. mkhansenbot commented on Jan 15, 2019

    @mkhansenbot

    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:

      auto node = rclcpp::Node::make_shared("minimal_action_client");
      auto action_client = rclcpp_action::create_client<Fibonacci>(node, "fibonacci");
    

    To this:

      auto node = rclcpp::Node::make_shared("minimal_action_client");
      auto action_client = node->create__action_client<Fibonacci>(node, "fibonacci");
    
  16. 9 remaining items

  17. mkhansenbot commented on Jan 17, 2019

    @mkhansenbot

    @wjwwood - Early in the thread I asked if the intention was to move Actions into the rclcpp interface. I got conflicting answers.

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

    Reply from @jacobperron:

    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.

    Reply from @sloretz:

    I remember a conversation with @wjwwood where rclcpp would include everything, but everything would be moved to lower level packages ( rclcpp_action and rclcpp_lifecycle being the first with rclcpp_topic, rclcpp_service, etc to follow). Including rclcpp_action.hpp is required now, but I thought rclcpp.hpp would include everything in the future.

    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.

  18. wjwwood commented on Jan 18, 2019

    @wjwwood
    Member

    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.

    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 include rclcpp/rclcpp.hpp, and they would be able to create an action client or server from within the rclcpp namespace (rather than the rclcpp_action namespace). 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> in rclcpp/rclcpp.hpp, this is because rclcpp_action uses rclcpp itself, therefore creating a circular dependency.

    So the actual (minimal) work to be done is to:

    • rename rclcpp to something like rclcpp_core
    • change rclcpp_* to depend on rclcpp_core instead
    • create an rclcpp package with at least a header that includes rclcpp_core and rclcpp_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 rclcpp pr's.

    But there's a lot of other design choices to be made too, e.g.:

    • should everything be put into an rclcpp_core:: namespace and then "renamespaced" in rclcpp's header?
      • following our standard practice this is what we'd do, but is it worth it?
      • something like:
    namespace rclcpp { using namespace rclcpp_core; }
    • or perhaps there's another, better way to do it?
    • does this create problems at release time
    • other things I can't think of right now, probably

    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 into rclcpp as 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

  19. davetcoleman commented on Jan 18, 2019

    @davetcoleman

    @wjwwood sorry for taking this conversation off topic and being overly judgmental

    but it's not low priority because we don't care about it (which has been the implication I've gotten from this conversation), instead it's because we have to deliver the features and the minimal viable product

    If this is your stance than I totally understand

    It's very frustrating to have someone come in on this narrow bikeshed issue and declare we care nothing about it nor have we invested anything into it.

    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.

  20. mkhansenbot commented on Jan 18, 2019

    @mkhansenbot

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

  21. wjwwood commented on Jan 18, 2019

    @wjwwood
    Member

    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?

    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.

  22. jacobperron commented on Jan 24, 2019

    @jacobperron
    Member

    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.

  23. mkhansenbot commented on Jan 24, 2019

    @mkhansenbot

    @gbiggs - this is the actions thread (and lifecycle discussion) I mentioned to you

  24. gbiggs commented on Jan 25, 2019

    @gbiggs
    Member

    This is again misconstruing a work in progress with an intentional final state. I think it's ridiculous to conclude we sat in a meeting and decided to make it hard to use.

    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.hpp to 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. 😃

    They're going to be supported in Python and C++ and Python will share an implementation in the C API

    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?

  25. jacobperron commented on Jan 25, 2019

    @jacobperron
    Member

    @gbiggs

    Why doesn't the C++ client library also share an implementation with the C library?

    I think this is a misunderstanding. The C++ client library does use a common C library, rcl_action.

  26. mkhansenbot commented on Jan 29, 2019

    @mkhansenbot

    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?

  27. sloretz commented on Jan 29, 2019

    @sloretz
    ContributorAuthor

    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?

    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 or https://github.com/ros2/rclcpp, questions at https://answers.ros.org/questions/ , and general discussion at https://discourse.ros.org/c/ng-ros .

  28. jacobperron commented on Mar 13, 2019

    @jacobperron
    Member

    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 🎉

  29. removed
    in progress
    on Mar 13, 2019
  30. ros-discourse commented on Jun 13, 2025

    @ros-discourse

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions