标签:fail stat package cmake duration view 执行 代码 class
Actionlib
Detailed_description
Tutorials
SimpleActionClientAPI
sstream double 字符串转换
tf API
请比较rosaria和rosaria_client构造描述文件的区别
The actionlib stack provides a standardized interface for interfacing with preemptable tasks.
在ROS中,已经有一种机制,让程序可以向一个节点发送任务请求并收到一次回应,这个机制叫做服务(service),但是在其他很多情况下,如果一个任务需要很长时间完成,用户想要周期性地收到服务器的反馈,这样的机制已经实现,叫做动作,action。
The actionlib package provides tools to create servers that execute long-running goals that can be preempted. It also provides a client interface in order to send requests to the server.
协议建立在ros message机制上。
find_package(catkin REQUIRED genmsg actionlib_msgs actionlib)
add_action_files(DIRECTORY action FILES DoDishes.action)
generate_messages(DEPENDENCIES actionlib_msgs)
<depend package="actionlib"/>
<depend package="actionlib_msgs"/>
// sending the goal
ac.sendGoal(goal);
// wait until finish
while (!ac.waitForResult(ros::Duration(1.0)))
ROS_INFO("Running…");
// print result
if(ac.getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
ROS_INFO("Hooray, the base moved 1 meter forward");
else
ROS_INFO("The base failed to move forward 1 meter for some reason");
标签:fail stat package cmake duration view 执行 代码 class
原文地址:https://www.cnblogs.com/lizhensheng/p/11117578.html