Skip to content

Commit

Permalink
navigator_missions: Add autonomous mission for RobotX 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrxyz committed Nov 3, 2024
1 parent 1ed76f5 commit 0ac615b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import mil_missions_core

from . import pose_editor
from .autonomous_2024 import Autonomous2024
from .back_and_forth import BackAndForth
from .circle import Circle
from .circle_tower import CircleTower
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from __future__ import annotations

import asyncio

import rospy

from .docking import Docking
from .entrance_gate2 import EntranceGate2
from .navigation import Navigation
from .navigator import NaviGatorMission
from .scan_the_code import ScanTheCodeMission
from .wildlife import Wildlife


class Autonomous2024(NaviGatorMission):

# timeout (in secs)
TIMEOUT = 180

async def run_mission(self, mission_cls: type[NaviGatorMission], name: str):
rospy.loginfo(f"[autonomous] beginning {name}...")
try:
await asyncio.wait_for(mission_cls().run(""), self.TIMEOUT)
except asyncio.TimeoutError:
rospy.logwarn(f"[autonomous] ran out of time on {name}!")

async def run(self, args: str):
# Step 1: Entrance and exit gates
await self.run_mission(EntranceGate2, "entrance gate")

# Step 2: Scan the Code
await self.run_mission(ScanTheCodeMission, "scan the code")

# Step 3: Wildlife Mission
await self.run_mission(Wildlife, "wildlife")

# Step 4: Navigation Mission
await self.run_mission(Navigation, "navigation")

# Step 5: Dock Mission
await self.run_mission(Docking, "docking")

# Step 6: UAV Mission
pass

0 comments on commit 0ac615b

Please sign in to comment.