View unanswered posts | View active topics It is currently Mon Jan 22, 2018 10:11 pm






Reply to topic  [ 2 posts ] 
RVW Clawbot in Robo-Dunk2 flips over backwards when grabbing 
Author Message
Rookie

Joined: Thu Jul 09, 2015 7:37 pm
Posts: 1
Post 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);

}


Thu Jul 09, 2015 9:34 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Jun 11, 2014 9:59 am
Posts: 115
Post 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.


Tue Jul 21, 2015 9:21 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.