Skip to content

Add length and cumulative lengths to RoadMapElement#425

Open
vcharraut wants to merge 1 commit into
emerge/temp_trainingfrom
data-loading-v0.3
Open

Add length and cumulative lengths to RoadMapElement#425
vcharraut wants to merge 1 commit into
emerge/temp_trainingfrom
data-loading-v0.3

Conversation

@vcharraut
Copy link
Copy Markdown
Collaborator

Support for v0.3 123Drive

Copilot AI review requested due to automatic review settings May 13, 2026 20:35
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for lane length metadata in the Drive binary map loader for 123Drive v0.3.

Changes:

  • Adds length and cum_lengths fields to RoadMapElement.
  • Reads lane length metadata from map binaries.
  • Uses precomputed cumulative lengths for remaining lane distance.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pufferlib/ocean/drive/drive.h Updates binary loading and lane distance calculations.
pufferlib/ocean/drive/datatypes.h Extends road and lane graph data structures and cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1206 to +1211
if (fread(&road->length, sizeof(float), 1, file) != 1) {
fclose(file);
return -1;
}
road->cum_lengths = (float *)malloc(slen * sizeof(float));
if ((size_t)slen > 0 && fread(road->cum_lengths, sizeof(float), slen, file) != (size_t)slen) {
Comment on lines +1441 to +1443
float progress = lane->cum_lengths[closest_seg] +
closest_t * (lane->cum_lengths[closest_seg + 1] - lane->cum_lengths[closest_seg]);
return fmaxf(0.0f, lane->length - progress);
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.

2 participants