I'm planning in programming the natural curve into the driver #27
Replies: 3 comments 20 replies
-
|
Hey, It's awesome to hear that someone is working on new features! I'm currently working on adding a robust testing suite, so the project structure might change a bit, but this shouldn't be an issue (and might take a long time, because I have a bunch of exams in the upcoming weeks). |
Beta Was this translation helpful? Give feedback.
-
|
Some progress, this is looking good (I think): Next step will be reviewing the validation (I see you have a function for that), after that I will proceed with saving the parameters into the config.h file and the other format you have available. After all of that, it comes the driver part. |
Beta Was this translation helpful? Give feedback.
-
|
Hi again, I'm now doing the driver part and I'm very grateful that you made the Test Suit, it is making the whole thing more manageable. I would like to ask how would you like the offset to be handled in the natural curve... I love how rawaccel is handling the transition between the constant part and the curve that's why the offset is in the equation... instead of adding the g_Offset as an extern, I just added it as a parameter for the time being: FP_LONG accel_linear(FP_LONG speed);
FP_LONG accel_power(FP_LONG speed);
FP_LONG accel_classic(FP_LONG speed);
FP_LONG accel_motivity(FP_LONG speed);
FP_LONG accel_natural(FP_LONG speed, FP_LONG n_offset);
FP_LONG accel_jump(FP_LONG speed);
FP_LONG accel_lut(FP_LONG speed);In FunctionHelper.cpp if (x <= params->offset) {
val = 1;
} else {
float limit = params->exponent - 1.0;
float auxiliar_accel = params->accel / std::fabs(limit);
float offset = params->offset;
float n_offset_x = offset - x;
float decay = std::exp(auxiliar_accel * n_offset_x);
if (params->useSmoothing) {
float auxiliar_constant = -limit / auxiliar_accel;
float numerator =
limit * ((decay / auxiliar_accel) - n_offset_x) +
auxiliar_constant;
val = (numerator / x) + 1.0;
} else {
val = limit * (1.0 - (offset - decay * n_offset_x) / x) + 1.0;
}
}
break; |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Greetings, I'm just telling this out loud in case there is already some development into it and to prevent multiple people working on the same.
@AndyFilter you already mentioned how you start with the gui and how you test it on a vm so I already prepared that.
If there's already someone working on it tell me please
Thank you in advance
Beta Was this translation helpful? Give feedback.
All reactions