I have implemented a hardware interface in ros2_control and added code to free my hardware resources in the on_deactivate()
method.
When I try to stop the controller with the command ros2 control set_controller_state diffbot_base_controller inactive
and try to free the hardware, on_deactivate()
doesn't seem to be called.
I can't find console output from deactivate
, and the read/write method is still being called. Unlike before, only the value from hw_command_ is 0.
It's very confusing.Maybe I'm confused about the life cycle concept in controller_manager
of ros2_control. I was hoping to get some tips or links to relevant materials.