Autonomous

ya i will change it around today thanks for your help i will post photos of the robot today at my two forms thanks

is this an ok comp program? auton is suppost to hit the flag backing up and pulling forward

If your timing commands are right.

I would invest in learning how to use encoders, as they will make your autonomous routines more consistent. Especially when you get into more complicated ones with multiple tasks.

can u explane what encoders are??? sorry first comp

Encoders are little boxes that you mount with an axle running through. It counts the revolutions of the axle in “ticks.” As opposed to timing commands, it’ll track how far the wheels have actually moved.

ok thanks

task autonomous()
{
motor(backLeftMotor) = -127;
motor(backRightMotor) = -127;
motor(frontLeftMotor) = -127;
motor(frontRightMotor) = -127;
wait1Msec(4000);
motor(backLeftMotor) = 127;
motor(backRightMotor) = 127;
motor(frontLeftMotor) = 127;
motor(frontRightMotor) = 127;
wait1Msec(1000);
AutonomousCodePlaceholderForTesting();
}

While this code probably will achieve your objective of reversing into the flag to toggle it, then driving forward and away from it, I would recommend a few changes.

  1. If you’ve got plenty of extra time left in autonomous, you may want to slow down your motor speeds when reversing into the flag. This would reduce the chances of something breaking when the robot hits the wall behind the flag.

  2. It’s generally not very friendly on the motors to suddenly change the speed from -127 to 127. You could consider setting the speed from -127 to 0 (as an intermediate step), perhaps for half a second or so, before setting it from 0 to 127. But it would probably be better to use controllers (e.g. a proportional, or “P” controller) to slow down your motor speeds as you approach the set time of 4000ms.

  3. After the wait1Msec(1000);, you’ll want to set all your motors to 0 or the robot will just keep moving forward.

  4. As others have mentioned, encoders would help to make your movements more consistent, especially for the portion where the robot moves forward after hitting the flag. But when reversing into the flag, you might still want to use timings - if you use encoders, the robot may hit the wall before the target encoder value is set (causing the robot to continuously run against the wall, which might cause stalling).

thanks so much i have wrote the code out with that

True. I used 72 speed on my code with encoders. 63-ish should be about perfect.

A P-loop is really overkill for such a simple code. I would probably leave that out.

You would be amazed at how effective adding a brief braking action at the end of drive actions is. I use a simple P-loop with a brake afterward it is extremely consistent

Do you use rotate to? Because if you did I struggle to see the point of the brake action, maybe it’d help more with preventing driving past with too much momentum.

I’m still using the Cortex system, so I don’t have access to the internal PID of the V5 motors

Don’t worry, the v5 system comes with its own pitfalls, like ports dying, not understanding the extremely complex code I’m trying to write, random disconnects etc. But its definitely an upgrade from the cortex system, and the only true coding issues I’m having is not having waitunitl(); which is really useful, and not having any way to record an autonomous, because as far as I can tell without a debug stream its impossible.

I’ve heard about some people who don’t do exact rerun per se, but they are able to create a new autonomous by putting components together seamlessly to be able to create new autonomous functions extremely quickly.

Wouldn’t you be able to write to the SD card to make rerun with V5?

As far as I know, I can’t find any functions on the c++ pro library that do that, but if you could point the out to me that’d be me.

@MayorMonty are u going to the comp in columbia this weekend???

does anyone know how much time it takes for a robot to do a 90 degree swing turn with a 6 wheel drive terane that looks like this
https://www.google.com/search?q=6+wheel+vex&safe=strict&rlz=1c1gceo_enus821us822&source=lnms&tbm=isch&sa=x&ved=0ahukewieh4lc0afgahws2fkkhwyndfkq_auidigb&biw=1366&bih=626&safe=active&#imgrc=s1uBCGJOgtjTxM:

i have to know this because it needs to go on to the platform

To clarify, a “swing turn” refers to “swinging” one end of the robot around the other. You would power one side of the drive train, and not the other.

Alternatively, you could do a “point turn,” which is rotating around a fixed point in the center of the robot by given each side of the drive train opposite, equal, power. -127 and 127, for example. Or 63 and -63, if you want it to be consistent.

It helps to have encoders, but it can be done with timing. You just have to figure out how long it takes to turn, and then enter that value into your code.

Or, if you want it to be more consistent, you could use a wall to line yourself up. You would just hit it at an angle, and keep driving until your robot is perpendicular to the wall.

here is the autonummus code just to see because i have not tested it and it needs to be tested