diff --git a/control_data_collecting_tool/scripts/courses/base_course.py b/control_data_collecting_tool/scripts/courses/base_course.py index c741ba96..8246c76b 100644 --- a/control_data_collecting_tool/scripts/courses/base_course.py +++ b/control_data_collecting_tool/scripts/courses/base_course.py @@ -108,7 +108,7 @@ def get_target_velocity( mask_vel_steer, ): return None - + def get_target_pedal_input( self, nearestIndex, @@ -175,4 +175,4 @@ def update_trajectory_points( collected_data_counts_of_vel_acc, collected_data_counts_of_vel_steer, ): - return nearestIndex, *self.return_trajectory_points(yaw_offset, rectangle_center_position) \ No newline at end of file + return nearestIndex, *self.return_trajectory_points(yaw_offset, rectangle_center_position) diff --git a/control_data_collecting_tool/scripts/courses/reversal_loop_circle.py b/control_data_collecting_tool/scripts/courses/reversal_loop_circle.py index 05c61346..29594441 100644 --- a/control_data_collecting_tool/scripts/courses/reversal_loop_circle.py +++ b/control_data_collecting_tool/scripts/courses/reversal_loop_circle.py @@ -826,9 +826,9 @@ def __init__(self, step: float, param_dict): self.trajectory_nearly_straight_clock_wise[self.steer_list[i]] = trajectory # Generate and store counterclockwise trajectories by reversing the clockwise trajectory. - self.trajectory_nearly_straight_counter_clock_wise[ - self.steer_list[i] - ] = reverse_trajectory_segment(trajectory) + self.trajectory_nearly_straight_counter_clock_wise[self.steer_list[i]] = ( + reverse_trajectory_segment(trajectory) + ) # Generate trajectories for changing directions (turning). @@ -1198,16 +1198,22 @@ def get_target_pedal_input( if self.vehicle_phase == "acceleration": target_pedal_input = self.target_accel_pedal_input_on_segmentation + 0.05 * sine if current_time - self.acceleration_start_time > self.max_phase_time: - target_pedal_input = self.params.accel_pedal_input_max / 2 * sine + self.params.accel_pedal_input_max / 2 + target_pedal_input = ( + self.params.accel_pedal_input_max / 2 * sine + + self.params.accel_pedal_input_max / 2 + ) if current_vel > max_velocity: self.vehicle_phase = "deceleration" self.deceleration_start_time = current_time # Handle deceleration phase if self.vehicle_phase == "deceleration": - target_pedal_input = - self.target_brake_pedal_input_on_segmentation - 0.05 * sine + target_pedal_input = -self.target_brake_pedal_input_on_segmentation - 0.05 * sine if current_time - self.deceleration_start_time > self.max_phase_time: - target_pedal_input = - self.params.brake_pedal_input_max / 2 * sine - self.params.brake_pedal_input_max / 2 + target_pedal_input = ( + -self.params.brake_pedal_input_max / 2 * sine + - self.params.brake_pedal_input_max / 2 + ) if current_vel < 0.05: self.updated_target_velocity = False @@ -1306,4 +1312,4 @@ def get_boundary_points(self): boundary_points.append([point_x, point_y]) # Store the boundary points as a numpy array - self.boundary_points = np.array(boundary_points) \ No newline at end of file + self.boundary_points = np.array(boundary_points) diff --git a/control_data_collecting_tool/scripts/data_collecting_trajectory_publisher.py b/control_data_collecting_tool/scripts/data_collecting_trajectory_publisher.py index bebb1a55..9e210083 100755 --- a/control_data_collecting_tool/scripts/data_collecting_trajectory_publisher.py +++ b/control_data_collecting_tool/scripts/data_collecting_trajectory_publisher.py @@ -568,7 +568,9 @@ def callback_trajectory_generator(self): msg = Bool() msg.data = True self.pub_stop_request_.publish(msg) - self.get_logger().error(f"Control mode {self.CONTROL_MODE} is not supported when the course is {self.COURSE_NAME}") + self.get_logger().error( + f"Control mode {self.CONTROL_MODE} is not supported when the course is {self.COURSE_NAME}" + ) elif ( self.CONTROL_MODE == "external_acceleration_cmd" or self.CONTROL_MODE == "external_actuation_cmd"