예제 #1
0
    def plan_act(self, obs):
        nn_obs = self.transform_obs(obs)
        nn_action = self.agent.act(nn_obs)
        steering_angle = self.max_steer * nn_action[0]

        speed = calculate_speed(steering_angle)
        action = np.array([steering_angle, speed])

        return action
예제 #2
0
    def act_pp(self, pos, theta):
        lookahead_point = self._get_current_waypoint(pos)

        if lookahead_point is None:
            return [0, 4.0]

        speed, steering_angle = pure_pursuit_utils.get_actuation(
            theta, lookahead_point, pos, self.lookahead, self.wheelbase)

        speed = calculate_speed(steering_angle)

        return [steering_angle, speed]
예제 #3
0
    def plan_act(self, obs):
        scan = obs['scan']
        ranges = np.array(scan, dtype=np.float)

        steering_angle = self.process_lidar(ranges)

        # speed = 4
        speed = calculate_speed(steering_angle)

        action = np.array([steering_angle, speed])

        return action
예제 #4
0
    def plan_act(self, obs):
        position = obs['state'][0:2]
        theta = obs['state'][2]
        pp_action = self.act_pp(position, theta)
        nn_obs = self.transform_obs(obs, pp_action)

        nn_action = self.agent.act(nn_obs, noise=0)
        self.nn_act = nn_action

        steering_angle = self.modify_references(self.nn_act, pp_action[0])
        speed = calculate_speed(steering_angle)
        action = np.array([steering_angle, speed])

        return action
예제 #5
0
    def plan_act(self, obs):
        self.step_counter += 1
        nn_obs = self.transform_obs(obs)
        self.add_memory_entry(obs, nn_obs)

        nn_action = self.agent.act(nn_obs)
        
        self.observation = obs
        self.nn_state = nn_obs
        self.nn_action = nn_action

        steering_angle = nn_action[0] * self.max_steer
        speed = calculate_speed(steering_angle)
        self.action = np.array([steering_angle, speed])
        
        return self.action
예제 #6
0
    def plan_act(self, obs):
        position = obs['state'][0:2]
        theta = obs['state'][2]
        pp_action = self.act_pp(position, theta)
        nn_obs = self.transform_obs(obs, pp_action)
        self.add_memory_entry(obs, nn_obs)

        self.observation = obs
        nn_action = self.agent.act(nn_obs)
        self.nn_act = nn_action
        self.nn_state = nn_obs
        self.step_counter += 1

        steering_angle = self.modify_references(self.nn_act, pp_action[0])

        speed = calculate_speed(steering_angle)
        self.action = np.array([steering_angle, speed])

        return self.action