Go to Post Guys wearing pink, that strikes fear into my heart now :). - Cyberguy34000 [more]
Home
Go Back   Chief Delphi > Technical > Control System
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
  #4   Spotlight this post!  
Unread 29-03-2014, 07:58
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,732
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: urget help needed with c++ code

Something in your auton code looks wrong. I'm bolding the line your should add:

while((fabs(encoderL->GetRaw())<4500||fabs(encoderR->GetRaw())<4500) && t<200)
{
yLeft.Set(0.7);
sLeft.Set(-0.7);
yRight.Set(-0.7);
sRight.Set(0.7);
Wait(0.005);
t++;
}
t = 0;
while((fabs(encoderL->GetRaw())<4700||fabs(encoderR->GetRaw())<4700) && t<200)
{
yLeft.Set(0.4);
sLeft.Set(-0.4);
yRight.Set(-0.4);
sRight.Set(0.4);
Wait(0.005);
t++;
}

Also, in OperatorControl, you're using "angle" as a pointer, which seems unnecessary and dangerous. Change " *angle " everywhere you see it to just " angle ".

I don't see anything obviously wrong with your code. I'd recommend taking out all those Wait calls in OperatorControl, because you'll lose control of the robot for the entire duration of that Wait. So if you're turning and you trigger that Wait(0.25), you'll keep turning for 0.25 sec, no matter what you do on the controls.

Generally, I'd recommend trying the robot in Practice mode, so it runs through Auton and into Teleop in the same sequence it would on the field. I'd also recommend running NetConsole while you're on the field, so you can get any debugging statements or exceptions that will tell you what's killed your robot.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
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 23:41.

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