Skip to content

Train length and etcs#11

Open
Roli15 wants to merge 33 commits into
dkouzoup:innochequefrom
Roli15:trainLengthAndEtcs
Open

Train length and etcs#11
Roli15 wants to merge 33 commits into
dkouzoup:innochequefrom
Roli15:trainLengthAndEtcs

Conversation

@Roli15

@Roli15 Roli15 commented Jun 5, 2026

Copy link
Copy Markdown

No description provided.

@dkouzoup dkouzoup left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks a lot for the new MR. I left a couple of comments here and there. As this one is getting pretty big, I suggest that any new code apart from addressing the comments comes in a new branch on your side and eventually MR here.

Comment thread mseetc/etcs.py
@@ -0,0 +1,552 @@
from bisect import bisect_right

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Amazing! I am not able to check the code for correctness so I suggest to add an appropriate unit test eventually. I would export the curves and parameters from the excel we have in a json file and compare them against your output.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

thank you :)

Comment thread mseetc/etcs.py Outdated
Comment thread mseetc/ocp.py

vel0 = (60/3.6)**2
vel_avg = (self.points.index[-1]-self.points.index[0])/(terminalTime-initialTime) * 0.95
vel0 = vel_avg*vel_avg

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Let's add a test that runs all paper simulations and simply checks that solver converges. We might need to slightly adapt the scripts to output solver status. Maybe on a separate PR as this one is getting too big

Comment thread mseetc/track.py
Comment thread mseetc/track.py
tuples = self.sampleClothoid(tuples, clothoidSamplingInterval)

self.curvatures = importTuples(tuples, 'Position [m]', ['Curvature [1/m]'])
self.curvatures["Curvature [1/m]"] = self.curvatures["Curvature [1/m]"].abs()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What's this for? I thought sign is used to defer direction of curve? I understand that force on the train is the same regardless of the direction but I would expect that this is handled in the OCP, or isn't it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Because curvature resistance is symmetric it makes it easier to just use the absolute curvature resistance especially for train-length dependent curvature resistance.

Otherwise if I have a short right turn and then a short left turn with the same radius and I take the average w.r.t. the train length, I might get 0 curvature resistance for this segment.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ok yes, that makes sense, I'm just wondering if we should directly modify the track object or instead the representation of the track inside the OCP, where the force calculation matters. My point is that if one day we want to plot the track in 2D, this abs here would affect the results. I'm also wondering whether we were taking this symmetry appropriately into account before (i.e., both turns result to same force)

Comment thread mseetc/track.py Outdated
Comment thread mseetc/train.py
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