Skip to content

Commit

Permalink
Abide by mypy enum standard
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Jan 3, 2025
1 parent e2c9adb commit 424c1fe
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 57 deletions.
18 changes: 9 additions & 9 deletions src/isar/apis/models/start_mission_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@


class InspectionTypes(str, Enum):
image: str = "Image"
thermal_image: str = "ThermalImage"
video: str = "Video"
thermal_video: str = "ThermalVideo"
audio: str = "Audio"
image = "Image"
thermal_image = "ThermalImage"
video = "Video"
thermal_video = "ThermalVideo"
audio = "Audio"


class TaskType(str, Enum):
Inspection: str = "inspection"
Localization: str = "localization"
ReturnToHome: str = "return_to_home"
Dock: str = "dock"
Inspection = "inspection"
Localization = "localization"
ReturnToHome = "return_to_home"
Dock = "dock"


class StartMissionInspectionDefinition(BaseModel):
Expand Down
40 changes: 20 additions & 20 deletions src/robot_interface/models/exceptions/robot_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@


class ErrorReason(str, Enum):
RobotCommunicationException: str = "robot_communication_exception"
RobotCommunicationTimeoutException: str = "robot_communication_timeout_exception"
RobotInfeasibleTaskException: str = "robot_infeasible_step_exception"
RobotInfeasibleMissionException: str = "robot_infeasible_mission_exception"
RobotMissionStatusException: str = "robot_mission_status_exception"
RobotTaskStatusException: str = "robot_task_status_exception"
RobotAPIException: str = "robot_api_exception"
RobotActionException: str = "robot_action_exception"
RobotInitializeException: str = "robot_initialize_exception"
RobotRetrieveDataException: str = "robot_retrieve_data_exception"
RobotRetrieveInspectionException: str = "robot_retrieve_inspection_exception"
RobotTelemetryException: str = "robot_telemetry_exception"
RobotTelemetryNoUpdateException: str = "robot_telemetry_no_update_exception"
RobotTelemetryPoseException: str = "robot_telemetry_pose_exception"
RobotMapException: str = "robot_map_exception"
RobotTransformException: str = "robot_transform_exception"
RobotUnknownErrorException: str = "robot_unknown_error_exception"
RobotDisconnectedException: str = "robot_disconnected_exception"
RobotMissionNotSupportedException: str = "robot_mission_not_supported_exception"
RobotMissionMissingStartPoseException: str = (
RobotCommunicationException = "robot_communication_exception"
RobotCommunicationTimeoutException = "robot_communication_timeout_exception"
RobotInfeasibleTaskException = "robot_infeasible_step_exception"
RobotInfeasibleMissionException = "robot_infeasible_mission_exception"
RobotMissionStatusException = "robot_mission_status_exception"
RobotTaskStatusException = "robot_task_status_exception"
RobotAPIException = "robot_api_exception"
RobotActionException = "robot_action_exception"
RobotInitializeException = "robot_initialize_exception"
RobotRetrieveDataException = "robot_retrieve_data_exception"
RobotRetrieveInspectionException = "robot_retrieve_inspection_exception"
RobotTelemetryException = "robot_telemetry_exception"
RobotTelemetryNoUpdateException = "robot_telemetry_no_update_exception"
RobotTelemetryPoseException = "robot_telemetry_pose_exception"
RobotMapException = "robot_map_exception"
RobotTransformException = "robot_transform_exception"
RobotUnknownErrorException = "robot_unknown_error_exception"
RobotDisconnectedException = "robot_disconnected_exception"
RobotMissionNotSupportedException = "robot_mission_not_supported_exception"
RobotMissionMissingStartPoseException = (
"robot_mission_missing_start_pose_exception"
)

Expand Down
36 changes: 18 additions & 18 deletions src/robot_interface/models/mission/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@


class MissionStatus(str, Enum):
NotStarted: str = "not_started"
InProgress: str = "in_progress"
Paused: str = "paused"
Failed: str = "failed"
Cancelled: str = "cancelled"
Successful: str = "successful"
PartiallySuccessful: str = "partially_successful"
NotStarted = "not_started"
InProgress = "in_progress"
Paused = "paused"
Failed = "failed"
Cancelled = "cancelled"
Successful = "successful"
PartiallySuccessful = "partially_successful"


class TaskStatus(str, Enum):
NotStarted: str = "not_started"
InProgress: str = "in_progress"
Paused: str = "paused"
Failed: str = "failed"
Cancelled: str = "cancelled"
Successful: str = "successful"
PartiallySuccessful: str = "partially_successful"
NotStarted = "not_started"
InProgress = "in_progress"
Paused = "paused"
Failed = "failed"
Cancelled = "cancelled"
Successful = "successful"
PartiallySuccessful = "partially_successful"


class RobotStatus(Enum):
Available: str = "available"
Busy: str = "busy"
Offline: str = "offline"
Blocked: str = "blocked"
Available = "available"
Busy = "busy"
Offline = "offline"
Blocked = "blocked"
4 changes: 2 additions & 2 deletions src/robot_interface/models/robots/battery_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class BatteryState(Enum):
Normal: str = "Normal"
Charging: str = "Charging"
Normal = "Normal"
Charging = "Charging"
2 changes: 1 addition & 1 deletion src/robot_interface/models/robots/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class MediaConnectionType(str, Enum):
LiveKit: str = "LiveKit"
LiveKit = "LiveKit"


@dataclass
Expand Down
14 changes: 7 additions & 7 deletions src/robot_interface/models/robots/robot_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# Did you write your own isar-robot package and would like to have it included here?
# Open a pull request to the ISAR repository!
class RobotModel(Enum):
TaurobInspector: str = "TaurobInspector"
TaurobOperator: str = "TaurobOperator"
ExR2: str = "ExR2"
Robot: str = "Robot" # This corresponds to the mock in isar_robot
Turtlebot: str = "Turtlebot"
AnymalX: str = "AnymalX"
AnymalD: str = "AnymalD"
TaurobInspector = "TaurobInspector"
TaurobOperator = "TaurobOperator"
ExR2 = "ExR2"
Robot = "Robot" # This corresponds to the mock in isar_robot
Turtlebot = "Turtlebot"
AnymalX = "AnymalX"
AnymalD = "AnymalD"

0 comments on commit 424c1fe

Please sign in to comment.