Closed kubark42 closed 2 years ago
The contract stipulates -pi <= angle < pi, but the code delivers -pi <= angle <= pi
-pi <= angle < pi
-pi <= angle <= pi
/** * Make sure that -pi <= angle < pi, * * @param angle * The angle to normalize in radians. * WARNING: Don't use too large angles. */ void utils_norm_angle_rad(float *angle) { while (*angle < -M_PI) { *angle += 2.0 * M_PI; } while (*angle > M_PI) { *angle -= 2.0 * M_PI; } }
It would make sense to fix this, either by adjusting the contract or the deliverable.
C.f. https://github.com/vedderb/bldc/blob/master/utils.c#L73
The contract stipulates
-pi <= angle < pi
, but the code delivers-pi <= angle <= pi
It would make sense to fix this, either by adjusting the contract or the deliverable.
C.f. https://github.com/vedderb/bldc/blob/master/utils.c#L73