View Single Post
  #8   Spotlight this post!  
Unread 06-02-2015, 21:44
FleventyFive FleventyFive is offline
Registered User
FRC #4118
 
Join Date: Sep 2014
Location: Gainesville, FL
Posts: 23
FleventyFive is on a distinguished road
Re: Assistance with RobotBuilder and Drive

Notice how for the InitDefaultCommand, the function is defined DriveSubsystem::InitDefaultCommand() { //whatever code }. (assuming you built with robotbuilder)

You need to say what class those functions are a part of, they don't know just because they have the same file name as the header file (they are becomming global functions and so are undefined when you call them as part of the DriveSubsystem class) . If the actuators you are calling functions on are part of that subsystem, you also don't need the Robot::driveSubsystem before each of them, though I suppose having it might not break it.

So I think doing this in your DriveSystem.cpp might fix it:
Code:
void  DriveSubsystem::takeJoystickInputs(Joystick *stick)
{
    robotDrive4->MecanumDrive_Cartesian(stick.GetX(), stick.GetY(), stick,GetZ() );
}

void DriveSubsystem::stop()
{
    robotDrive4->StopMotor();
}
I'm not sure about using a pointer or not for using a joystick as a parameter. I usually have joystick values called in the command, than passed into a subsystem function that takes generic floats for x,y, and rotation in the case of Mecanum drive so I can reuse that function in autonomous. Hope this helps, good luck!

Also, is it DriveSubsystem or DriveSystem? You seem to go back and forth in your comments, just make sure it's consistent in your code

Last edited by FleventyFive : 06-02-2015 at 21:49. Reason: fixed
Reply With Quote