From 091ef6f8a12b1dd3f8dfe357da4c2bd80b7ad0d5 Mon Sep 17 00:00:00 2001 From: LeGend-wLw <874644990@qq.com> Date: Mon, 8 May 2023 17:42:00 +0800 Subject: [PATCH] Fix: Action Object Couldn't Get Currect Error Message From Robot --- src/robomaster/action.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/robomaster/action.py b/src/robomaster/action.py index e5f9c70..34ca5a9 100644 --- a/src/robomaster/action.py +++ b/src/robomaster/action.py @@ -241,8 +241,11 @@ def _update_action_state(self, proto_state): self._changeto_state(ACTION_SUCCEEDED) elif proto_state == 'error': self._changeto_state(ACTION_FAILED) + self._failure_reason = proto_state logger.error("TextAction: action failed ! resp: {0}".format(proto_state)) else: + self._changeto_state(ACTION_FAILED) + self._failure_reason = proto_state logger.error("TextAction: action failed ! resp: {0}".format(proto_state)) def make_action_key(self):