Kawasaki-Robotics / khi_robot

ROS KHI robot meta-package
http://wiki.ros.org/khi_robot
BSD 3-Clause "New" or "Revised" License
54 stars 28 forks source link

Create the ControllerManager after robot was openned #70

Closed Yuki-cpp closed 2 years ago

Yuki-cpp commented 2 years ago

This should fix #69

As mentioned in #69, creating the controller manager before opening the robot can lead to failures at runtime because the ControllerManager provides services that require the robot to be already opened. If a 3rd party calls one of those services before the robot is opened, that operation will fail.

By moving the creation of the ControllerManager after we try to open the robot, we ensure that no race condition will occur and that the robot will always be openned when the provided services are called.

matsui-hiro commented 2 years ago

Hi, @Yuki-cpp Thank you for opening the PR.

I checked that bringup finishes normally and Initializing controllers does not failed with this change. I will merge this PR.