Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleActionClient / SimpleActionServer default constructors #100

Open
finger563 opened this issue Apr 3, 2018 · 1 comment
Open

SimpleActionClient / SimpleActionServer default constructors #100

finger563 opened this issue Apr 3, 2018 · 1 comment

Comments

@finger563
Copy link

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 added a commit to rosmod/actionlib that referenced this issue Apr 3, 2018
finger563 added a commit to rosmod/actionlib that referenced this issue Apr 3, 2018
@cwecht
Copy link
Contributor

cwecht commented Jan 14, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants