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

ROS2 Actions Support #130

Open
mikelyndersOKCC opened this issue Jan 15, 2020 · 12 comments
Open

ROS2 Actions Support #130

mikelyndersOKCC opened this issue Jan 15, 2020 · 12 comments
Labels

Comments

@mikelyndersOKCC
Copy link

mikelyndersOKCC commented Jan 15, 2020

I have created a ROS2 package that implements ROS2 Actions and it would be great if I could call them through my webapp interface. Unfortunately, it seems ROS2 Actions are not supported yet.

What would it take to get this functionality? I have gathered that there are a couple reasons why this might be hard:

  • rclnodejs does not support ROS2 actions
  • rosbridge v2.0 protocol does not address ROS2 actions
  • roslibjs seems to support actionlib ROS1 actions, but I don't know/understand if that functionality can be used with ROS2 actions

How could one assist in the effort to support ROS2 Actions in ROS2-web-bridge?

Would ROS2 actions need to be implemented inside roslibjs using the topics and services that are already supported by ROS2-web-bridge and the rosbridge v2.0 protocol? (I think this is more or less how roslibjs implemented the actionlib support)

or

Should actions support be implemented in rclnodejs first and then rosbridge v2.0 protocol be extended to support actions in some way?

I'd love to help in any way I can. I'm fairly new to ROS so please correct me if I'm misunderstanding.

In the meantime I will likely change my ROS package to provide the same functionality with a long-running service. (I know that is bad as services are meant to 'return quickly' but I'm not sure how else to do it)

@minggangw
Copy link
Member

Thanks for your question, I'd like to talk about the history of actionlib feature first

  • In ROS1, there was no concept of middleware, so each client implements its own version of actionlib achieved by client/service.

  • In ROS2, we have a middleware named rcl, clients of ROS2 must wrapper this C library and expose the interfaces through different languages, e.g. C++/Pythons/JavaScript:

    • At the beginning of ROS2, the actionlib was not supported by rcl and rclnodejs implemented the actionlib which has been deprecated.
    • Since rcl has supported the actionlib, so as the normal way clients should leverage the C interface to offer the functionality.

Based on the background, some comments below:

What would it take to get this functionality?

The rclnodejs should implement the actionlib feature

How could one assist in the effort to support ROS2 Actions in ROS2-web-bridge?

We have to support it for rclnodejs first

Would ROS2 actions need to be implemented inside roslibjs using the topics and services that are already supported by ROS2-web-bridge and the rosbridge v2.0 protocol?

As the rosbridge v2.0 protocol doesn't support actionlib concept, so we may extend it if we want to support it (the corresponding changes may be made to roslibjs also).

Should actions support be implemented in rclnodejs first and then rosbridge v2.0 protocol be extended to support actions in some way?

That's correct.

There is already an open issue - RobotWebTools/rclnodejs#469 to record this feature, so if you are willing to contribute to the implementation, you can submit your PR there. Currently, the rclnodejs still has a gap with Python/Cpp clients, see RobotWebTools/rclnodejs#498, please feel free if you are interested in any of them, thanks!

@mikelyndersOKCC
Copy link
Author

Thanks for the explanation! I understand much better, I will take a look at RobotWebTools/rclnodejs#469 as well as the guidelines in RobotWebTools/rclnodejs#498 to determine if this is something I might be able to contribute to!

@gautamjain
Copy link

Looks like actions are now supported in rclnodejs. Would extending the rosbridge protocol be the next step?

On a related note - is the 'rosbridge v2.0 protocol' meant for ROS2? Or is it the second iteration of a protocol designed for ROS1?

@minggangw
Copy link
Member

Looks like actions are now supported in rclnodejs. Would extending the rosbridge protocol be the next step?

Yes, rclnodejs now supports actions, but we haven't had plan to extend the rosbridge protocol yet.

On a related note - is the 'rosbridge v2.0 protocol' meant for ROS2? Or is it the second iteration of a protocol designed for ROS1?

It stands for the 2nd version of rosbridge protocol for ROS1, that's is why it's difficult to extend to ROS2.

@spygibas
Copy link

Hi, I make website and use ros2-web-bridge to connect with ros2, I have problem on navigation2 because I can't use actions roslibjs and can't get result or feedback if I send pose direct via geometry_msgs/msg/PoseStamped.

Can anyone help me for solution for these problem ?
Would better way I should do ?

  1. Maybe guideline how to me upgrade roslibjs or ros2-web-bridge to support action ros2.
    or
  2. I'm new about nodejs but I don't know rclnodejs need to use with ros2-web-bridge if I need use on website for connect ros2 ex. website server monitor and control to robot.
    or
  3. Modify navigation2 (cpp) to publish some topic after robot navgation done for result.
  4. Other...

@minggangw
Copy link
Member

Currently, ros2-web-bridge doesn't support the actions feature for ROS2, because the way of implementing action in ROS2 is different from ROS1 and roslibjs is designed for ROS1. The rclnodejs acts as the back-end for ros2-web-bridge and ros2-web-bridge acts as a kind of bridge to connect the web and the ROS2 nodejs client (rclnodejs). You could consider it as a proxy to send/receive messages to/from the web server.

@spygibas
Copy link

Currently, ros2-web-bridge doesn't support the actions feature for ROS2, because the way of implementing action in ROS2 is different from ROS1 and roslibjs is designed for ROS1. The rclnodejs acts as the back-end for ros2-web-bridge and ros2-web-bridge acts as a kind of bridge to connect the web and the ROS2 nodejs client (rclnodejs). You could consider it as a proxy to send/receive messages to/from the web server.

Thank you for explain. I understand now between rclnodejs and ros2-web-bridge.

@nadavis
Copy link

nadavis commented Jun 16, 2023

@spygibas did success to manage it? i have the same issue? any good advice?

@spygibas
Copy link

@spygibas did success to manage it? i have the same issue? any good advice?

rclnodejs acts as the back-end server at location robot , not same as roslibjs it at location on server website
if you need use need to make conversation between rclnodejs first

@nadavis
Copy link

nadavis commented Jun 20, 2023

@spygibas many thanks for you replay
imaybe you can help me, i tried to run the following example but i got a error that the "https://github.com/RobotWebTools/rclnodejs/blob/develop/example/action-client-example.js"

any idea?
i trying to use the rclnodejs for action and send a goal, but unfortently i issue with that. did you success to run a action?

@spygibas
Copy link

@nadavis Hi, I suggest you to use these https://github.com/open-rmf/rmf-web
for demo test https://github.com/open-rmf/rmf_demos

@nadavis
Copy link

nadavis commented Jun 21, 2023

@spygibas
Many thanks!!!!

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

No branches or pull requests

5 participants