Go to Post This is a risk. Life is full of risks. FIRST is life... therefore, FIRST is full of risks. - Andy Baker [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 03-15-2016, 06:46 PM
acrilex acrilex is offline
Registered User
AKA: Alexandre Croteau
FRC #5179 (Sénateurs)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Drummondville, QC, CA
Posts: 9
acrilex is an unknown quantity at this point
Drive forward to x inches

Hello,

I have a problem. We are trying to achieve a function to drive to a specific distance, for exemple 10 inches. What I would like to be able to do is call driveToDistance(leftDistance, rightDistance).

We are using encoders, and they are well calibrated. For exemple, if we manually push the robot during 10 feets, RobotMap.driveTrainEncoderLeft.getDistance(); really return 120 inches for the left encoder.

How could we make a function so the robot goes forward to 10 feets using information returned by the encoders? I'm trying to understand PID, but a code exemple would help greatly.

For your information, in our code,
Code:
Left encoder is RobotMap.driveTrainEncoderLeft ;
Right encoder is RobotMap.driveTrainEncodeRight ;

Left motor is RobotMap.driveTrainLeftController ;
Right motor is RobotMap.driveTrainRightController ;

RobotDrive is RobotMap.driveTrainRobotDrive ;
(for tankDrive and arcadeDrive)

Thanks,
Acrilex
Reply With Quote
 


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 07:54 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