Skip to content
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
2 changes: 1 addition & 1 deletion inorbit_edge_executor/behavior_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ def build_tree_for_mission(self, context: BehaviorTreeBuilderContext) -> Behavio
on_error.add_node(UnlockRobotNode(context, label="unlock robot after mission abort"))
on_cancel = BehaviorTreeSequential(label="cancel handlers")
on_cancel.add_node(
MissionAbortedNode(context, status=MissionStatus.ok, label="mission cancelled")
MissionAbortedNode(context, status=MissionStatus.error, label="mission cancelled")
)
on_cancel.add_node(UnlockRobotNode(context, label="unlock robot after mission cancel"))
on_pause = BehaviorTreeSequential(label="pause handlers")
Expand Down
1 change: 1 addition & 0 deletions inorbit_edge_executor/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

Defines different types shared by various modules.
"""

from enum import Enum
from typing import Any
from typing import Dict
Expand Down
6 changes: 2 additions & 4 deletions inorbit_edge_executor/inorbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class MissionState(Enum):
completed = "completed"
in_progress = "in-progress"
paused = "paused"
aborted = "aborted"
abandoned = "abandoned"
starting = "starting"

Expand Down Expand Up @@ -349,10 +350,7 @@ async def abort(self, status: MissionStatus = MissionStatus.error):
"""Marks the mission as Aborted in Mission Tracking API"""
try:
req = {
# NOTE(herchu) State could be "aborted" but we have not defined it in
# https://docs.google.com/document/d/16KxmbmkiKhZ1IU_zkorJzZscMWFU2FrIJoTlenM8gwY ,
# so until then we use the one currently mapped from Actionlib's "ABORTED=4"
"state": str(MissionState.abandoned),
"state": str(MissionState.aborted),
"inProgress": False,
"tasks": self._build_tasks_list(),
"status": str(status),
Expand Down
12 changes: 4 additions & 8 deletions inorbit_edge_executor/sqlite_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ async def add_paused_field_migration(self):
# NOTE (Elvio): Creating a new table here and migrating data to it because
# in sqlite it's not possible to create a new "NOT NULL" field on already existing
# table (paused column)
await cursor.execute(
f"""
await cursor.execute(f"""
CREATE TABLE {temp_missions_table} (
"mission_id" TEXT,
"state" TEXT,
Expand All @@ -122,14 +121,11 @@ async def add_paused_field_migration(self):
"paused" BOOL NOT NULL,
PRIMARY KEY("mission_id")
);
"""
)
await cursor.execute(
f"""
""")
await cursor.execute(f"""
INSERT INTO {temp_missions_table} (mission_id, state, finished, robot_id, paused)
SELECT mission_id, state, finished, robot_id, 0 FROM {missions_table};
"""
)
""")
await cursor.execute(f"DROP TABLE {missions_table};")
await cursor.execute(f"ALTER TABLE {temp_missions_table} RENAME TO {missions_table};")
# Commit the changes
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dev = [
"pytest~=8.4.1",
"pytest-httpx~=0.35.0",
"pytest-asyncio~=1.1.0",
"black~=25.1.0",
"black~=26.1",
"bump-my-version~=1.2.1",
]
docs = ["sphinx", "mkdocs"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_behavior_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_bt_build_simple(inorbit_api):
"type": "MissionAbortedNode",
"state": "",
"label": "mission cancelled",
"status": "OK",
"status": "error",
},
{
"type": "UnlockRobotNode",
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ python =
3.14: py314

[testenv:lint]
deps = black
skip_install = true
deps = black~=25.1.0
skip_install = false
commands =
black --check --diff --line-length 100 inorbit_edge_executor tests example.py

Expand Down