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

Support waitsets #657

Open
wayneparrott opened this issue May 23, 2020 · 3 comments
Open

Support waitsets #657

wayneparrott opened this issue May 23, 2020 · 3 comments

Comments

@wayneparrott
Copy link
Collaborator

rclcpp recently added a new waitset api, ros2/rclcpp#520 Is the waitset capability something we want to consider for inclusion in rclnodejs?

@minggangw
Copy link
Member

Thanks for the information! It's a big refactor inside the rclcpp framework and I go through the motivation of it roughly (I see many issues were connected to this PR), the most important one I think is to reduce the CPU overhead. But the changes are based on the design of rclcpp specifically and we have some limitations of threads in Node.js, so I think we need to investigate more to see how will it benefit to developers if we expose kind of waitset in JavaScript and the influence to the current framework of rclnodejs.

@minggangw
Copy link
Member

Just some thoughts in case I forget them:

  • From the current framework of rclnodejs, we don't have kind of Executor (SingleThreadedExecutor/MultiThreadedExecutor) exposed to the JavaScript layer, the concept of the thread is transparent to the developers. Further, the Executor in rclnodejs runs on the sub-thread because it's not allowed to block the main thread in Node.js

  • Exposing waitset means users can call wait() to block the runloop, some cpp examples about the new usage https://github.com/ros2/examples/pull/262/files

@wayneparrott
Copy link
Collaborator Author

I think we need to investigate more to see how will it benefit to developers if we expose kind of waitset in JavaScript and the influence to the current framework of rclnodejs.

My blink reaction was similar to your's. Let's revisit as ros 2 continues to mature and additional features emerge that we want incorporated into the project.

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

No branches or pull requests

2 participants