Closed Yuki-cpp closed 2 years ago
Hi, @Yuki-cpp Thank you for investigating the problem.
That being said, I am not very familiar with this driver code-base and might have missed something important. Is my assertion of the >situation accurate? Am I missing anything here?
I think there is no problem even if the call order is changed. If you don't mind, could you make PR of your local fix?
Thank you @matsui-hiro. I openned the PR, let me know if you have any change/request about it.
Hello,
When using the
khi_robot
driver we noticed that sometimes runningrs013n_bringup.launch
would fail requesting some controllers to be registered in thehardware_interface::RobotHW
class.After a bit of digging, I found the potential cause for that behavior here: https://github.com/Kawasaki-Robotics/khi_robot/blob/9d916ea93cea35c511a18aa22dd85d31a8be8746/khi_robot_control/src/main.cpp#L329
It appears that when the controller manager is created, some services are advertised. Those services require the controllers to be loaded in the hardware interface. However, some controllers are only loaded here, a couple of lines later: https://github.com/Kawasaki-Robotics/khi_robot/blob/9d916ea93cea35c511a18aa22dd85d31a8be8746/khi_robot_control/src/main.cpp#L331
If one of the mentioned services is called before we call
robot.open
I would expect the behavior we're encountering. A fix for that would be to create the controller manager after callingrobot.open
which would ensure that the controllers are always loaded when needed. I implemented that locally and it seems to work fine.That being said, I am not very familiar with this driver code-base and might have missed something important. Is my assertion of the situation accurate? Am I missing anything here? If so, I'm more than happy to provide a PR to fix that.
Thank you