You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have no mechanism for reporting errors from the vehicle microcontrollers. This project will send errors over the CAN line and process them on a host machine.
CAN messages can hold 64 bits of data. That's 64 boolean values which can each indicate whether a specific error has occured!
We should have a global "Error" object for each microcontroller which has 64 boolean values. Each project is free to define what errors it will report. For example, a FreeRTOS project should be able to indicate a Stack Overflow error, while the FrontController (which reads pedal positions) should be able to report when a sensor value is out of the expected range.
We will periodically send the Error struct over CAN. Other devices (like our data logger or Raspberry Pi) will log these messages and display them to the developer for debugging.
Tasks
This is a two person project. One member (upper year) will write the firmware to handle and send the messages while the other (first year) will write a command line tool which displays the error statuses. The interface between the two members is a DBC file which describes what each error message means.
Work together on steps 1 and 2, then break off for step 3a and 3b (these represent the bulk of the work for this issue).
You only need to write a CLI platform layer, not stm.
2. Create a CAN DBC for the Errors
There should be 1 message with 64 one-bit signals. You can call the signals error0-error63 for now.
There is no specified recipient for the message, so use Vector__XXX.
Create a config.yaml file to generate the C++ code from the DBC. See the Demo/CAN projects for an example config.
3a. C++ Implementation
A CAN object with 64 booleans has been created for you. Decide how you want to set and clear error bits throughout the program. In your Demo Project, mock up error states. Continuously (every 500 ms) send the CAN message.
3b. CLI Viewer
Create a CLI program, in Go, which reads CAN messages from a CAN socket (talk to me if you need to set up a linux environment).
You can put your code in a folder under racecar/scripts. Choose a cool name for your program (not just CAN_Error_CLI).
Here are some milestones you can strive for:
Print incoming CAN messages to stdout.
Parse the DBC file to print the names of the Errors which are currently set.
Collect multiple instances of the same error message into one location to keep the UI clear.
Allow the user to "Acknowledge" an error to remove it from the screen.
Parse command line flags to ignore specific errors.
Add any other features that you would find helpful when debugging.
* Moved all CANError demo code to branch
* Fixing the config files for the CAN project
* Added sending/logging functionality of errors in CANErrors project
* Reformatted code and added comments for clarity
* Combined all errors into one 64 bit signal in dbc file for easier use
* Created errors class to set/send errors
* Moved bindings to its own file and started using errors class
* Moved class to header file, added enums for errors
* Removed changes for foo/bar config files
* fixed foo config file
* Moved error class/enum to app.h file
* Removed NS section of dbc file, and added more content to readme
* Cleaned up ErrorHandler and main file
* Modified dbc file to create unsigned int
* Refactored app.h to follow naming conventions/best practices, and switch the enum to an enum class
CAN Errors
Number of members: 2
Relevant skills: C++, CAN, Go
Timeline: Mid November
Description
We have no mechanism for reporting errors from the vehicle microcontrollers. This project will send errors over the CAN line and process them on a host machine.
CAN messages can hold 64 bits of data. That's 64 boolean values which can each indicate whether a specific error has occured!
We should have a global "Error" object for each microcontroller which has 64 boolean values. Each project is free to define what errors it will report. For example, a FreeRTOS project should be able to indicate a Stack Overflow error, while the FrontController (which reads pedal positions) should be able to report when a sensor value is out of the expected range.
We will periodically send the Error struct over CAN. Other devices (like our data logger or Raspberry Pi) will log these messages and display them to the developer for debugging.
Tasks
This is a two person project. One member (upper year) will write the firmware to handle and send the messages while the other (first year) will write a command line tool which displays the error statuses. The interface between the two members is a DBC file which describes what each error message means.
Work together on steps 1 and 2, then break off for step 3a and 3b (these represent the bulk of the work for this issue).
1. Start a new Demo Project
This project is your deliverable. Follow these instructions to set it up https://macformula.github.io/racecar/firmware/project-structure/
You only need to write a CLI platform layer, not stm.
2. Create a CAN DBC for the Errors
There should be 1 message with 64 one-bit signals. You can call the signals
error0
-error63
for now.There is no specified recipient for the message, so use
Vector__XXX
.Create a
config.yaml
file to generate the C++ code from the DBC. See theDemo/CAN
projects for an example config.3a. C++ Implementation
A CAN object with 64 booleans has been created for you. Decide how you want to set and clear error bits throughout the program. In your Demo Project, mock up error states. Continuously (every 500 ms) send the CAN message.
3b. CLI Viewer
Create a CLI program, in Go, which reads CAN messages from a CAN socket (talk to me if you need to set up a linux environment).
You can put your code in a folder under
racecar/scripts
. Choose a cool name for your program (not justCAN_Error_CLI
).Here are some milestones you can strive for:
Add any other features that you would find helpful when debugging.
Resources
CAN DBC Files https://www.csselectronics.com/pages/can-dbc-file-database-intro
The text was updated successfully, but these errors were encountered: