Go to Post Long Live Gracious Professionalism, and long live F.I.R.S.T. - Matt Krass [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-09-2015, 09:20 PM
Saberbot's Avatar
Saberbot Saberbot is offline
Ask me about Glentite™
AKA: David Ingraham
FRC #4146 (Saguaro Sabercat Robotics)
Team Role: College Student
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Arizona
Posts: 109
Saberbot is just really niceSaberbot is just really niceSaberbot is just really niceSaberbot is just really nice
RobotBuilder not including headers for Default Commands

We were having trouble getting our RobotBuilder generated code to compile. Whenever we set a default command for a subsystem, we would get an error:
Code:
void Elevator::InitDefaultCommand() {
	// Set the default command for a subsystem here.
	//setDefaultCommand(new MySpecialCommand());
	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
	SetDefaultCommand(new ElevatorToBottom());

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
}
Code:
Info: Internal Builder is used for build
arm-frc-linux-gnueabi-g++ -std=c++1y -I/Users/davidingraham/wpilib/cpp/current/include "-I\\$\\{workspace_loc:/2015RobotBuilder/src}" -O0 -g3 -Wall -c -fmessage-length=0 -o src/Subsystems/Elevator.o ../src/Subsystems/Elevator.cpp 
../src/Subsystems/Elevator.cpp: In member function 'virtual void Elevator::InitDefaultCommand()':
../src/Subsystems/Elevator.cpp:62:24: error: expected type-specifier before 'ElevatorToBottom'
  SetDefaultCommand(new ElevatorToBottom());
We were able to fix this by including the header file for the command we wished to set as the default:
Code:
#include "../Commands/ElevatorToBottom.h"
at the top of the "Subsystems/Elevator.cpp" source file.

It seems that RobotBuilder is not automatically including the the header file for the default command in the <subsystem>.cpp file. Is this a bug, or are we expected to add this manually?
__________________

Last edited by Saberbot : 02-10-2015 at 02:04 AM. Reason: clarity
Reply With Quote
  #2   Spotlight this post!  
Unread 02-10-2015, 10:44 PM
JohnSmooth42 JohnSmooth42 is offline
Is writing code
FRC #0375 (The Robotic Plague)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: New York
Posts: 27
JohnSmooth42 is an unknown quantity at this point
Re: RobotBuilder not including headers for Default Commands

In my(pretty limited) experience with the software, it can be pretty buggy.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-17-2015, 09:52 AM
dravis dravis is offline
Registered User
AKA: Ben Randolph
FRC #0663
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2003
Location: Whitinsville
Posts: 5
dravis is an unknown quantity at this point
Re: RobotBuilder not including headers for Default Commands

I had the same problem. Had no problem with default command for one subsystem, but another I had to manually add the header file for another or it wouldn't build.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:10 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi