Skip to content

Actionlib Wrapper Should Wait for Terminal Status to Finish Goals #87

@eitanme

Description

@eitanme

Description
I think there is a bug in the Goal class within actionlib.py where a goal can be marked as finished before a terminal status is received because it only checks whether a result is received over the wire and makes no checks on status.

The issue is that status and result come through on different topics so there is a race where the last status received could be ACTIVE even after a result comes in on the wire. The goal will eventually transition to SUCCEDED, but it may do so after user checks on the goal status leading to unexpected results.

To Reproduce
Steps to reproduce the behavior:

I've seen this intermittently in testing when checking for a SUCCEEDED goal status and unexpectedly seeing an ACTIVE status even when a result is received. It's a race so it doesn't always happen, but writing my own check to wait until status turns from ACTIVE to SUCCEEDED on the Goal fixes the behavior for me.

Expected behavior
A Goal should not be considered finished until both a result message is received AND a terminal status message is received.

System (please complete the following information):
Name: roslibpy
Version: 1.2.1
Summary: Python ROS Bridge library.
Home-page: https://github.com/gramaziokohler/roslibpy
Author: Gramazio Kohler Research
Author-email: [email protected]
License: MIT license
Location: /usr/local/lib/python3.8/dist-packages
Requires: autobahn, twisted

Additional context
I think this should be a pretty straightforward fix in is_finished and wait in the Goal class. I'm sorry I haven't submitted a patch as I've installed from pip and don't have the source to test with at the moment, but let me know if it'd be useful and I can try to find time to take a stab at it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions