Skip to content

Commit 1fff656

Browse files
Make all parameters read-only
1 parent 38b28f9 commit 1fff656

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

battery_state_broadcaster/src/battery_state_broadcaster.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,6 @@ controller_interface::CallbackReturn BatteryStateBroadcaster::on_activate(
245245
return controller_interface::CallbackReturn::FAILURE;
246246
}
247247

248-
// get parameters from the listener in case they were updated
249-
param_listener_->refresh_dynamic_parameters();
250-
params_ = param_listener_->get_params();
251-
252248
uint8_t combined_power_supply_technology;
253249
if (!params_.sensor_name.empty())
254250
{

battery_state_broadcaster/src/battery_state_broadcaster_parameters.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,43 @@ battery_state_broadcaster:
1313
battery_temperature: {
1414
type: bool,
1515
default_value: false,
16+
read_only: true,
1617
description: "Whether to read battery temperature [°C] from this battery's state interface (If unmeasured NaN)."
1718
}
1819
battery_current: {
1920
type: bool,
2021
default_value: false,
22+
read_only: true,
2123
description: "Whether to read battery current [A] from this battery's state interface (If unmeasured NaN)."
2224
}
2325
battery_charge: {
2426
type: bool,
2527
default_value: false,
28+
read_only: true,
2629
description: "Whether to read battery charge [Ah] from this battery's state interface (If unmeasured NaN)."
2730
}
2831
battery_percentage: {
2932
type: bool,
3033
default_value: false,
34+
read_only: true,
3135
description: "Whether to read charge level [%] (0.0 to 100.0) from this battery's state interface. If unmeasured, linear percentage is calculated using min and max voltage parameters (if provided), otherwise NaN."
3236
}
3337
battery_power_supply_status: {
3438
type: bool,
3539
default_value: false,
40+
read_only: true,
3641
description: "Whether to read power supply status (e.g., Charging, Full, see https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/BatteryState.msg) from this battery's state interface. If unmeasured, status is set to unknown."
3742
}
3843
battery_power_supply_health: {
3944
type: bool,
4045
default_value: false,
46+
read_only: true,
4147
description: "Whether to read power supply health (e.g., Good, Overheat, see https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/BatteryState.msg) from this battery's state interface. If unmeasured, health is set to unknown."
4248
}
4349
battery_present: {
4450
type: bool,
4551
default_value: false,
52+
read_only: true,
4653
description: "Whether to read battery presence status (true if battery is present) from this battery's state interface. If unmeasured, the presence will be inferred from the battery voltage value (true if voltage is not NaN and not 0.0, otherwise false)."
4754
}
4855
__map_batteries:

0 commit comments

Comments
 (0)