Skip to content

Bugfix and added library init()

Robin Bartsch requested to merge cpp_lib_refactor into master

Initially just wanted to add a "dummy" init() function. Then I realized that the SimpleActionClient has the same problem that a Publisher has, in that it needs to be created a while before the first goal is sent. Otherwise for multiple drive_to_POI(_blocked)() calls, only the first one actually arrives on the goal topic and is executed. The "singleton" architecture with the getter was able to fix the problem. Now the global SimpleActionClient is created on init() and is instantly available for every call.

Goes to show that simply translating the Python code to C++ doesn't necessarily produce the same result, as it's hard to reason about the ROS internals sometimes.

Edited by Robin Bartsch

Merge request reports