mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 12:23:34 +08:00
update msgs fields from camelCase to snake_case so rosidl_generate_interfaces() is able to generate code for ROS IDL files
This commit is contained in:
@@ -322,7 +322,7 @@ MEASAirspeed::voltage_correction(float &diff_press_pa, float &temperature)
|
||||
orb_copy(ORB_ID(system_power), _t_system_power, &system_power);
|
||||
}
|
||||
|
||||
if (system_power.voltage5V_v < 3.0f || system_power.voltage5V_v > 6.0f) {
|
||||
if (system_power.voltage5v_v < 3.0f || system_power.voltage5v_v > 6.0f) {
|
||||
// not valid, skip correction
|
||||
return;
|
||||
}
|
||||
@@ -331,7 +331,7 @@ MEASAirspeed::voltage_correction(float &diff_press_pa, float &temperature)
|
||||
/*
|
||||
apply a piecewise linear correction, flattening at 0.5V from 5V
|
||||
*/
|
||||
float voltage_diff = system_power.voltage5V_v - 5.0f;
|
||||
float voltage_diff = system_power.voltage5v_v - 5.0f;
|
||||
|
||||
if (voltage_diff > 0.5f) {
|
||||
voltage_diff = 0.5f;
|
||||
@@ -347,7 +347,7 @@ MEASAirspeed::voltage_correction(float &diff_press_pa, float &temperature)
|
||||
the temperature masurement varies as well
|
||||
*/
|
||||
const float temp_slope = 0.887f;
|
||||
voltage_diff = system_power.voltage5V_v - 5.0f;
|
||||
voltage_diff = system_power.voltage5v_v - 5.0f;
|
||||
|
||||
if (voltage_diff > 0.5f) {
|
||||
voltage_diff = 0.5f;
|
||||
|
||||
@@ -368,7 +368,7 @@ ADC::update_system_power(hrt_abstime now)
|
||||
system_power_s system_power = {};
|
||||
system_power.timestamp = now;
|
||||
|
||||
system_power.voltage5V_v = 0;
|
||||
system_power.voltage5v_v = 0;
|
||||
|
||||
#if defined(ADC_5V_RAIL_SENSE)
|
||||
|
||||
@@ -376,7 +376,7 @@ ADC::update_system_power(hrt_abstime now)
|
||||
|
||||
if (_samples[i].am_channel == ADC_5V_RAIL_SENSE) {
|
||||
// it is 2:1 scaled
|
||||
system_power.voltage5V_v = _samples[i].am_data * (6.6f / 4096.0f);
|
||||
system_power.voltage5v_v = _samples[i].am_data * (6.6f / 4096.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,8 +402,8 @@ ADC::update_system_power(hrt_abstime now)
|
||||
system_power.servo_valid = BOARD_ADC_SERVO_VALID;
|
||||
|
||||
// OC pins are active low
|
||||
system_power.periph_5V_OC = BOARD_ADC_PERIPH_5V_OC;
|
||||
system_power.hipower_5V_OC = BOARD_ADC_HIPOWER_5V_OC;
|
||||
system_power.periph_5v_oc = BOARD_ADC_PERIPH_5V_OC;
|
||||
system_power.hipower_5v_oc = BOARD_ADC_HIPOWER_5V_OC;
|
||||
|
||||
/* lazily publish */
|
||||
if (_to_system_power != nullptr) {
|
||||
|
||||
@@ -386,8 +386,8 @@ ADC::update_system_power(hrt_abstime now)
|
||||
system_power_s system_power = {};
|
||||
system_power.timestamp = now;
|
||||
|
||||
system_power.voltage5V_v = 0;
|
||||
system_power.voltage3V3_v = 0;
|
||||
system_power.voltage5v_v = 0;
|
||||
system_power.voltage3v3_v = 0;
|
||||
system_power.v3v3_valid = 0;
|
||||
|
||||
/* Assume HW provides only ADC_SCALED_V5_SENSE */
|
||||
@@ -402,7 +402,7 @@ ADC::update_system_power(hrt_abstime now)
|
||||
|
||||
if (_samples[i].am_channel == ADC_SCALED_V5_SENSE) {
|
||||
// it is 2:1 scaled
|
||||
system_power.voltage5V_v = _samples[i].am_data * (ADC_V5_V_FULL_SCALE / 4096.0f);
|
||||
system_power.voltage5v_v = _samples[i].am_data * (ADC_V5_V_FULL_SCALE / 4096.0f);
|
||||
cnt--;
|
||||
|
||||
} else
|
||||
@@ -411,7 +411,7 @@ ADC::update_system_power(hrt_abstime now)
|
||||
{
|
||||
if (_samples[i].am_channel == ADC_SCALED_V3V3_SENSORS_SENSE) {
|
||||
// it is 2:1 scaled
|
||||
system_power.voltage3V3_v = _samples[i].am_data * (ADC_3V3_SCALE * (3.3f / 4096.0f));
|
||||
system_power.voltage3v3_v = _samples[i].am_data * (ADC_3V3_SCALE * (3.3f / 4096.0f));
|
||||
system_power.v3v3_valid = 1;
|
||||
cnt--;
|
||||
}
|
||||
@@ -451,8 +451,8 @@ ADC::update_system_power(hrt_abstime now)
|
||||
system_power.servo_valid = BOARD_ADC_SERVO_VALID;
|
||||
|
||||
// OC pins are active low
|
||||
system_power.periph_5V_OC = BOARD_ADC_PERIPH_5V_OC;
|
||||
system_power.hipower_5V_OC = BOARD_ADC_HIPOWER_5V_OC;
|
||||
system_power.periph_5v_oc = BOARD_ADC_PERIPH_5V_OC;
|
||||
system_power.hipower_5v_oc = BOARD_ADC_HIPOWER_5V_OC;
|
||||
|
||||
/* lazily publish */
|
||||
if (_to_system_power != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user