Ask Your Question
0

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

asked 2015-09-29 01:53:50 -0500

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?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2015-09-29 15:38:37 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-09-29 01:53:50 -0500

Seen: 92 times

Last updated: Sep 29 '15