Conversation
ConnorNeed
left a comment
There was a problem hiding this comment.
I'll let Darren comment on the human control side more
|
CI/CD pipeline found an issue with building it. Looks like a templating bug since not every motor controller supports current control. A few ways to fix it but I will let you research since templates in C++ are a really cool mechanism. Try to fix it using a template overload but if you can't I am okay with just removing SPX support (We don't use it anyways). https://api.ctr-electronics.com/phoenix/stable/cpp/_control_mode_8h.html You might find: if constexpr (std::is_same_v<X,Y>) {} helpful |
Thanks, I will try and let you know :D |
| } else if (mode == ControlMode::PercentOutput || | ||
| mode == ControlMode::Disabled) { | ||
| this->controller_->Set(mode, control_msg->value); | ||
| } else if (mode == ControlMode::Current){ |
There was a problem hiding this comment.
I have a feeling this is still going to fail to compile. Any reference to ControlMode::Current when ControlMode is templated as ctre::phoenix::motorcontrol::VictorSPXControlMode will not compile.
the if constexpr allows the compiler to evaluate at compile time and ignore inside the brackets if false. All references to ControlMode::Current must be guarded by the is_same_v.
2c7731c to
acaf9fe
Compare
ConnorNeed
left a comment
There was a problem hiding this comment.
Fix the comment, wait for pass then you are good to squash merge
| ControlMode mode = static_cast<ControlMode>(control_msg->mode); | ||
| // CTRE library expects velocity in units/100ms | ||
| if (mode == ControlMode::Velocity) { | ||
| // CTRE library expects velocity in units/100ms |
There was a problem hiding this comment.
I would leave this comment where it was
Added ControlMode::Current to the passthrough conditional block in phoenix_node.hpp.