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: 934 times
Last updated: Feb 20 '15
cancelGoal crashes if called before any goal has been sent...
genaction not found in diamondback
Using Smach and SimpleActionState
Action server with more than one action...
Subscribing to action servers' feedback topic
SimpleActionState doesn't abort on timeout