openpilot
openpilot copied to clipboard
Mazda CX-5 2022: steer from zero
For all other cars minSteerSpeed will not be zero, so behavior will not be changed. And for the CX5 2022, we will only show unavailable alert when leaving standstill (takes a few seconds for steering to become available again which we don't want to ignore).
@alancyau do you mind trying this out?
Tested this branch. The warning went away when the car comes to a stop, but when the lead car starts to accelerate, a Steering Temporarily Unavailable warning pops up and OP will disengage. Here are two instances of that happening.
a4af1602d8e668ac|2022-06-17--17-36-07--3 a4af1602d8e668ac|2022-06-17--17-36-07--4
That should be normal, to openpilot it sees the car not steering and throws the appropriate warning. It shouldn't disengage though
@Jafaral do the Mazdas not steer right away when you engage? Resuming from a stop should be similar, but it takes several seconds to start steering again. Can we somehow reset the EPS so it resumes steering immediately?
@sshane , they do steer right away when you engage, but there is a lag for the EPS to respond for steer commands if it was in an LKAS_BLOCK state. This would be the case if the car was at full stop as @alancyau described. So steer would be unavailable for a brief period in that case.
So I think an alert is fine, and maybe we need a list of cars we know can steer to zero to ignore "faults" and just show a steer unavailable alert
Yeah, in practice the user will hardly notice that steer "warm up" when coming out of a full stop. With ACC, the car is already a bit too slow to accelerate anyway.
In the example I posted to Discord, the user's car didn't start steering until 20 mph or so. It seems like it allowed steering the frame stock ACC disengaged here at around 10 mph (segment 3 of route above), so it probably would have blocked for longer:
The only alert that wouldn't cause a soft disable is the silent steer temp unavailable, but I think we would want a prompt noise when taking off from a stop.

Waiting on a stock route from @alancyau in sng to see what the camera does, odd that it doesn't steer for this long.
Waiting on a stock route from @alancyau in sng to see what the camera does, odd that it doesn't steer for this long.
Which branch did you want a stop and go route for?
Just master, as long as dashcam mode is on (openpilot is disabled).
Any updates? @alancyau
Any updates? @alancyau
I should be able to do a test today and send you a log.
@sshane here’s a log from master-ci in dashcam mode.
a4af1602d8e668ac|2022-06-25--18-10-44--1
@alancyau Did you engage in that route? Most of the time LKAS_BLOCK was 1. We need to see an example where you're stopped behind the lead engaged, the car pulls away, and the Mazda starts steering on its own to know if it's even possible to steer from 0.
I’ll need to do another route. It was only in dashcam mode. Got confused with the requested route.
Yes correct, dashcam mode uses your stock car's system and the C3 just records the data for us. If you can get it to resume from a stop and have the car's stock system steer as soon as possible, that'll be helpful.
@sshane there should be a few SnG in this log running master-ci.
a4af1602d8e668ac|2022-07-01--14-41-25--13
Thanks for that data! But we need a route with the stock system (openpilot turned OFF in the settings) to evaluate how stock handles resuming from a stop, steering wise.
Also looks like openpilot doesn't disengage for temporary steering faults, so if we hide this alert at a standstill and only show when resuming (rightly so, the car's not steering), I think that's fine.
Next best option would be to figure out how to steer earlier though, which is why we need a route with openpilot off, to see if the camera does something different, enabling steering earlier.
@alancyau can you get a new route with the same situations as in that last route?
@sshane that makes sense now. I'll get you another route running the factory ACC/LKAS system tomorrow in similar situation.
Starting with the 2022 CX5, traffic jam assist is offered on the highest Touring trim. I have the lower Select trim. Traffic Jam Assist allows steering below 37mph. I think above 37, Lane Keep Assist takes over. I believe all the trims just run the same EPS, so it's able to accept steering commands below 37.
https://insidemazda.mazdausa.com/press-release/2022-mazda-cx-5-pricing-and-packaging/
Oh, so yours wouldn't be able to steer under 37 with the stock system? Dang, that would have been helpful to see what the camera does. I checked your route and it seems very variable, most of the time it waits until ~10 mph to enable steering, while others (when not engaged) it's 2 mph.
I'm not really sure what the stock system does actually. The marketing brochure is a bit confusing on what Traffic Jam Assist actually does. I'll just test the stock system tomorrow and see what the data looks like.
The brochure says lane departure and lane keep works above 37. The Traffic Jam Assist feature was a little harder to find.

It actually looks like there's a 3.2 second delay coming from a stop, which even exists when not engaged. So I'll fix this PR up to hide the alert when coming to a stop, but I think the alert when resuming is appropriate considering it isn't steering for 3 seconds.

Here’s a log in dashcam mode with ACC and LKAS engaged on release3.
a4af1602d8e668ac|2022-07-02--18-12-53--17
Thanks for the route. It's about as expected, LKAS_BLOCK rises at around 19 m/s on stock, so it's not any better than openpilot.
@alancyau can you try the branch now? I will tune the thresholds through your data and clean the branch up, but this should work
@alancyau can you try the branch now? I will tune the thresholds through your data and clean the branch up, but this should work
Any specific scenarios you’d like to see?
Coming to a stop engaged and resuming from a stop engaged, as many times as possible (so I can verify the time it takes to lose lkas_block). Let me know if it ever shows that alert
Coming to a stop engaged and resuming from a stop engaged, as many times as possible (so I can verify the time it takes to lose lkas_block). Let me know if it ever shows that alert
Just saw this. Which UI alert?
Here’s a log with 4 full stops while engaged running this branch.
a4af1602d8e668ac|2022-07-14--08-32-13--19
The Steering Temporarily Unavailable alert you complained of above is what we're looking to avoid. I'll remove that Steer Unavailable Below 0 mphalert you're getting now and try to replace it with a silent steer fault