@@ -485,30 +485,30 @@ void FOCMotor::updateTorqueControlType(TorqueControlType new_torque_controller)
485485// - if changing to torque control set target to zero
486486void FOCMotor::updateMotionControlType (MotionControlType new_motion_controller) {
487487 if (controller == new_motion_controller) return ; // no change
488- switch (new_motion_controller)
489- {
490- case MotionControlType::angle:
491- if (controller ! = MotionControlType::angle_openloop) break ;
492- case MotionControlType::angle_openloop:
493- if (controller ! = MotionControlType::angle) break ;
494- // if the previous controller was not angle control
495- // set target to current angle
496- target = shaft_angle;
497- break ;
498- case MotionControlType::velocity:
499- if (controller ! = MotionControlType::velocity_openloop) break ;
500- case MotionControlType::velocity_openloop:
501- if (controller ! = MotionControlType::velocity) break ;
502- // if the previous controller was not velocity control
503- // stop the motor
504- target = 0 ;
505- break ;
506- case MotionControlType::torque:
507- // if torque control set target to zero
508- target = 0 ;
509- break ;
510- default :
511- break ;
488+
489+ switch (new_motion_controller) {
490+ case MotionControlType::angle:
491+ if (controller = = MotionControlType::angle_openloop) break ;
492+ case MotionControlType::angle_openloop:
493+ if (controller = = MotionControlType::angle) break ;
494+ // if the previous controller was not angle control
495+ // set target to current angle
496+ target = shaft_angle;
497+ break ;
498+ case MotionControlType::velocity:
499+ if (controller = = MotionControlType::velocity_openloop) break ;
500+ case MotionControlType::velocity_openloop:
501+ if (controller = = MotionControlType::velocity) break ;
502+ // if the previous controller was not velocity control
503+ // stop the motor
504+ target = 0 ;
505+ break ;
506+ case MotionControlType::torque:
507+ // if torque control set target to zero
508+ target = 0 ;
509+ break ;
510+ default :
511+ break ;
512512 }
513513
514514 // finally set the new controller
0 commit comments