From a15fe98579d3b51cd582aaa0b44e83aa5c466870 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:25:47 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- nodes/control_node.py | 3 +-- nodes/planning_node.py | 2 +- nodes/sensing_node.py | 1 - nodes/simulation_image_helper.py | 1 - nodes/traffic_light_simulator.py | 1 - nodes/traffic_light_simulator_visu.py | 1 - nodes/vehicle_control_gui | 1 - 7 files changed, 2 insertions(+), 8 deletions(-) diff --git a/nodes/control_node.py b/nodes/control_node.py index a3c9867..042f549 100755 --- a/nodes/control_node.py +++ b/nodes/control_node.py @@ -58,7 +58,7 @@ def calc_target_index(self, state, cx, cy, cyaw): dx_vec = fx - np.asarray(cx).reshape([-1, 1]) dy_vec = fy - np.asarray(cy).reshape([-1, 1]) dist = np.hstack([dx_vec, dy_vec]) - dist_2 = np.sum(dist ** 2, axis=1) + dist_2 = np.sum(dist**2, axis=1) target_idx = np.argmin(dist_2) # Project RMS error onto front axle vector @@ -142,7 +142,6 @@ def get_control(self): return self.throttle, self.brake, self.steer, self.gear def _callback(self, message: Trajectory): - rospy.loginfo( "trajectory: " f"x={str(message.x)}, " diff --git a/nodes/planning_node.py b/nodes/planning_node.py index 9d944d5..fa7ace3 100755 --- a/nodes/planning_node.py +++ b/nodes/planning_node.py @@ -103,7 +103,7 @@ def create_trajectory( Z = np.array([lane_coeff.W, lane_coeff.Y_offset, lane_coeff.dPhi, lane_coeff.c0]) for i, u in enumerate(x): - u2 = u ** 2 + u2 = u**2 y[i] = np.dot(np.array([0, -1, -u, 0.5 * u2]), Z) tran_mat = tf_listener.asMatrix("map", lane_coeff.header) diff --git a/nodes/sensing_node.py b/nodes/sensing_node.py index 56d22e9..0cd60ee 100755 --- a/nodes/sensing_node.py +++ b/nodes/sensing_node.py @@ -284,7 +284,6 @@ def compute_lane_from_coeffs(self, Z, maxDist=60, step=0.5): return (x_pred, yl_pred, yr_pred) def limit_lane_coeffs(self, Z_MEst): - # Max of W (lane width) is 5m W_min = 3.5 W_max = 8 diff --git a/nodes/simulation_image_helper.py b/nodes/simulation_image_helper.py index beb1848..d11c9ae 100755 --- a/nodes/simulation_image_helper.py +++ b/nodes/simulation_image_helper.py @@ -118,7 +118,6 @@ def distance2imagerow(self, distance): if __name__ == "__main__": - imageHelper = SimulationImageHelper() print("y-coordinate of horizon in the image: ", imageHelper.yHorizon) diff --git a/nodes/traffic_light_simulator.py b/nodes/traffic_light_simulator.py index 4a99e6d..7e8e6e6 100755 --- a/nodes/traffic_light_simulator.py +++ b/nodes/traffic_light_simulator.py @@ -105,7 +105,6 @@ def execute(self, userdata): while ( (tl_control.automatic) and (rospy.get_time() - t_start < self.duration_s) ) or ((not tl_control.automatic) and (tl_control.event_counter == curr_cnt)): - # check if rospy has been terminated if rospy.is_shutdown(): rospy.logout("Aborting state %s." % (self.color)) diff --git a/nodes/traffic_light_simulator_visu.py b/nodes/traffic_light_simulator_visu.py index 8a0d14f..d5ed844 100644 --- a/nodes/traffic_light_simulator_visu.py +++ b/nodes/traffic_light_simulator_visu.py @@ -12,7 +12,6 @@ def getTrafficLightVisualization(x, y, header, color): - markerArray = MarkerArray() header.frame_id = "map" diff --git a/nodes/vehicle_control_gui b/nodes/vehicle_control_gui index 871fba4..ce65636 100755 --- a/nodes/vehicle_control_gui +++ b/nodes/vehicle_control_gui @@ -54,7 +54,6 @@ class TrafficLightControlSender: class App: def __init__(self, master): - self.pub = rospy.Publisher("prius", Control, queue_size=1) self.traffic_light_control = TrafficLightControlSender() self.mutex = Lock()