Skip to content

Commit

Permalink
updated path planner node
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackack committed Dec 26, 2024
1 parent 89bb787 commit 876962c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions rb_ws/src/buggy/scripts/auton/path_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def compute_traj(
self,
self_pose: Pose,
other_pose: Pose, #Currently NAND's location -- To be Changed
) -> Trajectory:
) -> None:
"""
draw trajectory starting at the current pose and ending at a fixed distance
ahead. For each trajectory point, calculate the required offset perpendicular to the nominal
Expand Down Expand Up @@ -193,9 +193,6 @@ def compute_traj(
)
positions = nominal_slice + (passing_offsets[:, None] * nominal_normals)

# prepend current pose
# positions = np.vstack((np.array([self_pose.x, self_pose.y]), positions))

# publish passing targets for debugging
for i in range(len(positions)):
reference_navsat = NavSatFix()
Expand All @@ -205,8 +202,4 @@ def compute_traj(
self.debug_passing_traj_publisher.publish(reference_navsat)

local_traj = Trajectory(json_filepath=None, positions=positions)
self.traj_publisher.publish(local_traj.pack(self_pose.x, self_pose.y))
return local_traj, \
local_traj.get_closest_index_on_path(
self_pose.x,
self_pose.y)
self.traj_publisher.publish(local_traj.pack(self_pose.x, self_pose.y))
2 changes: 1 addition & 1 deletion rb_ws/src/buggy/scripts/auton/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def pack(self, x, y) -> TrajectoryMsg:
def unpack(trajMsg : TrajectoryMsg):
pos = np.array([trajMsg.easting, trajMsg.northing]).transpose(1, 0)
cur_idx = trajMsg.cur_idx
return Trajectory(positions=pos), cur_idx
return Trajectory(json_filepath=None, positions=pos), cur_idx


if __name__ == "__main__":
Expand Down

0 comments on commit 876962c

Please sign in to comment.