Skip to content

Commit 876962c

Browse files
committed
updated path planner node
1 parent 89bb787 commit 876962c

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

rb_ws/src/buggy/scripts/auton/path_planner.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def compute_traj(
8787
self,
8888
self_pose: Pose,
8989
other_pose: Pose, #Currently NAND's location -- To be Changed
90-
) -> Trajectory:
90+
) -> None:
9191
"""
9292
draw trajectory starting at the current pose and ending at a fixed distance
9393
ahead. For each trajectory point, calculate the required offset perpendicular to the nominal
@@ -193,9 +193,6 @@ def compute_traj(
193193
)
194194
positions = nominal_slice + (passing_offsets[:, None] * nominal_normals)
195195

196-
# prepend current pose
197-
# positions = np.vstack((np.array([self_pose.x, self_pose.y]), positions))
198-
199196
# publish passing targets for debugging
200197
for i in range(len(positions)):
201198
reference_navsat = NavSatFix()
@@ -205,8 +202,4 @@ def compute_traj(
205202
self.debug_passing_traj_publisher.publish(reference_navsat)
206203

207204
local_traj = Trajectory(json_filepath=None, positions=positions)
208-
self.traj_publisher.publish(local_traj.pack(self_pose.x, self_pose.y))
209-
return local_traj, \
210-
local_traj.get_closest_index_on_path(
211-
self_pose.x,
212-
self_pose.y)
205+
self.traj_publisher.publish(local_traj.pack(self_pose.x, self_pose.y))

rb_ws/src/buggy/scripts/auton/trajectory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def pack(self, x, y) -> TrajectoryMsg:
361361
def unpack(trajMsg : TrajectoryMsg):
362362
pos = np.array([trajMsg.easting, trajMsg.northing]).transpose(1, 0)
363363
cur_idx = trajMsg.cur_idx
364-
return Trajectory(positions=pos), cur_idx
364+
return Trajectory(json_filepath=None, positions=pos), cur_idx
365365

366366

367367
if __name__ == "__main__":

0 commit comments

Comments
 (0)