Skip to content

origin/drive_testing#1

Open
brendafink wants to merge 16 commits into
masterfrom
drive_testing
Open

origin/drive_testing#1
brendafink wants to merge 16 commits into
masterfrom
drive_testing

Conversation

@brendafink
Copy link
Copy Markdown
Collaborator

Before issuing a pull request, please see the contributing page.

Copy link
Copy Markdown

@whitehml whitehml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a quick 5 min look, just a few comments, not an exhaustive review.

Comment thread TeamCode/src/main/java/org/firstinspires/ftc/teamcode/SpiritTeleop.java Outdated
Comment thread TeamCode/src/main/java/org/firstinspires/ftc/teamcode/SpiritTeleop.java Outdated
Comment thread TeamCode/src/main/java/org/firstinspires/ftc/teamcode/SpiritTeleop.java Outdated
Comment thread TeamCode/src/main/java/org/firstinspires/ftc/teamcode/SpiritTeleop.java Outdated
@brendafink
Copy link
Copy Markdown
Collaborator Author

brendafink commented Dec 1, 2025 via email

Comment on lines +241 to +244
leftFront.setDirection(DcMotorSimple.Direction.REVERSE);
//leftBack.setDirection(DcMotorSimple.Direction.REVERSE);
// leftBack.setDirection(DcMotorSimple.Direction.REVERSE);
rightBack.setDirection(DcMotorSimple.Direction.REVERSE);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there is something unique/weird about your wheel motor orientations, this should likely be both left wheels set to reverse & both right wheels set to forward

//------------------------END OF SHOOTER CONTROL-----------------------------------


/* THIS CODE IS NOT NEEDED AND WILL BE DELETED AFTER THE CLASS IS REWRITTEN
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an intermediate note, even if we're not ready for it yet. I understand the desire to save old version in comments "just for reference," but this is what git commits are for. We can, at any time, view what the code looked like at a given commit. I can show you & Braelynn how to make those comparisons in Android Studio.


while (opModeIsActive())
{
if (gamepad2.left_bumper) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a readability/organizational thing, although it gets us one step closer to "proper" coding. We can group these intake-based statements into a void function and call that function at the top of this loop instead.

private void process_intake(Intake intake){
    if (gamepad2.left_bumper) {
    ... // The rest of the intake code
}

This function belongs to the class, in other words, it needs to be defined inside of the class brackets directly, without being inside of another pair of brackets. (Just like how private enum State is defined)

Then, in the runOpMode while loop, replace the if ladder with one line:

process_intake(intake);

Note that we are passing the local variable intake of type Intake into the function. The fact that they function on its end also call's it's parameter intake is not required. Only the types, Intake, have to match, not the name.


if ((gamepad2.right_trigger >.25) && (gamepad2.left_trigger <.01))
{
shooterPower = nearShooterPower;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for an intermediate variable here, you can just set shooter.setShooterPower(nearShooterPower) and so on.

Comment on lines +75 to +80
case RAMPING:
if(getRuntime() > rampUpTimer) {
shooter.setShooterPower(shooterPower);//set power to shooter
currentState = State.LAUNCHING;
}
break;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, I will mention again that you're not supposed to need to set the motor power continuously. Its supposed to run at x% power until told otherwise. If real behavior is different, it seems likely there is a setPower(0) getting triggered somewhere it isn't supposed to.

Comment on lines +86 to +90
carousel.engageShooterServo();
carousel.releaseShooterServo();

//carousel.resetCarousel();
currentState = State.IDLE;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make a boolean function here that handles the servo timings. You'd need a very similar time control to how you handled the rampUpTimer. Just done twice, once for the engage, and then again for the release.

So here in the state machine you'd have:

if carousel.shoot(getRuntime()) { // return false if servos are still moving, true otherwise
    currentState = State.IDLE;
}

and then in the Carousel class, you'd declare & define:

public boolean shoot(double runTime){
   // setup timer here x2

   // check against timer here x2
    if ... {
    ...
    // now both servo movements are done
    return true;
   }
    return false; // timers are not done yet.
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative is to make the servo manually controlled & set a boolean flag so that when the servo is commanded to be out, the carousel cannot be commanded to rotate.

…of 12/5/2025. Setting up code to tilt and lift teardrop
…itions. Values set for new and far shooter tilt. Code with state engine is working. Bot intakes, shoots, lifts the kicker, tilts the shooter, and drives as of 12/6/2025.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants