We’ve been having some issues with creating a sendable chooser for autos in C++.
We’ve tried two methods, the first being a frc::SendableChooser<frc2::CommandPtr*>
which works, but in the return statement of frc2::CommandPtr RobotContainer::GetAutonomousCommand()
, we can’t find a way to deference m_chooser.GetSelected()
as that is a pointer to a commandptr, not just a commandptr.
The other was an frc::SendableChooser<frc2::Command*>
which lead to us being unable to convert the Command*
to a CommandPtr
. We’d like some advice as to how to properly do a sendable chooser (preferably avoiding frc2::Command*
, as we’ve heard they are not recommended.)