Skip to content

Commit

Permalink
Merge pull request #1134 from bitcraze/krichardsson/clean-params
Browse files Browse the repository at this point in the history
Remove space in log and param names
  • Loading branch information
krichardsson authored Oct 11, 2022
2 parents ed4b826 + 5faaae3 commit d7786ad
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/hal/src/sensors_bmi088_bmp388.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static void sensorsTask(void *param)
measurement.type = MeasurementTypeGyroscope;
measurement.data.gyroscope.gyro = sensorData.gyro;
estimatorEnqueue(&measurement);

/* Acelerometer */
accScaledIMU.x = accelRaw.x * SENSORS_BMI088_G_PER_LSB_CFG / accScale;
accScaledIMU.y = accelRaw.y * SENSORS_BMI088_G_PER_LSB_CFG / accScale;
Expand Down Expand Up @@ -1005,16 +1005,16 @@ PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, BMP388, &isBarometerPresent)
/**
* @brief Euler angle Phi defining IMU orientation on the airframe (in degrees)
*/
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, IMU Phi, &imuPhi)
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, imuPhi, &imuPhi)

/**
* @brief Euler angle Theta defining IMU orientation on the airframe (in degrees)
*/
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, IMU Theta, &imuTheta)
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, imuTheta, &imuTheta)

/**
* @brief Euler angle Psi defining IMU orientation on the airframe (in degrees)
*/
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, IMU Psi, &imuPsi)
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, imuPsi, &imuPsi)

PARAM_GROUP_STOP(imu_sensors)
10 changes: 5 additions & 5 deletions src/hal/src/sensors_mpu9250_lps25h.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ static void sensorsCalculateVarianceAndMean(BiasObj* bias, Axis3f* varOut, Axis3
sumSq[2] += bias->buffer[i].z * bias->buffer[i].z;
}


meanOut->x = (float) sum[0] / SENSORS_NBR_OF_BIAS_SAMPLES;
meanOut->y = (float) sum[1] / SENSORS_NBR_OF_BIAS_SAMPLES;
meanOut->z = (float) sum[2] / SENSORS_NBR_OF_BIAS_SAMPLES;
Expand Down Expand Up @@ -870,7 +870,7 @@ static void sensorsAlignToAirframe(Axis3f* in, Axis3f* out)
{
// IMU alignment
static float sphi, cphi, stheta, ctheta, spsi, cpsi;

sphi = sinf(imuPhi * (float) M_PI / 180);
cphi = cosf(imuPhi * (float) M_PI / 180);
stheta = sinf(imuTheta * (float) M_PI / 180);
Expand Down Expand Up @@ -998,16 +998,16 @@ PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, LPS25H, &isLPS25HTestPassed)
/**
* @brief Euler angle Phi defining IMU orientation on the airframe (in degrees)
*/
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, IMU Phi, &imuPhi)
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, imuPhi, &imuPhi)

/**
* @brief Euler angle Theta defining IMU orientation on the airframe (in degrees)
*/
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, IMU Theta, &imuTheta)
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, imuTheta, &imuTheta)

/**
* @brief Euler angle Psi defining IMU orientation on the airframe (in degrees)
*/
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, IMU Psi, &imuPsi)
PARAM_ADD(PARAM_FLOAT | PARAM_PERSISTENT, imuPsi, &imuPsi)

PARAM_GROUP_STOP(imu_tests)
6 changes: 6 additions & 0 deletions tools/verify/elf_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ def check_structs(stream, what: str, core: bool) -> dict:
file=sys.stderr)
sys.exit(1)

# Parameter and log names must not contain space as they are mapped to topic in ROS that does not support
# space.
if ' ' in name:
print(f'{Colors.RED}Name contains space(s){Colors.END} ("{name}")', file=sys.stderr)
sys.exit(1)

offset += struct_len
return name_type_dict

Expand Down

0 comments on commit d7786ad

Please sign in to comment.