Skip to content

Commit 34831a4

Browse files
committed
Fixed webapp part. Temporarily fixed the mission name for webapp.
1 parent 11d2e9d commit 34831a4

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

GEMstack/onboard/planning/mission_planning.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ def next_state(self):
3535

3636

3737
class SummoningMissionPlanner(Component):
38-
def __init__(self, use_webapp, webapp_url, goal, state_machine):
38+
def __init__(self, use_webapp, webapp_url, goal=None, state_machine=None):
3939
self.state_machine = StateMachine([eval(s) for s in state_machine])
40-
self.goal_location = goal['location']
41-
self.goal_frame = goal['frame']
40+
41+
# if use_webapp is True, goal should be None
42+
self.goal_location = goal['location'] if not use_webapp else None
43+
self.goal_frame = goal['frame'] if not use_webapp else None
4244
self.new_goal = False
4345
self.goal_pose = None
4446
self.start_pose = None
@@ -140,7 +142,8 @@ def update(self, state: AllState):
140142
print("============== Next state:", mission.type)
141143

142144
# Reach the end of the route, begin to search for parking
143-
elif mission.type == MissionEnum.SUMMONING_DRIVE:
145+
# elif mission.type == MissionEnum.SUMMONING_DRIVE:
146+
elif mission.type == MissionEnum.SUMMON_DRIVING:
144147
mission.goal_pose = self.goal_pose
145148
if route:
146149
_, closest_index = route.closest_point([vehicle.pose.x, vehicle.pose.y], edges=False)
@@ -164,7 +167,7 @@ def update(self, state: AllState):
164167

165168
if self.flag_use_webapp:
166169
data = {
167-
"status": mission.planner_type.name
170+
"status": mission.type.name
168171
}
169172
print("POST:", data)
170173
response = requests.post(url=self.url_status, json=data)

GEMstack/onboard/planning/route_planning.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ def update(self, state: AllState):
311311
self.route = None
312312

313313
# Summoning driving mode.
314-
elif mission.type == MissionEnum.SUMMONING_DRIVE:
314+
# elif mission.type == MissionEnum.SUMMONING_DRIVE:
315+
elif mission.type == MissionEnum.SUMMON_DRIVING:
315316
print("I am in SUMMON_DRIVING mode")
316317
if self.route is None:
317318
# Find appropri ate start and goal points that are on the lanes and fix for searching

GEMstack/state/mission.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class MissionEnum(Enum):
1212
RECOVERY_STOP = 4 # abnormal condition detected, must stop now
1313
ESTOP = 5 # estop pressed, must stop now
1414

15-
SUMMONING_DRIVE = 6
15+
# SUMMONING_DRIVE = 6
16+
SUMMON_DRIVING = 6
1617
PARALLEL_PARKING = 7
1718

1819
@dataclass

launch/summoning.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ drive:
1919
mission_planning:
2020
type: SummoningMissionPlanner
2121
args:
22-
use_webapp: false # goal should be defined when use_webapp is false
22+
use_webapp: True # goal should be defined when use_webapp is false
2323
webapp_url: 'https://summon-app-production.up.railway.app/'
2424
# Goal test points for summoning_roadgraph_sim.json, frame is 'start' or 'cartesian'.
2525
# Key points:[0, 0], [0, 30], [37.5, 7.5], [33, 12],[28.5, 7.5],[15, 3], [1.5, 7.5], [15, 12], [-3, 12], [-7.5, 7.5]
@@ -29,7 +29,8 @@ drive:
2929
# [-88.235527, 40.0927436], [-88.235968, 40.0927432], [-88.236046, 40.0927917], [-88.236008, 40.0928604], [-88.235905, 40.0927917]
3030
goal: {'location':[1, 0], 'frame':'start'}
3131
# goal: {'location':[5, -3], 'frame':'cartesian'}
32-
state_machine: [MissionEnum.IDLE, MissionEnum.SUMMONING_DRIVE, MissionEnum.PARALLEL_PARKING]
32+
# state_machine: [MissionEnum.IDLE, MissionEnum.SUMMONING_DRIVE, MissionEnum.PARALLEL_PARKING]
33+
state_machine: [MissionEnum.IDLE, MissionEnum.SUMMON_DRIVING, MissionEnum.PARALLEL_PARKING]
3334
route_planning:
3435
type: SummoningRoutePlanner
3536
# Arguments: [path/to/roadgraph, map_type, map_frame]

0 commit comments

Comments
 (0)