コード例 #1
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.route_file_path = Path(self.agent_settings.waypoint_file_path)
        self.pid_controller = PIDController(agent=self,
                                            steering_boundary=(-1, 1),
                                            throttle_boundary=(0, 1))
        self.mission_planner = WaypointFollowingMissionPlanner(agent=self)
        # initiated right after mission plan

        self.behavior_planner = BehaviorPlanner(agent=self)
        self.local_planner = DWAPlanner(agent=self,
                                        controller=self.pid_controller,
                                        mission_planner=self.mission_planner,
                                        behavior_planner=self.behavior_planner,
                                        closeness_threshold=1)

        self.occupancy_map = OccupancyGridMap(absolute_maximum_map_size=1000,
                                              world_coord_resolution=1,
                                              occu_prob=0.99,
                                              max_points_to_convert=5000,
                                              threaded=True)
        self.obstacle_from_depth_detector = ObstacleFromDepth(
            agent=self,
            threaded=True,
            max_detectable_distance=0.3,
            max_points_to_convert=10000,
            min_obstacle_height=2)
        self.add_threaded_module(self.obstacle_from_depth_detector)
        self.add_threaded_module(self.occupancy_map)
コード例 #2
0
    def __init__(self, target_speed=40, **kwargs):
        super().__init__(**kwargs)
        self.target_speed = target_speed
        self.logger = logging.getLogger("PID Agent")
        self.route_file_path = Path(self.agent_settings.waypoint_file_path)
        self.pid_controller = PIDController(agent=self,
                                            steering_boundary=(-1, 1),
                                            throttle_boundary=(0, 1))
        self.mission_planner = WaypointFollowingMissionPlanner(agent=self)
        # initiated right after mission plan

        self.behavior_planner = BehaviorPlanner(agent=self)
        self.local_planner = LoopSimpleWaypointFollowingLocalPlanner(
            agent=self,
            controller=self.pid_controller,
            mission_planner=self.mission_planner,
            behavior_planner=self.behavior_planner,
            closeness_threshold=1)
        self.occupancy_map = OccupancyGridMap(agent=self, threaded=True)
        self.obstacle_from_depth_detector = ObstacleFromDepth(agent=self,
                                                              threaded=True)
        self.add_threaded_module(self.obstacle_from_depth_detector)
        self.add_threaded_module(self.occupancy_map)

        self.logger.debug(f"Waypoint Following Agent Initiated. Reading f"
                          f"rom {self.route_file_path.as_posix()}")
コード例 #3
0
ファイル: recording_agent.py プロジェクト: moonwonlee/ROAR
    def __init__(self, target_speed=20, **kwargs):
        super().__init__(**kwargs)
        # ensure recording status is ON
        self.agent_settings.save_sensor_data = True
        super().__init__(**kwargs)
        self.target_speed = target_speed
        self.logger = logging.getLogger("Recording Agent")
        self.route_file_path = Path(self.agent_settings.waypoint_file_path)
        self.pid_controller = PIDController(agent=self, steering_boundary=(-1, 1),
                                            throttle_boundary=(0, 1),
                                            target_speed=target_speed)
        self.mission_planner = WaypointFollowingMissionPlanner(agent=self)
        # initiated right after mission plan

        self.behavior_planner = BehaviorPlanner(agent=self)
        self.local_planner = SimpleWaypointFollowingLocalPlanner(
            agent=self,
            controller=self.pid_controller,
            mission_planner=self.mission_planner,
            behavior_planner=self.behavior_planner,
            closeness_threshold=1)
        self.occupancy_map = OccupancyGridMap(absolute_maximum_map_size=1500,
                                              world_coord_resolution=1,
                                              occu_prob=0.99,
                                              max_points_to_convert=5000,
                                              threaded=True,
                                              should_save=self.agent_settings.save_sensor_data)
        self.obstacle_from_depth_detector = ObstacleFromDepth(agent=self,
                                                              threaded=True,
                                                              max_detectable_distance=0.3,
                                                              max_points_to_convert=10000,
                                                              min_obstacle_height=2)
        self.add_threaded_module(self.obstacle_from_depth_detector)
        self.add_threaded_module(self.occupancy_map)
        self.option = "obstacle_coords"
