|
Re: Autonomous in iterative robot
Hi mikets
Thanks for replying. I am hesitant on putting the code in because they often turn into code critiques rather than try to fix the problem. I'd send it to you as a private message after I clean it up.
We tried lots of different things, tonight including calling classes to make the motors go. The robot is on blocks. Essentially the first case statement reads the encoder to 10K clicks, then switches, then reads between 10K and 20K clicks, and then switches into the final logic which changes state to go to the next case. It resets the encoder to zero, increments the state variable pop's into the control logic in case two and sputters like it's executing 3 different motor speeds simultaneously. What I call iterative choking.
Maybe it is a CANTalon thing. The bigger problem is this was supposed to be a simple proof of concept to have the robot drive in a straight line and stop. So we could measure the actual distance to speed calculations. It's really turned into a major challenge. I am not ruling out operator error at all, however, I am not so certain these statements are really protecting the motors from other code. We checked for break. We will keep checking for logic errors. I will send you the code when I clean it up in a private email.
|