-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
navigator_missions: Add autonomous mission for RobotX 2024
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
NaviGator/mission_control/navigator_missions/navigator_missions/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
NaviGator/mission_control/navigator_missions/navigator_missions/autonomous_2024.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |