Skip to content

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Feb 27, 2025

verified via safety replay running safety replay and commaai/openpilot#34720

@github-actions github-actions bot added car related to opendbc/car/ ford car safety vehicle-specific safety code labels Feb 27, 2025
@sshane sshane force-pushed the fixup-ford-override-safety branch from 21a8be3 to d7468bc Compare February 27, 2025 10:22
/home/runner/work/opendbc/opendbc/opendbc/safety/safety.h:722:47: warning: Survived: Replaced >= with > [cxx_ge_to_gt]
        const int delta = (desired_angle_last >= 0) ? delta_angle_down_relaxed : delta_angle_up_relaxed;
@sshane
Copy link
Contributor Author

sshane commented Feb 27, 2025

@maxime-desroches is there a way to ignore a mutant? I can kill it, but the resulting code is redundant and not clear why it's there

@sshane sshane changed the title Fixup ford override safety Ford: simplify driver override safety Feb 27, 2025
@sshane sshane changed the title Ford: simplify driver override safety Ford: simplify driver curvature error safety Feb 27, 2025
@sshane sshane changed the title Ford: simplify driver curvature error safety Ford: simplify driver override safety Feb 27, 2025
@sshane sshane changed the title Ford: simplify driver override safety Ford: simplify curvature error safety Feb 27, 2025
lowest_desired_angle = MIN(MAX(lowest_desired_angle, angle_meas.min - limits.max_angle_error - 1), highest_desired_angle_lower);
highest_desired_angle = MAX(MIN(highest_desired_angle, angle_meas.max + limits.max_angle_error + 1), lowest_desired_angle_lower);
// the MAX is to allow the desired angle to hit the edge of the bounds and not require going under it
if (desired_angle_last > highest_desired_angle_error) {
Copy link
Contributor Author

@sshane sshane Feb 27, 2025

Choose a reason for hiding this comment

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

if this were desired_angle_last >= highest_desired_angle_error, the behavior is the same as the else block at the bottom

@sshane sshane force-pushed the fixup-ford-override-safety branch from 91887fd to 5b2bb7e Compare February 27, 2025 11:31
@sshane sshane merged commit 811dc6a into master Feb 27, 2025
9 of 10 checks passed
@sshane sshane deleted the fixup-ford-override-safety branch February 27, 2025 12:58
@sshane sshane mentioned this pull request Feb 28, 2025
eli-davis pushed a commit to eli-davis/opendbc_reference that referenced this pull request Jul 15, 2025
* stash

* stash

* finally pass

* fixes

* and

* simplify into two ifs

* simplify and add comment

* clean up safety

* not here

* probably a misra thng

* TODO

* clean up

* consistent

* fix one safety mutation case, good catch!

* no down

* fix

* misra

* fix a mutation case

* forgot test

* fix two more mutations:

/home/runner/work/opendbc/opendbc/opendbc/safety/safety.h:722:47: warning: Survived: Replaced >= with > [cxx_ge_to_gt]
        const int delta = (desired_angle_last >= 0) ? delta_angle_down_relaxed : delta_angle_up_relaxed;

* i mean this works but it's much less clear

* this isn't entirely correct anyway

* stash

* Revert "stash"

This reverts commit 27f6a64.

* clean up

* more

* more clear

* nop

* more

* to allow

* this sucks

* can also try this

* nope

* ?

* Revert "?"

This reverts commit e9b1685.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car safety vehicle-specific safety code car related to opendbc/car/ ford
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant