ros / actionlib

Provides a standardized interface for interfacing with preemptable tasks. Examples of this include moving the base to a target location, performing a laser scan and returning the resulting point cloud, detecting the handle of a door, etc.
http://www.ros.org/wiki/actionlib
96 stars 155 forks source link

fix python wait_for_server premature return #180

Closed c-andy-martin closed 3 years ago

c-andy-martin commented 3 years ago

The python wait_for_server only checks to see if the result and feedback topics have a connection marked not done. Unfortunetly, rospy adds the connection information before actually connecting the transport, and initializes done to False. Therefore wait_for_server returns prematurely. If a goal is immediately sent, and the server finishes the goal quickly and sends the result, the result topic may not yet be fully connected and the result may be lost. This will cause the action client to stay stuck waiting for results until the timeout is reached.

Fix this by checking the result and topic subscribers for a callerid_pub matching the server_id received on the status topic. The callerid_pub will be set after receiving the header, which gurantees the subscriber is correctly connected, and correctly connected to the proper publisher. There is no need to re-check the status topic (as it is the source of truth).

mmoerdijk commented 3 years ago

@jacobperron The merge request you mentioned is merged now.

jacobperron commented 3 years ago

@ros-pull-request-builder retest this please

jacobperron commented 3 years ago

@ros-pull-request-builder retest this please

jacobperron commented 3 years ago

@ros-pull-request-builder retest this please