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

liveParams future long-actuator-delayed pitch #25467

Closed
wants to merge 2 commits into from

Conversation

twilsonco
Copy link
Contributor

part of PR stack.

But I don't know how to submit a PR to commaai/openpilot that's comparing two branches in the opgm repo, so the layers of the PR stack will include the commits from the previous.

@twilsonco twilsonco marked this pull request as ready for review August 17, 2022 23:43
@twilsonco twilsonco marked this pull request as draft August 18, 2022 00:30
@twilsonco twilsonco changed the title Pr live future pitch liveParams future long-actuator-delayed pitch Aug 18, 2022
@twilsonco
Copy link
Contributor Author

Route: c11fcb510a549332|2022-08-17--19-03-56

@twilsonco
Copy link
Contributor Author

twilsonco commented Aug 18, 2022

Verification: from posted route
image

And here the long actuator delay is set to 0.15s, and the predicted pitch predicts live params pitch by around 0.15s
image

Here's an image showing how you can pick how far ahead to predict pitch by using farther predicted model pitch values (model.orientation.y[]), as is done in this PR by interpolating through the predicted model values.

image

@twilsonco twilsonco marked this pull request as ready for review August 18, 2022 01:50
@twilsonco
Copy link
Contributor Author

twilsonco commented Aug 18, 2022

I verified that this would work with plot juggler beforehand. That is, I found that I could control the time-amount of pitch prediction by using farther values of model.orientation.y[]. A farther predicted pitch (higher index in orientation.y) will shift the green path to the left, predicting the future pitch by an even greater amount of time, and a closer predicted pitch will move the green path to the right.

However, I also looked into doing this for roll compensation (so that it could be applied in advance of steering actuator delay, the way a human responds to expected changes in roll), but for roll, you don't get the same level of predictive capacity.

Here's a smoothed live-params roll with and without future predicted roll added in (yellow and blue lines respectively), compared to live-params roll (cyan) and calibrated orientationNED pitch (purple). Here I'm using model.orientation.x[10] for the yellow line. That value should be around 0.8s into the future, yet it only predicts the non-predictive smoothed pitch by around 0.1s, and sometimes not at all.

image
image

I speculate this is because the predicted pitch is simply more accurate than the predicted roll. The reason for this is that road pitch changes similarly in rate and magnitude regardless of vehicle. Roll, however, as recorded by a sensor device over a meter above the ground, will vary from vehicle to vehicle based on differences in the vehicle suspension/tire pressure/etc. This makes the data from many different cars much less likely to lead to a consistent result for predicted roll.

Cases where road roll changes gradually and deliberately would be better predicted, but those are also the cases where the difference of 0.2s (steer actuator delay) in actuation is less noticeable to the driver. What I would like to do is make openpilot turn ahead of time for sudden and short-lived changes in road roll, like when passing an intersection on a crowned road, but it seems that may not be possible with the current model predictions. If they were to improve, this method should work for roll as well as it does now for pitch.

@sshane sshane closed this Aug 18, 2022
@twilsonco
Copy link
Contributor Author

I'd like to see an example of where this method produces unreliable results @sshane, @nuwandavek. I've looked at tons and tons of log data and seen that all this does is consistently predict future pitch by the desired amount of time, with very high accuracy.

@nworb-cire nworb-cire deleted the pr-live-future-pitch branch March 26, 2024 22:45
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