Hi we are currently working on our autonomous program and I was wondering what do you guys do during the autonomous period?
So far we take out the ball from under a cap and we score 2 high and 1 low flags.
A really simple starting code is to shoot your preload and then toggle the lower flag. Not a whole lot to go wrong.
Parking on the alliance platform from the back tile is pretty useful, especially if the auton bonus is close. I would suggest having a few autons you can choose from, and do so to complement your partner’s abilities.
is it possible to make a program to toggle low flag and then park on to alliance platform???
if it is can u post a video???
I don’t have a vid, but it’s definitely possible. You would just drive forward, drive backward, turn, drive more, straighten up, then mount the platform.
Or just drive forward, drive backward, turn towards the platform, then drive forward until you’re on it.
Unless the rules prohibit it, anything you can code into your autonomous routine you can execute.
i have a problem because it would have to drive backwards on the platform because of the claw
Okay, so you just have it mount the platform backwards. The encoder counts would be in reverse, then. That’s no issue. You don’t have to turn facing the platform to climb it effectively.
ok im am cortex though
this is program so far just to hit the flag
#pragma config(Motor, port2, frontRightMotor, tmotorVex393_MC29, openLoop, reversed, driveRight)
#pragma config(Motor, port3, frontLeftMotor, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port4, backLeftMotor, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port5, backRightMotor, tmotorVex393_MC29, openLoop, reversed, driveRight)
#pragma config(Motor, port7, clawMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, armMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, armMotor, tmotorVex393_MC29, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
/---------------------------------------------------------------------------/
/* /
/ Description: Competition template for VEX EDR /
/ /
/---------------------------------------------------------------------------*/
// This code is for the VEX cortex platform
#pragma platform(VEX2)
// Select Download method as “competition”
#pragma competitionControl(Competition)
//Main competition background code…do not modify!
#include “Vex_Competition_Includes.c”
/---------------------------------------------------------------------------/
/* Pre-Autonomous Functions /
/ /
/ You may want to perform some actions before the competition starts. /
/ Do them in the following function. You must return from this function /
/ or the autonomous and usercontrol tasks will not be started. This /
/ function is only called once after the cortex has been powered on and /
/ not every time that the robot is disabled. /
/---------------------------------------------------------------------------*/
void pre_auton()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks
// running between Autonomous and Driver controlled modes. You will need to
// manage all user created tasks if set to false.
bStopTasksBetweenModes = true;
// Set bDisplayCompetitionStatusOnLcd to false if you don't want the LCD
// used by the competition include file, for example, you might want
// to display your team name on the LCD in this function.
// bDisplayCompetitionStatusOnLcd = false;
// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, …
}
/---------------------------------------------------------------------------/
/* /
/ Autonomous Task /
/ /
/ This task is used to control your robot during the autonomous phase of /
/ a VEX Competition. /
/ /
/ You must modify the code to add your own robot specific commands here. /
/---------------------------------------------------------------------------*/
task autonomous()
{
motor(backLeftMotor) = 127;
motor(backRightMotor) = 127;
motor(frontLeftMotor) = 127;
motor(frontRightMotor) = 127;
wait1Msec(4000);
AutonomousCodePlaceholderForTesting();
}
/---------------------------------------------------------------------------/
/* /
/ User Control Task /
/ /
/ This task is used to control your robot during the user control phase of /
/ a VEX Competition. /
/ /
/ You must modify the code to add your own robot specific commands here. /
/---------------------------------------------------------------------------*/
task usercontrol()
{
while(1==1)
{
motor[backRightMotor] = vexRT[Ch2];
motor[frontRightMotor] = vexRT[Ch2];
motor[frontLeftMotor] = vexRT[Ch3];
motor[backLeftMotor] = vexRT[Ch3];
if(vexRT[Btn6U] == 1) //If button 5U is pressed…
{
motor[armMotor] = 127; //…raise the arm.
}
else if(vexRT[Btn6D] == 1) //Else, if button 5D is pressed…
{
motor[armMotor] = -127; //…lower the arm.
}
else //Else (neither button is pressed)…
{
motor[armMotor] = 0; //…stop the arm.
}
if(vexRT[Btn6U] == 1) //If button 5U is pressed…
{
motor[armMotor1] = 127; //…raise the arm.
}
else if(vexRT[Btn6D] == 1) //Else, if button 5D is pressed…
{
motor[armMotor1] = -127; //…lower the arm.
}
else //Else (neither button is pressed)…
{
motor[armMotor1] = 0; //…stop the arm.
}
// Open, close or do not more claw
if(vexRT[Btn5U] == 1) //If Button 6U is pressed…
{
motor[clawMotor] = 127; //…close the gripper.
}
else if(vexRT[Btn5D] == 1) //Else, if button 6D is pressed…
{
motor[clawMotor] = -127; //…open the gripper.
}
else //Else (neither button is pressed)…
{
motor[clawMotor] = 0; //…stop the gripper.
}
}
}
is that ok
i also need to change ports because it is triping the pct
thats why it starts jitering
Yes. It’ll drive forward and hit the flag, depending on how fast your robot moves. Like many others, I would suggest using encoders on at least one of your drive wheels to account for how far the robot actually moves. Timing commands can be very inaccurate depending on field and robot conditions.
ok thanks do u agree about the pct??
and do u have a video on it ???
I don’t have a vid, but the ptc is probably the right move
ya does the motor start jitering if the pct is triped???
like it wants to go but it studers
Sometimes. That’s most likely your issue. It could also be a mechanical issue causing your motors to stall out, but it’s more likely the ptc. I suggested this to you yesterday, as well, I think.