return value in action server
Hi, I'm following this tutorial http://wiki.ros.org/actionlib , and my question is,
The server can return a value to the client? How can I do?
thanks!!
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Hi, I'm following this tutorial http://wiki.ros.org/actionlib , and my question is,
The server can return a value to the client? How can I do?
thanks!!
There's a short snippet sn section 5 of the page you linked:
# Define the goal
uint32 dishwasher_id # Specify which dishwasher we want to use
---
# Define the result
uint32 total_dishes_cleaned
---
# Define a feedback message
float32 percent_complete
See the line with # Define the result
? The return type of this action is uint32
and the name of the return value is total_dishes_cleaned
.
To set this return value have a look at the setSucceeded()
signature found here:
void actionlib::SimpleActionServer< ActionSpec >::setSucceeded(const Result & result = Result(),
const std::string &
text = std::string("")
)
You can call setSucceeded()
with a result as parameter. In this result object you can set the return members.
In Python it works the same.
Asked: 2015-02-19 06:40:31 -0500
Seen: 903 times
Last updated: Feb 20 '15
problem with move_base and server connection
actionLib: which way is better when using setSucceed()?
action server vs publisher + service
How do I set the goalID in actionlib?
difference between execute_cb and goalcb?
How should I send a trajectory to an Arduino Robot Arm?
Actionlib SimpleActionClient Connecting to SimpleActionServer