diff --git a/nodes/control_node.py b/nodes/control_node.py index a3c9867..41ea9aa 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 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)