diff --git a/src/manager.cc b/src/manager.cc index b7dc4f2..291c893 100644 --- a/src/manager.cc +++ b/src/manager.cc @@ -1026,12 +1026,30 @@ bool fastcat::Manager::LoadActuatorPosFile() break; } } - if (!actuators_in_topo) { MSG("No actuators found in topology, bypassing saved positions file " "functions"); return true; } + + bool all_absolute_actuators_in_topo = true; + for (auto device = jsd_device_list_.begin(); device != jsd_device_list_.end(); + ++device) { + if ((*device)->GetState()->type == GOLD_ACTUATOR_STATE || + (*device)->GetState()->type == PLATINUM_ACTUATOR_STATE) { + std::shared_ptr actuator = + std::dynamic_pointer_cast(*device); + if (!actuator->HasAbsoluteEncoder()) { + all_absolute_actuators_in_topo = false; + break; + } + } + } + if (all_absolute_actuators_in_topo) { + MSG("Topology contains only actuators with absolute encoders; bypassing processing " + "saved positions file"); + return true; + } if (!actuator_fault_on_missing_pos_file_) { WARNING("YAML parameter \'actuator_fault_on_missing_pos_file\' is FALSE"); @@ -1124,15 +1142,13 @@ bool fastcat::Manager::ValidateActuatorPosFile() } actuator = std::dynamic_pointer_cast(*device); - - auto find_pos_data = actuator_pos_map_.find(dev_name); - if (actuator->HasAbsoluteEncoder()) { MSG("Actuator %s has absolute encoder so does not need saved position", dev_name.c_str()); continue; } + auto find_pos_data = actuator_pos_map_.find(dev_name); if (find_pos_data == actuator_pos_map_.end()) { if (!actuator_fault_on_missing_pos_file_) { WARNING(