ukmars / mazerunner-core

Core micromouse software for the ukmarsbot robot
MIT License
20 stars 8 forks source link

Using LOOP_INTERVAL in calculate_steering_adjustment() #8

Closed Nikitarc closed 2 months ago

Nikitarc commented 2 months ago

profile.h calculate_steering_adjustment()

I don't understand the line 151:

float adjustment = (pTerm + dTerm) * LOOP_INTERVAL;

I would have understood dTerm * LOOP_FREQUENCY or dTerm / LOOP_INTERVAL as dTerm is dx/dt.

But why pTerm * LOOP_INTERVAL ?

micromouseonline commented 2 months ago

This is actually in sensors.h and is indeed an error.

Thank you for noticing.

I have push a change that should fix it.