Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/more data in train history #49

Merged
merged 15 commits into from
Apr 3, 2024
Merged

Conversation

calbaker
Copy link
Collaborator

Added:

    /// Current link containing head end (i.e. pulling locomotives) of train
    pub head_end_link_idx: u32,
    /// Offset from start of current link
    pub offset_in_link: si::Length,

to TrainState and corresponding code to store this in history

@calbaker calbaker marked this pull request as draft March 29, 2024 16:08
plt.tight_layout()


fig2, ax2 = plt.subplots(3, 1, sharex=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

@@ -151,9 +149,62 @@
ax[-1].set_ylabel('Speed [m/s]')
ax[-1].legend()
plt.suptitle("Speed Limit Train Sim Demo")

fig1, ax1 = plt.subplots(3, 1, sharex=True)
Copy link
Collaborator Author

@calbaker calbaker Mar 29, 2024

Choose a reason for hiding this comment

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

image

@SWRIganderson , I'd sure appreciate some serious scrutiny on this plot and similar plots in other contexts

@SWRIganderson
Copy link
Collaborator

@calbaker I spent some time on Saturday looking into this on Saturday, but I did not finish. So far things look pretty good. The discrepancy that got me sidetracked was the length of the link from the data vs what I was seeing in QGIS. I need to do a bit more digging on that. I'll keep you posted. I should be able to look at it more later today.

@SWRIganderson
Copy link
Collaborator

@calbaker I have run this branch on my machine and inspected the results. I believe it is working correctly. I verified this by saving the data at 1 Hz and comparing the maximum link offset to the length of the link. I did this for the first dozen links in the trip. Everything checked out.

The thing that I also discovered is that the length calculation that is being done by QGIS may not be taking into account elevation or curvature. I have tracked this partially in the QGIS code, but I haven't run it to ground yet. The link below is how far I have tracked it. The screenshot is from QGIS. They have two different ways of calculating distance. The length in the network file is 7596.7 m. We probably need to understand the differences between all of these calculations to make sure we are getting what we think we are. It may be worth opening an issue maybe aroud this?

image

https://github.com/qgis/QGIS/blob/master/src/analysis/processing/qgsalgorithmextractvertices.cpp

@calbaker calbaker marked this pull request as ready for review April 3, 2024 20:16
@calbaker calbaker merged commit a79427a into main Apr 3, 2024
4 checks passed
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