File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/isar_turtlebot/turtlebot Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11
11
RobotCommunicationException ,
12
12
RobotException ,
13
13
)
14
+ from robot_interface .models .exceptions .robot_exceptions import (
15
+ RobotInvalidTelemetryException ,
16
+ )
14
17
from robot_interface .models .inspection .inspection import Inspection
15
18
from robot_interface .models .mission import InspectionStep , Step , StepStatus
16
19
from robot_interface .telemetry .payloads import (
27
30
TakeThermalImageHandler ,
28
31
)
29
32
from isar_turtlebot .turtlebot .step_handlers .stephandler import StepHandler
30
- from isar_turtlebot .utilities .pose_message import encode_initial_pose
33
+ from isar_turtlebot .utilities .pose_message import (
34
+ decode_pose_message ,
35
+ encode_initial_pose ,
36
+ )
31
37
32
38
33
39
class Turtlebot :
@@ -95,8 +101,14 @@ def set_initial_pose(self, pose: Pose) -> None:
95
101
self .bridge .initial_pose .publish (encode_initial_pose (pose = pose ))
96
102
97
103
def get_pose_telemetry (self , robot_id : str ) -> str :
104
+ pose_turtlebot : dict = self .bridge .pose .get_value ()
105
+ if not pose_turtlebot :
106
+ raise RobotInvalidTelemetryException
107
+
108
+ pose : Pose = decode_pose_message (pose_message = pose_turtlebot )
109
+
98
110
pose_payload : TelemetryPosePayload = TelemetryPosePayload (
99
- pose = self . bridge . pose . get_value () ,
111
+ pose = pose ,
100
112
robot_id = robot_id ,
101
113
timestamp = datetime .utcnow (),
102
114
)
You can’t perform that action at this time.
0 commit comments