Skip to content

Mission Planner

__init__(self, vehicle) special ¤

Source code in ROAR_simulation/roar_autonomous_system/planning_module/mission_planner/mission_planner.py
16
17
18
19
def __init__(self, vehicle: Vehicle):
    super().__init__(vehicle=vehicle)
    self.logger = logging.getLogger(__name__)
    self.mission_plan: deque = deque()

run_step(self, vehicle) ¤

Abstract run step function for Mission Planner

Parameters:

Name Type Description Default
vehicle Vehicle

new vehicle state

required

Returns:

Type Description
List[ROAR_simulation.roar_autonomous_system.utilities_module.data_structures_models.Transform]

Plan for next steps

Source code in ROAR_simulation/roar_autonomous_system/planning_module/mission_planner/mission_planner.py
21
22
23
24
25
26
27
28
29
30
31
32
def run_step(self, vehicle: Vehicle) -> List[Transform]:
    """
    Abstract run step function for Mission Planner

    Args:
        vehicle: new vehicle state

    Returns:
        Plan for next steps

    """
    return []

A mission planner that takes in a file that contains x,y,z coordinates, formulate into carla.Transform

__init__(self, vehicle, file_path) special ¤

Source code in ROAR_simulation/roar_autonomous_system/planning_module/mission_planner/waypoint_following_mission_planner.py
39
40
41
42
43
44
def __init__(self, vehicle: Vehicle, file_path: Path):
    super().__init__(vehicle=vehicle)
    self.logger = logging.getLogger(__name__)
    self.file_path = file_path
    self.mission_plan = self.produce_mission_plan()
    self.logger.debug("Path Following Mission Planner Initiated.")

produce_mission_plan(self) ¤

Generates a list of waypoints based on the input file path :return a list of waypoint

Source code in ROAR_simulation/roar_autonomous_system/planning_module/mission_planner/waypoint_following_mission_planner.py
46
47
48
49
50
51
52
53
54
55
56
57
def produce_mission_plan(self) -> deque:
    """
    Generates a list of waypoints based on the input file path
    :return a list of waypoint
    """
    mission_plan = deque()
    raw_path: List[List[float]] = self._read_data_file()
    for coord in raw_path:
        if len(coord) == 3 or len(coord) == 6:
            mission_plan.append(self._raw_coord_to_transform(coord))
    self.logger.debug(f"Computed Mission path of length {len(mission_plan)}")
    return mission_plan

run_step(self, vehicle) ¤

Regenerate waypoints from file Find the waypoint that is closest to the current vehicle location. return a mission plan starting from that waypoint

Parameters:

Name Type Description Default
vehicle Vehicle

current state of the vehicle

required

Returns:

Type Description
deque

mission plan that start from the current vehicle location

Source code in ROAR_simulation/roar_autonomous_system/planning_module/mission_planner/waypoint_following_mission_planner.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def run_step(self, vehicle: Vehicle) -> deque:
    """
    Regenerate waypoints from file
    Find the waypoint that is closest to the current vehicle location.
    return a mission plan starting from that waypoint

    Args:
        vehicle: current state of the vehicle

    Returns:
        mission plan that start from the current vehicle location
    """
    super(WaypointFollowingMissionPlanner, self).run_step(vehicle=vehicle)
    self.logger.debug("TO BE IMPLEMENTED")
    return self.produce_mission_plan()