actionlib icon indicating copy to clipboard operation
actionlib copied to clipboard

SimpleActionClient / SimpleActionServer default constructors

Open finger563 opened this issue 7 years ago • 1 comments

Currently, they cannot be defined as members of classes because they lack default constructors - for lazy initialization as might be needed when they exist as part of another class.

finger563 avatar Apr 03 '18 19:04 finger563

You can define SimpleActionClient and SimpleActionServer as members of classes. You just need to initialize them in the member initializer list of the constructor.

A popular alternative is to put them on the heap, but I would rather recommend boost::optional for optional members.

cwecht avatar Jan 14 '19 10:01 cwecht