Northeastern-Electric-Racing / Cerberus

Our FreeRTOS-based vehicle control application
1 stars 0 forks source link

[CAN] - Create Motor Controller Callback #98

Closed nwdepatie closed 5 months ago

nwdepatie commented 7 months ago

Description

We need to process CAN messages that are sent from the motor controller. This should be done via a callback that processes the data based on the specific CAN message. We should then update some struct to ensure that other tasks can access this new data. (i.e. motor controller sends message indicating measured motor speed, we process that CAN message via the callback, the motor torque task can pull from that data to implement closed loop control of the system)

Acceptance Criteria

Code should be added that implements this callback, and the build check should pass. This should also be able to run in Renode/on hardware

Proposed Solution

I think that this struct should be modified to contain all the CAN IDs that we care about from the motor controller, and the update_mc function should be implemented in dti.c and declared in dti.h. Specifically, here is some info on the motor controller, the most important info in our case is in the CAN manual datasheet