ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

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

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


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

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

Question Tools

1 follower


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

Seen: 218 times

Last updated: Sep 29 '15