-
Notifications
You must be signed in to change notification settings - Fork 1.4k
safety: fwd hook config #1954
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
Closed
Closed
safety: fwd hook config #1954
Changes from 5 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
d885b0c
move toyota fwd to tx config
sshane 09b6ecb
don't love this
sshane bff5121
oh nice
sshane 4803ade
closer to top
sshane 649cdd6
Rivian is nice and clean
sshane 4d82389
Nissan is also nice diff
sshane 9d790a8
do GM
sshane 8a3d636
Chrysler
sshane c3933e1
Mazda
sshane 9b72aa2
VW PQ
sshane db7ec1e
sweet wins
sshane cf5aa8b
small wins
sshane 66d489f
hyundai not too bad
sshane 8f9179e
elm and alloutput
sshane 27695a5
ah an actual ford test bug
sshane 1c2c045
forgot to remove these & body
sshane 5d68c09
do subaru. we can't block what is sent on bus 1, so check that
sshane 2fb7103
misra!
sshane e3d4039
forgot to remove these
sshane 125dd29
for now pass tests
sshane e641d0f
use a bool for this
sshane 956071b
Do part of Tesla
sshane b221a68
Merge remote-tracking branch 'upstream/master' into fwd-config
sshane 00e8cfc
fix
sshane 50ab9fb
fix
sshane 28ded4e
Merge remote-tracking branch 'upstream/master' into fwd-config
sshane 9ae80c3
remove
sshane e7bbdfe
whoops
sshane c5bf64f
woo
sshane c0c0b2d
first
sshane 087a8c4
Merge remote-tracking branch 'upstream/master' into fwd-config
sshane 4da0129
more
sshane 06245ec
more
sshane 7dd8098
more
sshane 9d0ad08
these are the same now!
sshane ef02a3e
rm addr check
sshane 73167f1
fix rivian
sshane f91efec
fix gm
sshane 1bd3f89
more
sshane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,12 +13,14 @@ | |||||
do { \ | ||||||
(config).rx_checks = (rx); \ | ||||||
(config).rx_checks_len = sizeof((rx)) / sizeof((rx)[0]); \ | ||||||
(config).fwd_buses = NULL; \ | ||||||
} while (0); | ||||||
|
||||||
#define SET_TX_MSGS(tx, config) \ | ||||||
do { \ | ||||||
(config).tx_msgs = (tx); \ | ||||||
(config).tx_msgs_len = sizeof((tx)) / sizeof((tx)[0]); \ | ||||||
(config).fwd_buses = NULL; \ | ||||||
} while(0); | ||||||
|
||||||
#define UPDATE_VEHICLE_SPEED(val_ms) (update_sample(&vehicle_speed, ROUND((val_ms) * VEHICLE_SPEED_FACTOR))) | ||||||
|
@@ -27,6 +29,7 @@ uint32_t GET_BYTES(const CANPacket_t *msg, int start, int len); | |||||
|
||||||
extern const int MAX_WRONG_COUNTERS; | ||||||
#define MAX_ADDR_CHECK_MSGS 3U | ||||||
#define DEFAULT_FWD_BUS_LEN 2U | ||||||
#define MAX_SAMPLE_VALS 6 | ||||||
// used to represent floating point vehicle speed in a sample_t | ||||||
#define VEHICLE_SPEED_FACTOR 1000.0 | ||||||
|
@@ -49,8 +52,19 @@ typedef struct { | |||||
int addr; | ||||||
int bus; | ||||||
int len; | ||||||
bool blocked; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
makes this more clear |
||||||
} CanMsg; | ||||||
|
||||||
typedef struct { | ||||||
int source_bus; | ||||||
int destination_bus; | ||||||
} FwdBus; | ||||||
|
||||||
const FwdBus DEFAULT_FWD_BUS_LOOKUP[DEFAULT_FWD_BUS_LEN] = { | ||||||
{0, 2}, | ||||||
{2, 0}, | ||||||
}; | ||||||
|
||||||
typedef enum { | ||||||
TorqueMotorLimited, // torque steering command, limited by EPS output torque | ||||||
TorqueDriverLimited, // torque steering command, limited by driver's input torque | ||||||
|
@@ -151,6 +165,8 @@ typedef struct { | |||||
int rx_checks_len; | ||||||
const CanMsg *tx_msgs; | ||||||
int tx_msgs_len; | ||||||
const FwdBus *fwd_buses; | ||||||
int fwd_buses_len; | ||||||
} safety_config; | ||||||
|
||||||
typedef uint32_t (*get_checksum_t)(const CANPacket_t *to_push); | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.