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

来源:互联网 发布:淘宝代发论文被骗 编辑:程序博客网 时间:2024/05/16 04:35

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 0