ros actionlib多客户端加单服务器的同步问题

http://library.isr.ist.utl.pt/docs/roswiki/actionlib(2f)DetailedDescription.htmlg



Server States
Intermediate States
  • Pending - The goal has yet to be processed by the action server

  • Active - The goal is currently being processed by the action server

  • Recalling - The goal has not been processed and a cancel request has been received from the action client, but the action server has not confirmed the goal is canceled

  • Preempting - The goal is being processed, and a cancel request has been received from the action client, but the action server has not confirmed the goal is canceled

Terminal States
  • Rejected - The goal was rejected by the action server without being processed and without a request from the action client to cancel

  • Succeeded - The goal was achieved successfully by the action server

  • Aborted - The goal was terminated by the action server without an external request from the action client to cancel

  • Recalled - The goal was canceled by either another goal, or a cancel request, before the action server began processing the goal

注意Recalled状态,下面会用到

  • Preempted - Processing of the goal was canceled by either another goal, or a cancel request sent to the action server



Since multiple action clients can connect to a single action server, it is possible for a second client to cancel a goal sent by the first client. Thus, it is valid for the client to transition from[PENDING] to [RECALLING] if a [RECALLING] state is received from the server.

此处说明,前一个客户端的请求,可能会被第二个客户端请求停掉。


status topic: Server goal state updates
The status topic uses actionlib_msgs/GoalStatusArray, and gives action clients server goal status information about every goal currently being tracked by the action server. This is sent by the action server at some fixed rate (generally 10 Hz), and is also sent asynchronously on any server goal state transition.

A goal is tracked by the action server until it reaches a terminal state. However, to increase communication robustness, the server publishes status for this goal for a few more seconds after reaching a terminal state.

服务器会周期发送状态给客户端



从上图中和说明文字看,如果在server的任务队列中,已经一个pending任务,那么再来一个任务后,新来的任务C会把B挤掉,这样导致B任务的状态变为Recalled.因此B任务没有被执行。



上图和文字可以看出,正常没有抢占情况下任务的执行顺序和状态改变。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值