@@ -551,30 +551,43 @@ bool fastcat::Actuator::IsMotionFaultConditionMet()
551551 JSD_ELMO_STATE_MACHINE_STATE_OPERATION_ENABLED ) {
552552 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! This transition should not occur." ,
556- name_.c_str ());
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 ==
569- JSD_ELMO_STATE_MACHINE_STATE_FAULT ) {
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 ());
554+ ERROR (" %s: Elmo drive state machine transitioned from %s "
555+ " to %s during motion! This transition should not occur." ,
556+ name_.c_str (),
557+ jsd_elmo_state_machine_state_to_string (last_elmo_state_machine_state_),
558+ jsd_elmo_state_machine_state_to_string (elmo_state_machine_state));
573559 fastcat_fault_ = ACTUATOR_FASTCAT_FAULT_INVALID_ELMO_SMS_DURING_MOTION ;
574560 return true ;
575561 }
562+ }
563+ if (elmo_state_machine_state ==
564+ JSD_ELMO_STATE_MACHINE_STATE_QUICK_STOP_ACTIVE ) {
565+ ERROR (" %s: Elmo drive state machine transitioned from %s "
566+ " to %s during motion! This is likely due to fastcat fault." ,
567+ name_.c_str (),
568+ jsd_elmo_state_machine_state_to_string (last_elmo_state_machine_state_),
569+ jsd_elmo_state_machine_state_to_string (elmo_state_machine_state));
570+ fastcat_fault_ = ACTUATOR_FASTCAT_FAULT_INVALID_ELMO_SMS_DURING_MOTION ;
571+ return true ;
572+ }
573+ else if (elmo_state_machine_state ==
574+ JSD_ELMO_STATE_MACHINE_STATE_FAULT ) {
575+ ERROR (" %s: Elmo drive state machine transitioned from %s "
576+ " to %s during motion! This fault arose from the drive itself." ,
577+ name_.c_str (),
578+ jsd_elmo_state_machine_state_to_string (last_elmo_state_machine_state_),
579+ jsd_elmo_state_machine_state_to_string (elmo_state_machine_state));
580+ fastcat_fault_ = ACTUATOR_FASTCAT_FAULT_INVALID_ELMO_SMS_DURING_MOTION ;
581+ return true ;
582+ }
583+ else if (elmo_state_machine_state ==
584+ JSD_ELMO_STATE_MACHINE_STATE_FAULT_REACTION_ACTIVE ) {
585+ ERROR (" %s: Elmo drive state machine transitioned from %s to "
586+ " to %s during motion! The drive just triggered a fault." ,
587+ name_.c_str (),
588+ jsd_elmo_state_machine_state_to_string (last_elmo_state_machine_state_),
589+ jsd_elmo_state_machine_state_to_string (elmo_state_machine_state));
576590 }
577-
578591 return false ;
579592}
580593
0 commit comments