Interbotix / interbotix_ros_toolboxes

Support-level ROS Packages for Interbotix Robots
BSD 3-Clause "New" or "Revised" License
29 stars 68 forks source link

Fix double initialization problem in Python api #56

Closed lklimkiewicz7 closed 8 months ago

lklimkiewicz7 commented 11 months ago

One (like me) may want to control multiple interbotix arms from single process using python API. Currently it throws exception due to calling rclpy.init() twice. These simple changes seem to fix this issue.

patilunmesh commented 8 months ago

The addition of rclpy.ok to prevent multiple calls to init is a good workaround however, there is an issue of calls to other rclpy states such as shutdown. I will be opening another pull request to introduce node ownership parameter to make sure all node state managing functions are accessible to only one robot.

lukeschmitt-tr commented 8 months ago

@lklimkiewicz7 Thanks for your valuable contribution!