Skip to content
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

Creating a Python script to process raw CAN data from the vehicle #14

Open
eymenipek opened this issue Sep 9, 2023 · 5 comments
Open

Comments

@eymenipek
Copy link

I would like to create a script to convert .mdf raw CAN battery data into a pandas dataframe.

@fingertap
Copy link
Collaborator

Can you convert the data into the BatteryData format instead of DataFrame? Maybe I can help with this if you provide a data sample.

@eymenipek
Copy link
Author

Hey Han! For sure, I will try something and share!

@eymenipek
Copy link
Author

The sample data is available here and attached (.dbc is the database and mf4 is the MDF data):
https://www.csselectronics.com/pages/tesla-data-dashboard-telematics-can-bus-grafana#ev-data-pack
Here the example code would be to convert to DataFrame:
from asammdf import MDF df = MDF(File).extract_bus_logging(database_files=database).to_dataframe()
How can we convert to BatteryData?
Sample_Data.zip

@fingertap
Copy link
Collaborator

The definition of BatteryData can be found here. It simply records the meta info of the battery and its cycling history. For each cycle, it records the current, voltage and time (and more) as a timeseries list, in a CycleData object. To convert the data into BatteryData objects, we may need to fill in the meta information and then split the electrical signals into cycles.

@fingertap
Copy link
Collaborator

Hi @eymenipek ! We now reorganized the repo to use a more convenient CLI to handle the data download and preprocessing (#19 ). Will look into this data soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants