Skip to content

Latest commit

 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAN Definitions

This repository defines the messages on the CAN bus in the car in the form of a DBC database and provides various utilities for generating system configuration files and source code from its contents.

Using Generated Configurations

Generated configurations are stored in this repository in the /out folder. Configurations are version controlled so that we can ensure each part of the system is referring to the same configurations.

To use the generated configuration in a project, add this repo as a submodule. For example:

cd <LOCATION TO CLONE SUBMODULE>
git submodule add https://github.com/sufst/can-defs

Note that the use of submodules will require the following commands to be run when cloning a project for the first time:

git submodule init
git submodule update

For more information on submodules, see the Git submodule documentation.

DBC Files

DBC ("Data Base CAN") is an industry standard file format for defining the content of messages on a CAN bus. Many device vendors provide DBC files for the CAN traffic generated by their devices.

STAG 12 has two CAN buses:

  1. CAN-T ("tractive systems") bus.
  2. CAN-S ("sensor/non-critical systems") bus.

There are many tools for working with DBC files. We suggest the use of Vector CANdb++ which can be downloaded for free as part of the demo version of Vector CANAnalyzer (Windows only). Note also that DBC files can often be imported by CAN datalogger configuration software. We can use this for our MoTeC L120 datalogger to automatically configure the parsing and logging of CAN data.

Telemetry System GENerator (TSGEN)

About

TSGEN is a Python module which generates various parts of the telemetry system based on the DBC for the car. This includes:

The output of this generator is the /out folder, the contents of which can be used by other repositories by including this repository as a submodule.

Do not edit the /out folder directly. If changes are needed, the generator code must be modified.

Setup

Install uv, then:

cd tsgen
uv sync

Usage

From the command line:

uv run tsgen/main.py

Releases

After a new set of configurations are generated, the corresponding commit to main should be tagged with a new version number:

git tag v1.1.2
git push --tags

Other repos using the generated outputs should be updated to the latest release at the same time to ensure they are using the same definitions.

About

Common definitions of messages on the CAN bus and various associated utility scripts

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages