Go to Post Proof: Remove the motor from it's mechanical house of bondage and it will operate just fine - Mike Betts [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-02-2013, 12:29
stephmak stephmak is offline
High King of Code--Lead Programmer
FRC #4621
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Georgia
Posts: 15
stephmak is an unknown quantity at this point
Drive System--Variable to Speed Controller

Hello everyone,

I am trying to take a value from a variable that I have transfered from the usual "Joystick.getY();" command and input it into the speed controllers but I am getting the following error: "cannot find symbol symbol: method leftSpeedController(double)" from this line in my code: "leftSpeedController(dJ1Y);".

Here is a bigger segment the bigger picture of what I am trying to do.


public class DriveSubsystem extends Subsystem {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
SpeedController leftSpeedController = RobotMap.driveSubsystemLeftSpeedController;
SpeedController rightSpeedController = RobotMap.driveSubsystemRightSpeedController;
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS


// Put methods for controlling this subsystem
// here. Call these from Commands.

public void initDefaultCommand() {
double dJ1Y; //Variable that will house the y-axis number of
//driverJoystick1.
double dJ2Y; //Variable that will house the y-axis number of
//driverJoystick1
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND

// Set the default command for a subsystem here.
//setDefaultCommand(new MySpecialCommand());
//leftSpeedController = Robot.oi.driverJoystick1.getY(); //gets the position of
//driverJoystick1 and puts it into the variable dJ1Y.
dJ1Y = (Robot.oi.driverJoystick1.getY());//gets the position of
//driverJoystick2 and puts it into the variable DJ2Y.

leftSpeedController(dJ1Y);
}
}


I know there has go to be some common sense answer to this problem that I am missing, but I can't figure it out. Any help would be greatly appreciated.

Thanks!!
__________________
FTC
2011-2012 Bowled Over: Team #5165 Star Cygnus X-1

FRC
2013-2014 Ultimate Ascent: Team #4621 Yotta Robota
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2013, 14:08
Team3266Spencer's Avatar
Team3266Spencer Team3266Spencer is offline
Team Captain and Lead Programmer
AKA: Spencer Lanman
FRC #3266 (Robots-R-US)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Richmond, Indiana
Posts: 280
Team3266Spencer is an unknown quantity at this point
Re: Drive System--Variable to Speed Controller

You can't put leftSpeedController(double) on that line near the end. You need to call a method from that object that sets its speed to the double. I havn't worked with robot builder or whatever you're using but NetBeans should give you a list of options if you type "leftSpeedController." I'm guessing it will be "leftSpeedController.set(double);" set(double speed) being the method you actually want. What you're telling it to do right now is to call the method leftSpeedController(double d) which is non-existent.
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
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 09:51.

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