Skip to content

Add lane departure alert for Toyota - #605

Merged
pd0wm merged 18 commits into
commaai:develfrom
arne182:patch-1
May 6, 2019
Merged

pd0wm merged 18 commits into
commaai:develfrom
arne182:patch-1

Conversation

@arne182

@arne182 arne182 commented Apr 15, 2019

Copy link
Copy Markdown
Contributor

No description provided.

@mtourangeau

Copy link
Copy Markdown

Can I test this?

@arne182

arne182 commented Apr 15, 2019

Copy link
Copy Markdown
Contributor Author

Yes @mtourangeau. It is ready now for testing.

@arne182

arne182 commented Apr 15, 2019

Copy link
Copy Markdown
Contributor Author

Requirements. Must drive above 40 kph and cross a lane line without blinking, or at least get to within 15cm of it.

@arne182

arne182 commented Apr 15, 2019

Copy link
Copy Markdown
Contributor Author

Still getting a raise IndexError('Out of bounds') from path_plan.pathPlan.lPoly[3]

Comment thread selfdrive/controls/controlsd.py Outdated
@legonigel
legonigel requested a review from pd0wm April 21, 2019 11:51
@pd0wm

pd0wm commented May 3, 2019

Copy link
Copy Markdown
Contributor

I like the feature!

Since this is only a UI change, and no alerts/sounds are triggered this can be merged without extensive testing for false positives. If we want to add those add some point we should probably follow the same procedure as for FCW: https://medium.com/@comma_ai/bringing-forward-collision-warnings-to-our-open-source-self-driving-car-7545b6e398cd

If my comments are fixed I'll merge it.

Comment thread selfdrive/controls/controlsd.py Outdated
Comment thread selfdrive/controls/controlsd.py Outdated
Comment thread selfdrive/car/toyota/carcontroller.py Outdated
Arne Schwarck added 4 commits May 3, 2019 15:50
leftLaneDepart and rightLaneDepart as False by default according to @pd0wm
right_lane_depart and left_lane_depart to conform with python naming convention
right_lane_depart and left_lane_depart to conform with python naming convention
Comment thread selfdrive/controls/controlsd.py Outdated
CC.hudControl.rightLaneVisible = bool(path_plan.pathPlan.rProb > 0.5)
CC.hudControl.leftLaneVisible = bool(path_plan.pathPlan.lProb > 0.5)
if len(list(path_plan.pathPlan.rPoly)) == 4:
CC.hudControl.rightLaneDepart = bool(path_plan.pathPlan.rPoly[3] > -1.11 and not CS.rightBlinker) and CS.vEgo > 12.5 and bool(path_plan.pathPlan.rProb > 0.5) # Speed needs to be above 12.5m/s for LDA and only if blinker if off

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you wrap the whole expression into one bool?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you mean add the if statement check into the bool as well?

@pd0wm

pd0wm commented May 3, 2019

Copy link
Copy Markdown
Contributor

Thanks for fixing my comments. I added one more small comment.

In the meantime, I'll figure out while CI breaks.

@pd0wm
pd0wm merged commit f504467 into commaai:devel May 6, 2019
ghost pushed a commit to dragonpilot/dragonpilot that referenced this pull request Apr 7, 2020
* Add lane departure alert in controlsd

* Need init values for LDA

* Add lane departure in interface.py

* Include LDA in CarControler

* Add logic for LDA in toyotacan

* Add speed condition and comments for LDA

* Correct right CS.vEgo

* Correct rPoly spelling

* Add left and rightLaneDepart to HUDControl in car.capnp

* Add left and rightLane_Depart in UI function

* set controlsd priority

* revert

* There must be a line to depart from

* Include changes from @pd0wm

* Remove redundant False allocation

leftLaneDepart and rightLaneDepart as False by default according to @pd0wm

* Modify variable names

right_lane_depart and left_lane_depart to conform with python naming convention

* Modify variable names

right_lane_depart and left_lane_depart to conform with python naming convention

* Wrap lane departure warning in one bool
chrispypatt pushed a commit to chrispypatt/openpilot that referenced this pull request Jan 24, 2025
* Sentry: sets environment tag

* master channel

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
66thparallel pushed a commit to 66thparallel/janes_openpilot_fork that referenced this pull request May 1, 2026
* Add lane departure alert in controlsd

* Need init values for LDA

* Add lane departure in interface.py

* Include LDA in CarControler

* Add logic for LDA in toyotacan

* Add speed condition and comments for LDA

* Correct right CS.vEgo

* Correct rPoly spelling

* Add left and rightLaneDepart to HUDControl in car.capnp

* Add left and rightLane_Depart in UI function

* set controlsd priority

* revert

* There must be a line to depart from

* Include changes from @pd0wm

* Remove redundant False allocation

leftLaneDepart and rightLaneDepart as False by default according to @pd0wm

* Modify variable names

right_lane_depart and left_lane_depart to conform with python naming convention

* Modify variable names

right_lane_depart and left_lane_depart to conform with python naming convention

* Wrap lane departure warning in one bool

old-commit-hash: f504467
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.

5 participants