|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
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. |
|
#2
|
||||
|
||||
|
Re: urget help needed with c++ code
I will forward this to my student programmer. Keeping my fingers crossed.
The strange thing is that in practice mode in the pits and on the practice field we are not having any issues. It is only on the FMS that it doesn't work. the only thing that it will do is run the auto correctly and then no teleop. If the auto code is removed then we do not do anything. Looks nice sitting there though.. I am hoping it is related to the *wait command you mentioned. We will find out in 3 hours when we go back to our last day of competition. Thank you very much for your time and suggestions. Aloha |
|
#3
|
||||
|
||||
|
Re: urget help needed with c++ code
Thank you for your help!!
After showing the ideas here it was decided that it was better to start from scratch. A much simpler code was written from scratch with no more waits nor improper use of * Downloaded the code and from then on, all was well.. Except some missed possession calls in the semi finals and a replay I am still not sure why.... Aloha! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|