actionlib constructor initialization
I'd appreciate it if someone can explain the reason why the actionlib simpleServer constructor needs to be initialized as a constructor initializer list? If the initialization's removed the compilation fails.
reference to actionlib tutorials
I know this is more as a C++ question rather than ROS related question!
Thank you.
Aside of ahendrix correct answer below, a suggestion:
If you want to initiate the action server at another moment, you can consider wrapping the
actionlib::SimpleActionServer
in astd::shared_ptr
. I would not suggest it as the default approach, but it can be useful in cases where the action server is not supposed to be active directly at the time of calling the constructor of your class.If with
you mean it may be desirable to not have the
ActionServer
instantiated then delaying construction by using a (smart) pointer is indeed an option.If you were instead thinking of "initiate" as: placing the server in the active state, then perhaps setting
auto_start
tofalse
(ctor docs) would be a better approach.Good point, I was not thinking of the
auto_start
option, which is indeed a better approach.