openpilot
openpilot copied to clipboard
New Mazda Gen 4 Port
Checklist
- [ ] added entry to CarInfo in selfdrive/car/*/values.py and ran
selfdrive/car/docs.py
to generate new docs - [x] test route added to routes.py
- [x] route with openpilot: 164080f7933651c4|2022-12-02--08-05-29--37
- [x] route with stock system: 164080f7933651c4|2022-12-01--16-19-34
@sshane what are the odds we get this port added to release 9.1?
Is this port ready for review? Everything should be in a working, final state?
@sshane Just wondering what the deadline is to get it in 0.9.1 . It's almost ready, just need to finish panda safety limits.
@sshane maybe you can figure out what im doing wrong with my panda safety.
const SteeringLimits MAZDA_2019_STEERING_LIMITS = {
.max_steer = 8000,
.max_rate_up = 45,
.max_rate_down = 80,
.max_rt_delta = 3500,
.max_rt_interval = 250000,
.driver_torque_factor = 1,
.driver_torque_allowance = 1500,
.type = TorqueDriverLimited,
};
if (steer_torque_cmd_checks(desired_torque, -1, MAZDA_2019_STEERING_LIMITS))
{
tx = 0;
}
steer_torque_cmd_checks() returns true when trying to apply torque so I have it disabled for now.
I can check it out when I'm back. Nice work on the port so far!
Thank you thank you!
Once this is merged I will add the auto-resume logic because the stock system requires a button press. I already have long control working but I feel it needs some tweaking and testing. Namely the following distance, stopping distance, and the AEB signal needs to be tested somehow.
Side note, I am hoping you guys will add more variables in cereal to dynamically change following distance and comfort-acceleration settings. Another big issue for me is when accelerating from a stop when the roads are slippery the tires lose traction and OP just floors it 💯 ! Should be fairly easy to detect this situation by comparing wheel speeds against measured accel.
I figured out my issue with the panda safety. It was a type casting issue.
I am having a lot of trouble with the torque tuning. It works pretty good at high speeds with some very minor ping pong, but during a low speed turn it will jerk the wheel and I need to take over. I tried playing with the low_speed_factor table but that just makes it not steer enough. It's like the self centering force is high because as soon as the steer command backs off the steering wheel straightens out fast.
Does this Mazda platform have a steering lockout?
@nuwandavek I found a good simple solution to the non-linear steering torque problem. I created a new function torque_from_lateral_accel_non_linear(). Very simple modification and now I have perfect a steering tune. It would be interesting to see if this applies to the other non-linear vehicles.
It requires an addition to cereal. linear Bool and latAngleFactor Float32. https://github.com/commaai/openpilot/pull/27016
@MoreTore Are you on Discord? Do these cars have any LKAS lockouts?
No you guys ban me lol! Yea there is a lockout timer. Personally I have bypassed them with a ti. Just leave the car in dash cam mode for now.
Have you found a way around the lockout, what does it do?
@adeebshihadeh why was the PR closed?
The author has been banned for advertising a torque interceptor; see this post for some context. If you or someone else would like to pick up this work, feel free to fork and open a new PR.