[JAVA] About the program of the world's largest high school student Robocon FRC ~ Climb relations ~

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

FIRST At first. For climbing steps. I will also explain the climb part of Robot.java.

If you think about it, you have to start by explaining how to climb ... I can hardly understand it at first sight, so even if I leave the understanding behind ... In the first place, the article is a style that leaves the reader behind ...

First, raise the lift (kLiftUp)

ezgif.com-video-to-gif (2).gif

Put out the stopper (kLocking)

ezgif.com-video-to-gif (3).gif

Lower the lift to lift the robot (part of kAdvance)

ezgif.com-video-to-gif (4).gif

Go forward (part of kAdvance)

ezgif.com-video-to-gif (5).gif

This is the part to climb, and the rest is tidied up

Raise the lift (kLiftUP)

ezgif.com-video-to-gif (6).gif

Close the stopper and lower the lift to finish (Lift Down)

ezgif.com-video-to-gif (7).gif

When I tried to put out the whole flow at once, it was blocked by the size upper limit ... Complement in the brain: pray:

What you need for this class

Being able to climb a step

variable

VictorSP climbMotor
Motor used for crime
Solenoid climbSolenoid
Solenoid to put out the stopper

Function list

Climb()
argument... None

Substitute motor and solenoid

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

Receive and enter information from state

private void climbAdvance()
argument... ・ double speed

Set the speed on the motor. If you comment out the process here, it will not work.

private void climbLockStopper()
argument... None

Lock with stopper

private void climbUnlockStopper()
argument... None

Remove the stopper

Function description

Omitted because you can see it.

About climbing in Robot.java

Roughly divide into the first half and the second half. Post-processing until and after climbing. Switch the operation with switch (State.climbSequence).

By the way, if there is no step in front of you, the robot will fall down and it will be very bad, so I started with a button that is difficult to press.

First half

kLiftUp Since there are two heights of the step, the operation is divided by the input of the command. Set the height with PID control and move. After confirming that the target value has been reached, move to kLocking.

kLocking Put out the stopper here. For the time being, keep the height of the lift. Consider the time to lock, wait 0.3 seconds before moving to kAdvance.

kAdvance Lower the lift and lift the robot. Run the motor in the back frame where the stopper is hooked to move forward.

Second half

kLiftUp Raise the lift

kUnlocking Remove the stopper. Then the back frame is returned by the spring. (It should have been, but in reality it was returned due to rough work)

LAST Finally. Honestly, can you see the operation of this area as a robot student? It was hard to understand at first glance. It's not so if it's said that this area will be useful in the future, so ...

Previous article ⇒ Grabber related Next article ⇒ What to write ..: thinking:

Recommended Posts