Skip to content

Commit

Permalink
Added Move and Dock actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Dozgulbas committed Aug 15, 2024
1 parent ed5a9c9 commit ee8b241
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/mir_rest_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,46 @@ def state(state: State):
return ModuleState(status=state.status, error="")


@rest_module.action(
name="move",
description="Send a Move command to the MIR Base",
)
def move(
state: State,
action: ActionRequest,
target_location: Annotated[List[dict], "Target location name"],
description: Annotated[str, "Description of the location"],
priority: Annotated[Optional[int], "Prority of the movement in the queue. Defult is 1"],
) -> StepResponse:
"""Sends a move command to the MIR Base"""
state.move(
location_name=target_location,
description=description,
priority=priority,
)
return StepResponse.step_succeeded(f"MIR Base moved to the location: {target_location} ")


@rest_module.action(
name="dock",
description="Sends a dock command to the MIR Base",
)
def dock(
state: State,
action: ActionRequest,
target_location: Annotated[List[dict], "Name of the docking location"],
description: Annotated[str, "Description of the docking location"],
priority: Annotated[Optional[int], "Prority of the docking in the queue. Defult is 1"],
) -> StepResponse:
"""Sends a docking command to the MIR Base"""
state.dock(
location_name=target_location,
description=description,
priority=priority,
)
return StepResponse.step_succeeded(f"MIR Base moved to the location: {target_location} ")


@rest_module.action(
name="queue_mission",
description="Adds a new mission to the queue. A mission could have multiple movement actions",
Expand Down

0 comments on commit ee8b241

Please sign in to comment.