From 2b2d421ad954f6f962ea50df783b40fb3942d27a Mon Sep 17 00:00:00 2001 From: Tony Baltovski Date: Fri, 24 Jan 2025 14:25:36 -0500 Subject: [PATCH] Updated thermal ranges. --- .../src/a300/fan_control.cpp | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/clearpath_hardware_interfaces/src/a300/fan_control.cpp b/clearpath_hardware_interfaces/src/a300/fan_control.cpp index 5af8fa7..3ac069e 100644 --- a/clearpath_hardware_interfaces/src/a300/fan_control.cpp +++ b/clearpath_hardware_interfaces/src/a300/fan_control.cpp @@ -84,24 +84,24 @@ class ThermalSensors { sensors = { - {"mcu", ThermalSensor{0, 30, 45, 60}}, - {"fan1", ThermalSensor{5, 30, 45, 60}}, - {"fan2", ThermalSensor{5, 30, 45, 60}}, - {"fan3", ThermalSensor{5, 30, 45, 60}}, - {"fan4", ThermalSensor{5, 30, 45, 60}}, - {"5v_inductor", ThermalSensor{0, 30, 45, 60}}, - {"main_gnd_lug", ThermalSensor{0, 30, 45, 60}}, - {"dcdc_24v", ThermalSensor{0, 30, 45, 60}}, - {"dcdc_12v", ThermalSensor{0, 30, 45, 60}}, - {"battery", ThermalSensor{5, 30, 45, 60}}, - {"pcb_motor1", ThermalSensor{0, 30, 50, 70}}, - {"mcu_motor1", ThermalSensor{0, 30, 50, 70}}, - {"pcb_motor2", ThermalSensor{0, 30, 50, 70}}, - {"mcu_motor2", ThermalSensor{0, 30, 50, 70}}, - {"pcb_motor3", ThermalSensor{0, 30, 50, 70}}, - {"mcu_motor3", ThermalSensor{0, 30, 50, 70}}, - {"pcb_motor4", ThermalSensor{0, 30, 50, 70}}, - {"mcu_motor4", ThermalSensor{0, 30, 50, 70}}, + {"mcu", ThermalSensor{-20, 0, 60, 80}}, + {"fan1", ThermalSensor{-20, 0, 60, 80}}, + {"fan2", ThermalSensor{-20, 0, 60, 80}}, + {"fan3", ThermalSensor{-20, 0, 60, 80}}, + {"fan4", ThermalSensor{-20, 0, 60, 80}}, + {"5v_inductor", ThermalSensor{-20, 0, 60, 80}}, + {"main_gnd_lug", ThermalSensor{-20, 0, 60, 80}}, + {"dcdc_24v", ThermalSensor{-20, 0, 60, 80}}, + {"dcdc_12v", ThermalSensor{-20, 0, 60, 80}}, + {"battery", ThermalSensor{-20, 0, 60, 80}}, + {"pcb_motor1", ThermalSensor{-20, 0, 60, 80}}, + {"mcu_motor1", ThermalSensor{-20, 0, 60, 80}}, + {"pcb_motor2", ThermalSensor{-20, 0, 60, 80}}, + {"mcu_motor2", ThermalSensor{-20, 0, 60, 80}}, + {"pcb_motor3", ThermalSensor{-20, 0, 60, 80}}, + {"mcu_motor3", ThermalSensor{-20, 0, 60, 80}}, + {"pcb_motor4", ThermalSensor{-20, 0, 60, 80}}, + {"mcu_motor4", ThermalSensor{-20, 0, 60, 80}}, }; } @@ -113,7 +113,7 @@ class ThermalSensors } else { - RCLCPP_WARN(rclcpp::get_logger("ThermalSensors"), "Could not find sensor %s", name.c_str()); + RCLCPP_WARN(rclcpp::get_logger("a300_fan_controller"), "Could not find thermal sensor %s", name.c_str()); } } @@ -125,7 +125,7 @@ class ThermalSensors { if (sensor.second.getStatus() >= ThermalStatus::Normal) { - RCLCPP_WARN(rclcpp::get_logger("ThermalSensors"), "Thermal sensor %s has %s", + RCLCPP_WARN(rclcpp::get_logger("a300_fan_controller"), "Thermal sensor %s has %s", sensor.first.c_str(), thermalStatusToString(sensor.second.getStatus()).c_str()); } @@ -182,13 +182,13 @@ class FanController : public rclcpp::Node clearpath_platform_msgs::msg::Fans fans_msg; fans_msg.fans = {fan_value, fan_value, fan_value, fan_value, 0, 0, 0, 0}; fan_publisher_->publish(fans_msg); - RCLCPP_INFO(get_logger(), "Set all fans to: %d", fan_value); + RCLCPP_DEBUG(get_logger(), "Set all fans to: %d", fan_value); } public: - FanController() : Node("fan_controller") + FanController() : Node("a300_fan_controller") { - fan_publisher_ = create_publisher(FAN_CONTROL_TOPIC_NAME, + fan_publisher_ = create_publisher(FAN_CONTROL_TOPIC_NAME, rclcpp::SensorDataQoS()); temp_subscription_ = create_subscription(