From bfb3d32a59ffd93b14ac091ad6d029c2fe70d962 Mon Sep 17 00:00:00 2001 From: Thomas Sundvoll Date: Thu, 8 Dec 2022 10:28:26 +0100 Subject: [PATCH] Publish random pose --- src/isar_robot/robotinterface.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/isar_robot/robotinterface.py b/src/isar_robot/robotinterface.py index fef58387..65970ed3 100644 --- a/src/isar_robot/robotinterface.py +++ b/src/isar_robot/robotinterface.py @@ -116,8 +116,19 @@ def get_telemetry_publishers(self, queue: Queue, robot_id: str) -> List[Thread]: return publisher_threads def _get_pose_telemetry(self, robot_id: str) -> str: + random_position: Position = Position( + x=random.uniform(0.1, 10), + y=random.uniform(0.1, 10), + z=random.uniform(0.1, 10), + frame=Frame("asset"), + ) + random_pose: Pose = Pose( + position=random_position, + orientation=self.pose.orientation, + frame=Frame("asset"), + ) pose_payload: TelemetryPosePayload = TelemetryPosePayload( - pose=self.pose, robot_id=robot_id, timestamp=datetime.utcnow() + pose=random_pose, robot_id=robot_id, timestamp=datetime.utcnow() ) return json.dumps(pose_payload, cls=EnhancedJSONEncoder)