FrontArm.spin(forward,100,pct);
task::sleep(500);
FrontArm.stop(brakeType::hold);
FrontGroup.spin(reverse,100,pct);
task::sleep(1300);
FrontGroup.stop(brakeType::hold);
goREV(40,12);
FrontGroup.spin(forward,100,pct);
task::sleep(1300);
FrontGroup.stop(brakeType::hold);
goREV(40,3);
task::sleep(500);
turnR(50,90);
goFWD(80,40);
Here is my basic autonomous code for targeting yellow (the right one). When turning 90 degrees, inertial sensor have to work but, after going forward for a while, inertial works. i couldn’t understand this. Can someone help me for my autonomous process?
Connor
March 9, 2022, 6:41am
2
Would it be possible to provide the entire autonomous task function, alongside all functions coded for the auton task?
I couldn’t understand, Could you be more clear?
As in the definition of goRev etc.
oh sorry, i totally forgot it.
void goFWD(int vel,int dist){
Drivetrain.setDriveVelocity(vel,percent);
Drivetrain.driveFor(reverse,dist,inches);
}
void goREV(int vel,int dist){
Drivetrain.setDriveVelocity(vel,percent);
Drivetrain.driveFor(forward,dist,inches);
}
void turnL(int vel,int deg){
Drivetrain.setTurnVelocity(vel,percent);
Drivetrain.turnFor(left,deg,degrees);
}
void turnR(int vel,int deg){
Drivetrain.setTurnVelocity(vel,percent);
Drivetrain.turnFor(right,deg,degrees);
}
1 Like
What makes you think it’s a problem with your inertial sensor? I don’t see any mentions to inertial sensor.
He may have programmed it into the drivetrain in robot-config
pentagram:
When turning 90 degrees, inertial sensor have to work but, after going forward for a while, inertial works.
This sentence is not very clear to me. Could you explain what is happening and not happening?
Did you wait for inertial sensor calibration to finish ?
2 Likes
try
waitUntil(!InertialSensor.isCalibrating());
ofcourse with InertialSensor being the variable for the InertialSensor
Actually my inertial sensor is set for drivetrain in code. How can i do this?
Because i know that inertial sensor movement
Yes, but it doesn’t necessarily do everything for you just because you configured it. Can you please explain your issue again and also send a screenshot of your configuration panel?
1 Like