コード例 #4
0
 def __init__(self, vehicle: Vehicle, agent_settings: AgentConfig,
              **kwargs):
     super().__init__(vehicle, agent_settings, **kwargs)
     self.route_file_path = Path(self.agent_settings.waypoint_file_path)
     self.pid_controller = PIDController(agent=self,
                                         steering_boundary=(-1, 1),
                                         throttle_boundary=(0, 1))
     self.mission_planner = WaypointFollowingMissionPlanner(agent=self)
     # initiated right after mission plan
     self.behavior_planner = BehaviorPlanner(agent=self)
     self.local_planner = SimpleWaypointFollowingLocalPlanner(
         agent=self,
         controller=self.pid_controller,
         mission_planner=self.mission_planner,
         behavior_planner=self.behavior_planner,
         closeness_threshold=1.5)
     self.occupancy_map = OccupancyGridMap(absolute_maximum_map_size=550,
                                           world_coord_resolution=1,
                                           occu_prob=0.99,
                                           max_points_to_convert=5000)
     self.obstacle_from_depth_detector = ObstacleFromDepth(
         agent=self,
         threaded=True,
         max_detectable_distance=0.3,
         max_points_to_convert=10000,
         min_obstacle_height=2)
     self.add_threaded_module(self.obstacle_from_depth_detector)
     self.vis = o3d.visualization.Visualizer()
     self.vis.create_window(width=500, height=500)
     self.pcd = o3d.geometry.PointCloud()
     self.points_added = False
コード例 #5
0
    def __init__(self, vehicle: Vehicle, agent_settings: AgentConfig,
                 **kwargs):
        super().__init__(vehicle, agent_settings, **kwargs)
        self.route_file_path = Path(self.agent_settings.waypoint_file_path)

        self.occupancy_map = OccupancyGridMap(agent=self, threaded=True)
        self.depth_to_obstacle = ObstacleFromDepth(agent=self, threaded=True)
        self.add_threaded_module(self.occupancy_map)
        self.add_threaded_module(self.depth_to_obstacle)
        # occu_map_file_path = Path("./ROAR_Sim/data/easy_map_cleaned_global_occu_map.npy")
        # self.occupancy_map.load_from_file(occu_map_file_path)

        self.pid_controller = PIDController(agent=self,
                                            steering_boundary=(-1, 1),
                                            throttle_boundary=(0, 1))
        self.mission_planner = WaypointFollowingMissionPlanner(agent=self)
        # initiated right after mission plan
        self.behavior_planner = BehaviorPlanner(agent=self)
        self.local_planner = PotentialFieldPlanner(
            agent=self,
            behavior_planner=self.behavior_planner,
            mission_planner=self.mission_planner,
            controller=self.pid_controller)
コード例 #6
0
    def __init__(self, target_speed=40, **kwargs):
        super().__init__(**kwargs)
        self.target_speed = target_speed
        self.logger = logging.getLogger("PID Agent")
        self.route_file_path = Path(self.agent_settings.waypoint_file_path)
        self.pid_controller = PIDController(agent=self,
                                            steering_boundary=(-1, 1),
                                            throttle_boundary=(0, 1))
        self.mission_planner = WaypointFollowingMissionPlanner(agent=self)
        # initiated right after mission plan

        self.behavior_planner = BehaviorPlanner(agent=self)
        self.local_planner = RLLocalPlanner(agent=self,
                                            controller=self.pid_controller)
        self.traditional_local_planner = SimpleWaypointFollowingLocalPlanner(
            agent=self,
            controller=self.pid_controller,
            mission_planner=self.mission_planner,
            behavior_planner=self.behavior_planner,
            closeness_threshold=1.5)
        self.absolute_maximum_map_size, self.map_padding = 1000, 40
        self.occupancy_map = OccupancyGridMap(
            absolute_maximum_map_size=self.absolute_maximum_map_size,
            world_coord_resolution=1,
            occu_prob=0.99,
            max_points_to_convert=10000,
            threaded=True)
        self.obstacle_from_depth_detector = ObstacleFromDepth(
            agent=self,
            threaded=True,
            max_detectable_distance=0.5,
            max_points_to_convert=20000,
            min_obstacle_height=2)
        self.add_threaded_module(self.obstacle_from_depth_detector)
        # self.add_threaded_module(self.occupancy_map)
        self.logger.debug(f"Waypoint Following Agent Initiated. Reading f"
                          f"rom {self.route_file_path.as_posix()}")