View Single Post
  #1   Spotlight this post!  
Unread 26-01-2017, 16:43
ebernerrd ebernerrd is offline
Registered User
FRC #3236
 
Join Date: Jan 2017
Location: Franklin, MA
Posts: 8
ebernerrd is an unknown quantity at this point
SendableChoosers are causing me grief!

Hello! My name is Eric, and I am the lead programmer for team 3236. This is my first year, and so far, things are going good!

I am attempting to add radio buttons to my SmartDashboard so that I can choose the autonomous mode to run at a specific time. I am running it through a Command based system, as it seemed the easiest and most logical to my head.

In Eclipse, functions like "AddDefault" or "AddObject" do not work when written like this:
Code:
private:
		Teleop *TeleopControls;
		SendableChooser<Command *> *autonomouschooser;
		Command *autonomousCommand;



		virtual void RobotInit() override {
			autonomouschooser->AddDefault("Basic Auto", new AutoDefault());
			SmartDashboard::PutData("Chooser", autonomouschooser);
		}
However, Eclipse recognizes these functions when the code is written as such:
Code:
private:
		Teleop *TeleopControls;
		SendableChooser *autonomouschooser;
		Command *autonomousCommand;



		virtual void RobotInit() override {
			autonomouschooser->AddDefault("Basic Auto", new AutoDefault());
			SmartDashboard::PutData("Chooser", autonomouschooser);
		}
In this case, I get the error "invalid use of template-name 'frc::SendableChooser' without an argument list".

I know that this is not because of an issue of "AutoDefault()" not existing, or anything along those lines.

If anyone has a possible solution or explanation, we'd greatly appreciate it!

Thank you!
-Eric
Reply With Quote