Skip to content

Conversation

@ethan10mak
Copy link
Collaborator

@ethan10mak ethan10mak commented Sep 5, 2025

Description

This PR adds support for 3D mode.

  • Elevation parsed from Open Drive files
  • Added mesh generation through the Trimesh library
  • Tested driving simulations through CARLA
  • Updated older test cases to generate in 2D mode

Issue Link

N/A

Checklist

  • I have tested the changes locally via pytest and/or other means
  • I have added or updated relevant documentation
  • I have autoformatted the code with black and isort
  • I have added test cases (if applicable)

Additional Notes

N/A

Made comments to file
Started writing code to parse elevationProfile and lateralProfile elements.
Trying to take 3 dimensional vectors and display them, currently displays visual window, but doesn't show anything
Doesn't quite work yet, but I have differentiated functions such as calc_geometry_for_type() to calculate different things for 2D and 3D
Doesn't work yet, currently facing an error where PolylineRegion and PathRegion are not compatible.
Made sure that all PathRegions created are created through points
Updated the FollowLaneBehavior function to deal with 2d and 3d points
'HardRainSunset'
)
param snapToGroundDefault = is2DMode()
param snapToGroundDefault = True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this change meant to fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was meant to fix the issue of the vehicle clipping into the road when spawning. After testing again to confirm, this change was the primary fix to this issue. Reverting snapToGroundDefault = is2DMode() will cause the vehicle to clip into the road.

Also, changing the height of the vehicle in /driving/model.scenic seems to have no effect on the clipping issue, regardless of if I set snapToGroundDefault to True or False.

code=basicScenario,
useCache=False,
mode2D=use2DMap,
params={"use2DMap": use2DMap, "tolerance": 0.115},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not manually specify the tolerance here unless we have to: it's better to test with the default tolerance, since that's what people will probably use.

param intersection = network.intersectionAt(spot)
""",
mode2D=use2DMap,
params={"use2DMap": use2DMap},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in the other tests, you shouldn't need to specify use2DMap since it will be turned on automatically in 2D mode and otherwise turned off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants