Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions srunner/autoagents/autoware_nodes/autoware_types/waypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,25 @@ def autoware_from_world_coords(self) -> Pose:

orientation = self._get_orientation()

curr_location = carla.Location(self.x, self.y, self.z)
orientation = (
self.client.get_world()
.get_waypoint(
curr_location, project_to_road=True, lane_type=carla.LaneType.Driving
)
.transform.rotation
)

qx, qy, qz, qw = quaternion_from_euler(
orientation.roll, orientation.pitch, round(orientation.yaw, 1)
)

pose.position = ros_point
pose.orientation = Quaternion(
x=orientation["x"],
y=orientation["y"],
z=orientation["z"],
w=orientation["w"],
x=qx,
y=qy,
z=qz,
w=qw,
)

if self.marker_pub is not None:
Expand All @@ -50,7 +63,6 @@ def autoware_from_world_coords(self) -> Pose:
return pose

def _get_orientation(self) -> dict:
curr_location = carla.Location(self.x, self.y, self.z)
point1 = (
self.client.get_world()
.get_map()
Expand Down