[JAVA] [World's Largest Junior and Senior High School Robot Contest] About FRC Program ~ Grabber Related ~

This article is part of the article here. First, please take a look at this.

FIRST At first. Grabber is the part here in front of the robot. image.png We deal with balls and boards here.

Turn the rollers such as gray </ font> in the front and green </ font> in the back to collect and fire the ball. ezgif.com-video-to-gif (1).gif

Actually, there is a hole in the center of the board, but I put a white stick in the foreground and spread out something like a claw to collect it. ezgif.com-video-to-gif.gif

What you need for this class

・ A ball with a diameter of 33 cm can be collected, held, and fired at any time. ・ You can attach or attach a board ・ Store the arm (the mechanism that performs the above operation) ⇒Rules must be closed at first & disturb when firing the ball

variable

VictorSP rollerMotor
Roller for collecting balls. It's all powered by one motor.
Solenoid barSolenoid
For opening the stick when collecting the board [Solenoid](https://qiita.com/amidaandhero02/items/b26be2c552e8a40192cb#%E3%82%BD%E3%83%AC%E3%83%8E%E3%82%A4%E3%83%89) Is like a motor that uses air instead of electricity
Solenoid armSolenoid
For storing the arm
boolean is_RollerMoving
Is the roller spinning? There is not much use ...
boolean is_retractingArm
Is the arm stowed? There is not much use ...

Function list

Grabber()
argument... ・ VictorSP rollerMotor ・ Solenoid barSolenoid ・ Solenoid armSolenoid

Pass the argument motor and solenoid to the class field.

public void applyState()
argument... ・ State state

Receive information from State and substitute it for motors and solenoids.

private void holdCargo()
argument... None

Collect the balls.

private void releaseCargo()
argument... None

Fire the ball

private void stopRoller()
argument... None

Stop the roller. Do this when nothing is being manipulated.

private void setRollerSpeed()
argument... None

Set the roller speed. If you comment out the process here, the roller will not move.

public boolean is_RollerMoving()
argument... None

Is the roller moving?

private void holdPanel()
argument... None

Collect the board

private void releasePanel()
argument... None

Install the board

private void retractArm()
argument... None

Close the arm

private void releaseArm()
argument... None

Put out the arm

public boolean is_retractingArm()
argument... None

Is the arm stowed?

Function description

Obvious ones are omitted.

applyState()
First, arm related. State would say that the arm would be stowed. Also, I want to keep it during the climb (described later), so I will put it away.

Also, if you hold the ball and close the arm, the ball will pop out, so rotate the roller slightly to hold it.

Ball related. In the switch, the processing is divided according to the cargoState of State. For kHold,holdCargo () For kRelease, callreleaseCargo ().

Board related. If State says grab the panel, grab it.

LAST Finally.

It was a lot easier here than Drive.

Then.

Previous article ⇒ Lift related Next article ⇒ Climb related