[ros-users] [Discourse.ros.org] [Next Generation ROS] Mapping between rospy and rclpy

William Woodall ros.discourse at gmail.com
Wed Aug 15 01:51:02 UTC 2018





[quote="hemantku, post:1, topic:5737"]

* rospy has Exceptions like ROSInterruptException. I do not find an equivalent exception to use from rclpy. Is there some other package which defines these?

[/quote]



If it's not defined in `rclpy` then it's probably not defined anywhere. I don't know off the top of my head where this was being used in `rospy`, but it may make sense to have it in `rclpy` and it simply hasn't been ported yet. It might be connected to the init/shutdown or rate features that are still missing.



[quote="hemantku, post:1, topic:5737"]

* rospy.get_param is missing in rclpy. Will this be covered as part of this - https://github.com/ros2/rclpy/issues/186? Also, what is the alternative for this till then? Can I use the example in https://github.com/ros2/rclpy/blob/0db8fc763ead2cf3184f8c876f1be1bdd85944d8/rclpy/test/test_node.py#L77 ?

[/quote]



It is missing, but those issues I don't think are the best connection to that feature. I'd say:



https://github.com/ros2/rclpy/issues/202



Which is being worked on now:



https://github.com/ros2/rclpy/pull/214



[quote="hemantku, post:1, topic:5737"]

rospy.Rate() is missing which I do guess will covered here: https://github.com/ros2/rclpy/issues/186 Any alternative?

[/quote]



Yes, that issue specifically mentions `Timer` and `Rate` concepts, which are dependent on finishing the "ROS Time" implementation in `rclpy`.



[quote="hemantku, post:1, topic:5737"]

Does rospy.is_shutdown seems to have been removed in rclp. How do we check for shutdown? Can we use rclpy.try_shutdown()?

[/quote]



It's not been explicitly removed as far as I know, it just hasn't been implemented yet. You could use `try_shutdown()` to test, but if you only wanted to test you'd be out of luck since the side-effect would be a shutdown in many cases. This feature is captured in this issue (in my opinion):



https://github.com/ros2/rclpy/issues/190



Which it seems you've already found and offered to help (thanks!).











---

[Visit Topic](https://discourse.ros.org/t/mapping-between-rospy-and-rclpy/5737/2) or reply to this email to respond.









More information about the ros-users mailing list