Skip to content

Commit cbcce08

Browse files
Added slight change to give better error code printing
1 parent e80abdc commit cbcce08

1 file changed

Lines changed: 23 additions & 16 deletions

File tree

src/jsd/actuator_fsm_helpers.cc

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -548,26 +548,33 @@ bool fastcat::Actuator::IsMotionFaultConditionMet()
548548
}
549549
auto elmo_state_machine_state = GetElmoStateMachineState();
550550
if (last_elmo_state_machine_state_ ==
551-
JSD_ELMO_STATE_MACHINE_STATE_OPERATION_ENABLED &&
552-
elmo_state_machine_state ==
551+
JSD_ELMO_STATE_MACHINE_STATE_OPERATION_ENABLED) {
552+
if (elmo_state_machine_state ==
553553
JSD_ELMO_STATE_MACHINE_STATE_SWITCHED_ON) {
554-
ERROR("%s: Elmo drive state machine transitioned from OPERATION_ENABLED "
555-
"to SWITCHED_ON during motion",
554+
ERROR("%s: Elmo drive state machine transitioned from OPERATION_ENABLED "
555+
"to SWITCHED_ON during motion! This transition should not occur.",
556556
name_.c_str());
557-
fastcat_fault_ = ACTUATOR_FASTCAT_FAULT_INVALID_ELMO_SMS_DURING_MOTION;
558-
return true;
559-
}
560-
561-
if (elmo_state_machine_state ==
562-
JSD_ELMO_STATE_MACHINE_STATE_QUICK_STOP_ACTIVE ||
563-
elmo_state_machine_state ==
564-
JSD_ELMO_STATE_MACHINE_STATE_FAULT_REACTION_ACTIVE ||
565-
elmo_state_machine_state ==
557+
fastcat_fault_ = ACTUATOR_FASTCAT_FAULT_INVALID_ELMO_SMS_DURING_MOTION;
558+
return true;
559+
}
560+
else if (elmo_state_machine_state ==
561+
JSD_ELMO_STATE_MACHINE_STATE_QUICK_STOP_ACTIVE) {
562+
ERROR("%s: Elmo drive state machine transitioned from OPERATION_ENABLED "
563+
"to QUICK_STOP_ACTIVE during motion! Likely due to fastcat fault.",
564+
name_.c_str());
565+
fastcat_fault_ = ACTUATOR_FASTCAT_FAULT_INVALID_ELMO_SMS_DURING_MOTION;
566+
return true;
567+
}
568+
else if (elmo_state_machine_state ==
566569
JSD_ELMO_STATE_MACHINE_STATE_FAULT) {
567-
ERROR("%s: Elmo drive state machine state is off nominal", name_.c_str());
568-
fastcat_fault_ = ACTUATOR_FASTCAT_FAULT_INVALID_ELMO_SMS_DURING_MOTION;
569-
return true;
570+
ERROR("%s: Elmo drive state machine transitioned from OPERATION_ENABLED "
571+
"to FAULT during motion! This fault arose from the drive itself.",
572+
name_.c_str());
573+
fastcat_fault_ = ACTUATOR_FASTCAT_FAULT_INVALID_ELMO_SMS_DURING_MOTION;
574+
return true;
575+
}
570576
}
577+
571578
return false;
572579
}
573580

0 commit comments

Comments
 (0)