Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug that uses the status of a previous goal #5

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion smach_ros/smach_ros/simple_action_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def __init__(self,
self._action_spec = action_spec

# Set timeouts
self._goal_status = 0
self._goal_status = GoalStatus.STATUS_UNKNOWN
self._goal_result = None
self._exec_timeout = exec_timeout
self._preempt_timeout = preempt_timeout
Expand Down Expand Up @@ -354,6 +354,7 @@ def execute(self, ud):
# Activate the state before sending the goal
self._activate_time = self.node.get_clock().now()
self._status = ActionState.ACTIVE
self._goal_status = GoalStatus.STATUS_UNKNOWN

with self._done_cond:
# Dispatch goal via non-blocking call to action server
Expand Down Expand Up @@ -440,6 +441,7 @@ def _goal_accepted_cb(self, future):
Accept or reject a client request to begin an action.
"""
goal_handle = future.result()
self._goal_status = goal_handle.status

if not goal_handle.accepted:
self.node.get_logger().debug(f"Goal request from action {self._action_name} has been rejected!")
Expand Down
Loading