autowarefoundation / autoware.universe

https://autowarefoundation.github.io/autoware.universe/
Apache License 2.0
1.01k stars 650 forks source link

Planned trajectory is not aligned with the vehicle's heading when the car is initialized at the intersection. #6443

Closed Kim-mins closed 6 months ago

Kim-mins commented 9 months ago

Checklist

Description

Hi team,

I found that, when the ego vehicle is initialized at the intersection, the generated trajectory is sometimes vertical to the ego vehicle.

Here's the [rviz video] and [launch.log] file.

image

When I checked it several times, this does not occur every time, but sometimes.

Expected behavior

I want the generated trajectory to be aligned with the ego vehicle's heading.

Actual behavior

But the generated trajectory is not aligned.

Steps to reproduce

I ran the [planning simulation] with the prebuilt docker, version [20240201] Pointcloud map: [link] Lanelet2 map: [link]

And I set the initial pose at the intersection, and set the goal point somewhere.

Versions

I ran the planning simulation with the prebuilt docker, version [20240201]

Possible causes

It seems the heading is not considered well for some positions of the intersection.

Additional context

I also searched for the similar issues, and I guess https://github.com/autowarefoundation/autoware.universe/issues/6271 could be the similar one, that issue is regarding the backward trajectory though.

VRichardJP commented 9 months ago

I think you face the same problem I face in https://github.com/autowarefoundation/autoware.universe/issues/6271#issuecomment-1920884945:

Beside the backward trajectory which is really weird, I think there is a problem with the way RouteHandler::planPathLaneletsBetweenCheckpoints is implemented:

  1. find all lanelets containing ego pose. If the vehicle is on no lanelet, it looks for the closest lanelet instead (which feels a bit dangerous).
  2. find closest lanelet to goal pose.
  3. for each starting lanelet candidate, check if ego orientation is acceptable and try to generate a route the goal lanelet. Finally keep the route with the shortest length

In your case, the initial pose is located on 2 lanelets (the vehicle shape is ignored), so the route handler has to decide which one in correct.

For 3, the hard coded yaw threshold is 90 degrees (!!), so even a perpendicular lanelet like in your case may be included as candidate. Then, since the goal you have set is located on the right part of the map, the path passing by the perpendicular lanelet is likely shorter than the one passing by the correct lanelet. So eventually the route handler thinks the perpendicular lanelets is the correct one.

As I mentionned in the other issue, I think the starting lanelets (and goal lanelets?) should be classified into more categories. For example (from higher priority to lower):

I am not sure it is a good idea to generate generate a path in the last case.

Kim-mins commented 9 months ago

Thank you for clarifying the issue @VRichardJP!

I read your detailed description, and I agree that this issue is same with yours, because of the point 3.

  1. for each starting lanelet candidate, check if ego orientation is acceptable and try to generate a route the goal lanelet. Finally keep the route with the shortest length

And I think this issue can be resolved if the idea you suggested could be applied. So I'll close this issue soon.

Thank you!

VRichardJP commented 9 months ago

I would rather leave this issue open. The problem is worth fixing and your issue highlights it better than https://github.com/autowarefoundation/autoware.universe/issues/6271 (which focuses on a different problem.)

As a temporary fix, you could reduce this value https://github.com/autowarefoundation/autoware.universe/blob/c67bbe75dc7e2bad43aa8a75fe43d94c8f1c6f78/planning/route_handler/src/route_handler.cpp#L2138.

Kim-mins commented 9 months ago

Thank you for reopening, and your patch suggestion!

Your patch seems to reduces yaw threshold and I think it would work! I'll try it.

And I'll check your issue too in my spare time, so that I can sync this issue with yours.

Thanks!

danielsanchezaran commented 8 months ago

@Kim-mins could you check if this PR solves the issue on your side? https://github.com/autowarefoundation/autoware.universe/pull/6550

Kim-mins commented 8 months ago

Sorry for late reply @danielsanchezaran.

I tried to test your PR, but I failed to run the latest version now. I mainly run Autoware with docker, so I think I can try after docker image with Autoware version 20240315 being uploaded. I'll test and tell you the result as soon as possible.

Thank you!

Kim-mins commented 6 months ago

Sorry for late reply @danielsanchezaran.

I've expected the latest docker image to be uploaded here periodically, but it seems there's no update anymore.. So I ran the planning simulation of autoware(commit: a79ef50498a6a301446f66e55e834fbc58e78362) with Open AD Kit, but it seems that the issue remains on my side.. Could you please check it for me?

https://github.com/autowarefoundation/autoware.universe/assets/50267797/cc19a3e9-c671-4486-8e52-589872c3b762

idorobotics commented 6 months ago

cc @oguzkaganozt

danielsanchezaran commented 6 months ago

Sorry for late reply @danielsanchezaran.

I've expected the latest docker image to be uploaded here periodically, but it seems there's no update anymore.. So I ran the planning simulation of autoware(commit: a79ef50498a6a301446f66e55e834fbc58e78362) with Open AD Kit, but it seems that the issue remains on my side.. Could you please check it for me?

Kazam_screencast_00050.mp4

Can you give me the autoware.universe commit hash please? Did you check the commit I mentioned is already merged into your branch? I fail to reproduce this problem.

Kim-mins commented 6 months ago

Sorry for bothering @danielsanchezaran and @idorobotics.

I thought that Autoware repository determines the version but it wasn't, and I was running the version around 20240223. I should have checked it more. I tested with the latest version, and it works as intended.

Thank you for spending time for me! I'll close this issue soon.

danielsanchezaran commented 6 months ago

@Kim-mins no problem, thanks for reporting the issue, I am glad it was solved.