-
Notifications
You must be signed in to change notification settings - Fork 43
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
Script to corrupt openpilot routes #43
Conversation
deployed preview: https://43.connect-d5y.pages.devWelcome to new-connect! Make sure to:
Mobile
Desktop |
This PR and its description are massive. Can you clean this up first? This should be like 100 lines, 200 max. |
I've merged all the code into a single file as you directed and brought the code down to ~200 lines. Please check and inform me what further changes you need. I couldn't find anything else to remove from the description either. |
Hey @vishalkrishnads, you have a check falling, but otherwise maybe you should also set this PR to open rather than draft? And probably ping to follow up again. |
Oh cool @knownotunknown I'll set it to open, but the check failing doesn't seem to be related to the build failing or anything. I've been having issues with the cloudflare deployment in this repo for quite a while now. As you can see, the build succeeds but the preview fails, not sure what's going on still. |
Thanks for the PR but I decided to approach this in a different way |
Malformer
This is a python CLI tool to corrupt good openpilot routes in a format that can be easily uploaded to the API. Fixes #39. It uses cereal's
log.capnp
to parse existing logs and create new ones. An obvious disadvantage is having to setup and maintain a python environment within this project, but there doesn't seem to be any JS solutions to effectively handle capnp messages. More on that below.Usage
Make sure to run
pip install -r malformer/requirements.txt
first. There are basically three arguments required for running malformer:-a
or--account
flags-d
or--device
flags-r
or--route
flagsAn example usage with the default values would be
What works?
Basically, any field that you want removed can be removed from the logs. The field name should be specified in the
CAPNP_MAP
dict. Stuff like extending the segment length over 60s is still pending. Once specified, you can use the UI to select which all to remove, no need to edit the file for each route.Why not JavaScript?
Currently, there seem to be 3 choices in JS for processing capnp files/messages:
capnp-ts
- the most robust one, but misses out on the ability to write to capnp filesnode-capnp
- the implementation is slowcapnp-stream
- doesn't seem to offer methods to effectively alter individual objects.