nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches

◆ accel_to_angle_diff_check()

bool accel_to_angle_diff_check ( struct accel_to_angle_ctx * ctx,
const struct accel_to_angle_pr_data * pr_threshold_deg,
const uint8_t axis_threshold_num )

#include <include/accel_to_angle/accel_to_angle.h>

Check for significant rotation change.

The function checks if the change in rotation exceeds the specified threshold on at least the specified number of axes. To perform this check, the function uses the cumulative angle difference stored in the context instance, which is updated after each invocation of the accel_to_angle_calc API function using its output parameter.

If the threshold is exceeded the function clears the cumulative difference in the context.

Parameters
[in]ctxPointer to the accel_to_angle_ctx context.
[in]pr_threshold_degRotation threshold in degrees for pitch and roll.
[in]axis_threshold_numNumber of axes that must exceed the threshold to consider the rotation change significant. The value can be either 1 or 2.
Return values
trueIf the rotation change exceeds the threshold on the specified number of axes.
falseOtherwise.