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

Add a default robot status function for the sim #139

Merged
merged 2 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
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: 4 additions & 0 deletions src/isar_turtlebot/robotinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from robot_interface.models.initialize import InitializeParams
from robot_interface.models.inspection.inspection import Inspection
from robot_interface.models.mission import InspectionStep, Step, StepStatus
from robot_interface.models.mission.status import RobotStatus
from robot_interface.robot_interface import RobotInterface
from robot_interface.telemetry.mqtt_client import MqttTelemetryPublisher

Expand Down Expand Up @@ -80,3 +81,6 @@ def get_telemetry_publishers(self, queue: Queue, robot_id: str) -> List[Thread]:
publisher_threads.append(battery_thread)

return publisher_threads

def robot_status(self) -> RobotStatus:
return RobotStatus.Available
3 changes: 0 additions & 3 deletions src/isar_turtlebot/services/video_streamer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import base64

import cv2

from isar_turtlebot.ros_bridge.ros_bridge import RosBridge


Expand All @@ -10,7 +8,6 @@ def __init__(self, bridge: RosBridge) -> None:
self.bridge: RosBridge = bridge

def main(self):

while True:
image_data: str = self.bridge.video_stream.get_image()
image_bytes: bytes = base64.b64decode(image_data)
Expand Down
1 change: 0 additions & 1 deletion src/isar_turtlebot/turtlebot/step_handlers/driveto.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def start(
self,
step: DriveToPose,
) -> None:

goal_pose: Pose = self.transform.transform_pose(
pose=step.pose, from_=step.pose.frame, to_=Frame("robot")
)
Expand Down
1 change: 0 additions & 1 deletion src/isar_turtlebot/turtlebot/step_handlers/takeimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def __init__(
self.inspection: Optional[Image] = None

def start(self, step: TakeImage) -> None:

self.status = Status.Active

current_pose: Pose = self._get_robot_pose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from typing import Optional
from uuid import uuid4

import numpy as np
import PIL.Image as PILImage
import numpy as np
from alitra import Pose, Position, Transform
from robot_interface.models.inspection.inspection import (
ThermalImage,
Expand Down Expand Up @@ -53,7 +53,6 @@ def start(
self,
step: TakeThermalImage,
) -> None:

self.status = Status.Active
current_pose: Pose = self._get_robot_pose()
target: Position = self.transform.transform_position(
Expand Down
1 change: 0 additions & 1 deletion src/isar_turtlebot/turtlebot/turtlebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class Turtlebot:
"""Step manager for Turtlebot."""

def __init__(self, bridge: RosBridge, transform: Transform) -> None:

self.logger: Logger = logging.getLogger("robot")
self.bridge: RosBridge = bridge
self.transform: Transform = transform
Expand Down
1 change: 0 additions & 1 deletion src/isar_turtlebot/utilities/inspection_pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


def get_inspection_pose(current_pose: Pose, target: Position) -> Pose:

direction = target.to_array() - current_pose.position.to_array()
alpha = np.arctan2(direction[1], direction[0])
rotation = Rotation.from_euler("zyx", [alpha, 0, 0], degrees=False)
Expand Down