Robotics StackExchange | Archived questions

actionLib: which way is better when using setSucceed()?

Hi,

in actionLib tutorial it uses as_.setSucceeded(result_); to notify success

but in actionLib wiki pages it uses as->setSucceeded(); to notify success.

However, in the Simple action server document, there is only the first method mentioned, not the second one. But the second method can be compiled successfully.

Then I'm wondering since they all sent success notification to the client, which way is better if there is only a bool variable stands for action success or not in my file.action?

Asked by lanyusea on 2015-09-29 01:53:50 UTC

Comments

Answers

The documentation of the method is

void setSucceeded (const Result &result=Result(), const std::string &text=std::string("")) 

So that you are always calling the same function, but default parameters are given if you don't give any. If you call as_.setSucceeded(result_) you have to opportunity to return a result from the action. However, if you call as->setSucceeded(); your result message will be all zeros.

Asked by Javier V. Gómez on 2015-09-29 15:38:37 UTC

Comments