Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 18, 2023
1 parent f7d02ac commit a15fe98
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions nodes/control_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)}, "
Expand Down
2 changes: 1 addition & 1 deletion nodes/planning_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion nodes/sensing_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion nodes/simulation_image_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def distance2imagerow(self, distance):


if __name__ == "__main__":

imageHelper = SimulationImageHelper()
print("y-coordinate of horizon in the image: ", imageHelper.yHorizon)

Expand Down
1 change: 0 additions & 1 deletion nodes/traffic_light_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion nodes/traffic_light_simulator_visu.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


def getTrafficLightVisualization(x, y, header, color):

markerArray = MarkerArray()
header.frame_id = "map"

Expand Down
1 change: 0 additions & 1 deletion nodes/vehicle_control_gui
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a15fe98

Please sign in to comment.