From 15fb76653bc49371d252fb0072f16a38c4b82f0f Mon Sep 17 00:00:00 2001 From: prestonr Date: Mon, 28 Jul 2025 09:41:34 -0700 Subject: [PATCH] Modifying SaveActuatorPosFile to only save when map is not empty --- src/manager.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/manager.cc b/src/manager.cc index 0b7fa9a..7dec4f3 100644 --- a/src/manager.cc +++ b/src/manager.cc @@ -1202,6 +1202,11 @@ void fastcat::Manager::SaveActuatorPosFile() WARNING("Could not move: %s, file may not exist", pos_file.c_str()); } + if (actuator_pos_map_.empty()) { + WARNING("Actuator position map is empty, skipping save to: %s", pos_file.c_str()); + return; + } + YAML::Node file_node; for (auto pos_pair = actuator_pos_map_.begin(); pos_pair != actuator_pos_map_.end(); ++pos_pair) {