Skip to content

Commit

Permalink
Updated thermal ranges.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonybaltovski committed Jan 24, 2025
1 parent 0f87275 commit 2b2d421
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions clearpath_hardware_interfaces/src/a300/fan_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}},
};
}

Expand All @@ -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());
}
}

Expand All @@ -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());
}

Expand Down Expand Up @@ -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<clearpath_platform_msgs::msg::Fans>(FAN_CONTROL_TOPIC_NAME,
fan_publisher_ = create_publisher<clearpath_platform_msgs::msg::Fans>(FAN_CONTROL_TOPIC_NAME,
rclcpp::SensorDataQoS());

temp_subscription_ = create_subscription<clearpath_platform_msgs::msg::Temperature>(
Expand Down

0 comments on commit 2b2d421

Please sign in to comment.