Regen will be hard coded as a single value for the max regen and then input will be 0-1 where that is the fraction of max. In practice, it will be useful to be able to define something like: map the first 50% of pedal travel onto the first 20% of regen and the rest of the pedal travel on 20-100 regen (as an example).
You should discuss with firmware how this can be parameterized so that firmware and software use a compatible standard that can be easily be updated based on the run. This information should also live in the logs for any given run so that sims can recreate any given run.
After you have established a standard with firmware, implement that here. It is likely the definition of pedal travel will vary car by car so make sure it is resilient and that all inputs can be brought down to 0-1 (which is what the sim currently expects)
My very brief thoughts on how to implement this is a set of points on the curve that are interpolated between. Describing the example I made in the first paragraph it might look like a single parameter describing max regen in the params file and the following file imported and linearly interpolated for intermediate values:
pedalTravel,regenPower
0,0
0.5,0.2
1,1
Regen will be hard coded as a single value for the max regen and then input will be 0-1 where that is the fraction of max. In practice, it will be useful to be able to define something like: map the first 50% of pedal travel onto the first 20% of regen and the rest of the pedal travel on 20-100 regen (as an example).
You should discuss with firmware how this can be parameterized so that firmware and software use a compatible standard that can be easily be updated based on the run. This information should also live in the logs for any given run so that sims can recreate any given run.
After you have established a standard with firmware, implement that here. It is likely the definition of pedal travel will vary car by car so make sure it is resilient and that all inputs can be brought down to 0-1 (which is what the sim currently expects)
My very brief thoughts on how to implement this is a set of points on the curve that are interpolated between. Describing the example I made in the first paragraph it might look like a single parameter describing max regen in the params file and the following file imported and linearly interpolated for intermediate values: