ROBOTC.net forums
http://www.robotc.net/forums/

RVW Clawbot in Robo-Dunk2 flips over backwards when grabbing
http://www.robotc.net/forums/viewtopic.php?f=55&t=11703
Page 1 of 1

Author:  robochamp77 [ Thu Jul 09, 2015 9:34 pm ]
Post subject:  RVW Clawbot in Robo-Dunk2 flips over backwards when grabbing

RVW Clawbot in Robo-Dunk2 flips over backwards when grabbing ball with claw.

Hello. I am attempting to complete a PD course assignment Robo-Dunk2 in RVW using the clawbot. When I attempt to grab the ball the clawbot just flips over backwards and keeps flipping. Thank you in advance for your assistance. I have copied the code below.

#pragma config(StandardModel, "RVW CLAWBOT")
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

void moveStraight(int encoderCount)
{
//Clear Encoders
SensorValue[rightEncoder] = 0;
SensorValue[leftEncoder] = 0;

while(SensorValue[leftEncoder] < encoderCount)
{
if(SensorValue[leftEncoder] > SensorValue[rightEncoder])
{
motor[rightMotor] = 63;
motor[leftMotor] = 50;
}
if(SensorValue[rightEncoder] > SensorValue[leftEncoder])
{
motor[rightMotor] = 50;
motor[leftMotor] = 63;
}
if(SensorValue[leftEncoder] == SensorValue[rightEncoder])
{
motor[rightMotor] = 63;
motor[leftMotor] = 63;
}
}
motor[rightMotor] = 0;
motor[leftMotor] = 0;
}
void openClaw()
{
motor[clawMotor] = -127;
wait1Msec(500);
motor[clawMotor] = 0;
}
void closeClaw()
{
motor[clawMotor] = 32;
wait1Msec(1300);
motor[clawMotor] = 0;
}
void liftArm(int armCount)
{
SensorValue[armIME] = 0;

while(SensorValue[armIME] > armCount)
{
motor[armMotor] = 100;
}
motor[armMotor] = 0;
}
task main()
{
wait1Msec(2000); //Robot waits for 2000 milliseconds before executing program

openClaw();

moveStraight(990);

wait1Msec(2000);

liftArm(-100);

wait1Msec(2000);

closeClaw();

wait1Msec(2000);

liftArm(-200);

wait1Msec(2000);

// moveStraight(990);

}

Author:  lcarrozza [ Tue Jul 21, 2015 9:21 am ]
Post subject:  Re: RVW Clawbot in Robo-Dunk2 flips over backwards when grab

Thank you for notifying us. We will fix this in our next maintenance release.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/