Redshift Project Depot

FRC 2018 (Power Up) => Robot Software => Topic started by: Louis L on January 11, 2018, 12:07:23 PM

Title: User Interface
Post by: Louis L on January 11, 2018, 12:07:23 PM
The top-most post in this thread will be updated to provide the most recent user-interface definition.


(0) Joystick drivetrain controls (excluding buttons, see below)

Left joystick - Up/Down (Y axis) maps to the robot's motion fore and aft.
Left joystick - Left/Right (X axis) maps to the robot's side-to-side (also called strafing) motion.
Right joystick - Left/Right (X axis) maps to the robot rotating left and right.

(1) The Game Controller Contains the normal operation controls.

Move Arm to Ground Height - Game Controller Right trigger
Auto function. Move arm to the specified height (as of RIDE)
This is intended to set the stage to grab a Cube from the ground. Lowering the arm to this height while holding a Cube is not recommended because the orientation of the Cube in the Pincher may not allow the arm to be lowered all the way to the ground and can lead to Pincher and/or Cube damage.
Move Arm down, activate Intake and ingest a Cube. Tucks it safely away (however that is defined)

(unused as of RIDE) Fix Stuck Cube - Game Controller Left Trigger
This button will alter the speed of one Intake wheel when (1) the button is pressed and for (2) the duration that Get the Cube command is active. Its purpose is to handle the case when a Cube is at near 45 degrees to the Intake and the mechanism is unable to ingest the Cube due to the symmetry. By changing one of the wheel's speed, this will unbalance the Intake and rotate the Cube making it easier to ingest. The wheel whose speed is changed toggle with each use.

Open Pincher (Release  Cube) - Game Controller Left Bumper
Release the Cube by opening the Pincher (as of RIDE)
Opens the Gripper and let go of the Cube. If there is no Cube, does nothing. Does not move the arm before or after the command. User must use one of the Move Arm buttons to stow away the Arm.

Close Pincher (Grab Cube) - Game Controller Right Bumper
Release the Cube by closing the Pincher (as of RIDE)
Auto Function: Closes the Gripper. User is responsible for moving the Arm to the correct location.

Move Arm to Exchange height - Game Controller A Button.
Auto function. Move the arm to the specified height, with or without a Cube.
[Note: The only real use for this function is to drop the Cube in front of the Exchange before pushing it in with the robot. It has no other real use. In this use, remember to get the Pincher out of the way before pushing!]
(this was formerly button X)

Move Arm to Lower Scale height - Game Controller B Button.

Auto function. Move the arm to the specified height, with or without a Cube.

Move Arm to Upper Scale height - Game Controller Y Button

Auto function. Move the arm to the specified height, with or without a Cube.

Move Arm to Switch height - Game Controller X Button.
Auto function. Raise Intake and release Cube. Driver pushes Cube from here on.
(this was formerly button A)

(After RIDE) Climb Up - Game Controller Right Stick.
Activates the climbing motor. The climber hardware has a ratchet so there is only an "up" movement.

Fine Tune Arm Up/Down - Game Controller Left Stick
Arm moves only when stick is engaged. Speed is fractional but proportional to stick movement. A deadzone is used.
The initial fractional speed is 1/4.
The initial deadzone is +/- 0.5. This is a significant zone that covers 1/2 of the joystick range (to avoid accidental touches of the stick).

(unused) - Game Controller D-pad

Cancel Auto Function - Game Controller Back Button
Auto Function: Cancel any currently running Auto Function.
Arm and Intake move to safe/reset/home position.

(After RIDE) - Move Arm to Climb Position - Game Controller Start Button
Auto function. Move the arm to the specified height, with or without a Cube. The arm must previously have been at the Upper Scale position.

(2) The buttons on the joysticks contain the special functions. These are manual overrides or commands used to bail us out of a tight spot.

(unused as of RIDE) Toggle Intake - Right Joystick Button 6

Auto Function: Intake movement should be totally automatic based on the function selected so we should never have to use these controls. In the event we want to manually move the Intake, this button will toggle the position of the Intake up and down.

(unused as of RIDE) Intake Flush - Right Joystick Button 7
The original use for Flush was to propel the Cube through the Exchange. But this is a bad idea because the Intake should be Up at the Exchange to avoid potential damage. So Flush is here just in case we need it. Motor operates as long as the button is pressed.

(unused as of RIDE) Ditch Cube - Right Joystick Button 8
Auto Function: If we have a Cube, get rid of it. Raise the Intake. Drop the Cube safely to the ground from wherever it's held. One possible use would be if we have a Cube but need to rush over to Climb and just want to drop our load.

Toggle Gyro Use - Right Joystick Button 9
The DriveTrain defaults to FieldCentric. This button toggles the FieldCentric on and off. Only do this if the Gyro is having problems. Otherwise there's never a good reason to operate in robot-centric mode.

(unused as of RIDE) Intake Cube - Left Joystick Button 9
This turns on the Intake motors to suck in a Cube.

(unused as of RIDE) Move Claw To Level - Left Joystick Button 10
Makes the claw level. This happens by default (as the default command).

(unused as of RIDE) Toggle Intake Grip - Left Joystick Button 11
This opens and closes Gripper to release and grab a Cube respectively
Title: Re: User Interface
Post by: Louis L on January 17, 2018, 01:46:53 PM
Added basic robot movement using the joysticks.
Title: Re: User Interface
Post by: Louis L on January 17, 2018, 02:06:26 PM
In order to get moving on the software beyond just the drive train, we need to start thinking about how this robot will get the job done and what the various controls will be. Below are some thoughts for controls. This is meant to be just a starting point for discussion. Let's figure this out and get a first pass by this weekend. Nothing is finalized until the last minute since the software has to reflect our game play and that can change as we build the robot, test it and refine our ideas.

Title: Re: User Interface
Post by: Louis L on January 17, 2018, 03:11:29 PM
Some more thoughts...
Title: Re: User Interface
Post by: Louis L on January 17, 2018, 04:37:11 PM
And yet some more:
Title: Re: User Interface
Post by: ohad z on January 21, 2018, 11:35:42 PM
A few comments:

Title: Re: User Interface
Post by: Louis L on January 22, 2018, 01:44:24 PM
Just wanted to add some thoughts to these 3 comments from Ohad:

A few comments:

  • Intake in/out manual operation: in Casey the cube refuses to align and the limit switch / sensor does not trigger, can be used to turn the intake in wither direction to try and rectify the situation
  • Maybe a shortcut of the arm control would come useful - instead of pressing a button 5 times to go all the way up, assign a shortcut button to go there in one click
  • A method of selecting from the autonomous modes options is necessary. Either through driver station or other method. This, with the value from the FMS regarding color assignment will determine the autonomous mode behavior.

Title: Re: User Interface
Post by: ohad z on January 24, 2018, 06:43:19 PM
Need a way to switch between robot-centric and field-centric modes for the drive system
Title: Re: User Interface
Post by: Louis L on January 26, 2018, 11:03:11 AM
We met on 1/24 to discuss the UI. Students with prior drive team experience were Stav, Pablo and Isha. The goal was to discuss how the user interface will work and what we expect will be needed on the field for PowerUp. It's never easy to predict how a game will play out but we can draw from previous experience to help us get a feel for human-machine interaction.

The most debated issues were:

Other things discussed include:
Title: Re: User Interface
Post by: Louis L on January 27, 2018, 12:26:49 AM
Here's another pass at a full-blown user interface (rev 2)

(1) The Game Controller Contains the normal operation controls.

Get Cube - Game Controller Right trigger
Auto function. Move Arm down, activate Intake and ingest a Cube. Tucks it safely away (however that is defined)

Fix Stuck Cube - Game Controller Left Trigger
This button will alter the speed of the right Intake wheel for (1) the button is pressed and (2) the duration that Get the Cube command is active. Its purpose is to handle the case when a Cube is at near 45 degrees to the Intake and the mechanism is unable to ingest the Cube due to the symmetry. By changing one of the wheel's speed, this will unbalance the Intake and rotate the Cube making it easier to ingest.

Release  Cube - Game Controller Left Bumper
Opens the Gripper and let go of the Cube. If there is no Cube, does nothing. Does not move the arm before or after the command. User must use one of the Move Arm buttons to stow away the Arm.

Grab Cube - Game Controller Right Bumper
Auto Function: Closes the Gripper. User is responsible for moving the Arm to the correct location.

Move Arm to Switch height - Game Controller A Button.
Auto function. Move the arm to the specified height, with or without a Cube.

Move Arm to Lower Scale height - Game Controller B Button.

Auto function. Move the arm to the specified height, with or without a Cube.

Move Arm to Upper Scale height - Game Controller Y Button

Auto function. Move the arm to the specified height, with or without a Cube.

Move Arm to Exchange height - Game Controller X Button.
Auto function. Raise Intake and release Cube. Driver pushes Cube from here on.

Climber Up/Down - Game Controller Right Stick.
Motor is on only when stick is engaged. A deadzone is used.
The initial deadzone is +/- 0.5. This is a significant zone that covers 1/2 of the joystick range (to avoid accidental touches of the stick).

Fine Tune Arm Up/Down - Game Controller Left Stick
Arm moves only when stick is engaged. Speed is fractional but proportional to stick movement. A deadzone is used.
The initial fractional speed is 1/4.
The initial deadzone is +/- 0.5. This is a significant zone that covers 1/2 of the joystick range (to avoid accidental touches of the stick).

Cancel Auto Function - Game Controller Back Button
Auto Function: Cancel any currently running Auto Function.
Arm and Intake move to safe/reset position  (however defined) with Cube (if present).

Move Arm to climbing height - Game Controller Start Button
Auto Function. Prelude to climbing the Rung.

(2) The joysticks contain the special functions. These are manual overrides or commands used to bail us out of a tight spot.

Toggle Intake - Right Joystick Button 6

Auto Function: Intake movement should be totally automatic based on the function selected so we should never have to use these controls. In the event we want to manually move the Intake, this button will toggle the position of the Intake up and down.

Intake Flush - Right Joystick Button 7
The original use for Flush was to propel the Cube through the Exchange. But this is a bad idea because the Intake should be Up at the Exchange to avoid potential damage. So Flush is here just in case we need it. Motor operates as long as the button is pressed.

Ditch Cube - Right Joystick Button 8
Auto Function: If we have a Cube, get rid of it. Raise the Intake. Drop the Cube safely to the ground from wherever it's held. One possible use would be if we have a Cube but need to rush over to Climb and just want to drop our load.

Toggle Gyro Use - Right Joystick Button 9
The DriveTrain defaults to FieldCentric. This button toggles the FieldCentric on and off. Only do this if the Gyro is having problems. Otherwise there's never a good reason to operate in robot-centric mode.
Title: Re: User Interface
Post by: ohad z on January 27, 2018, 05:48:50 PM
A few questions/comments:
Title: Re: User Interface
Post by: Louis L on January 27, 2018, 07:40:43 PM
A few questions/comments:
  • Is “Exchange height” for arm the same as intake height (height required to grab a cube)?
  • Climber up/down: the joystick will activate climber up/down manually (no auto-stop other than safety current draw)?
  • Other than the “get cube” automated command that lowers the intake and the “exchange cube” that raises it, what are the other sequences that move the intake up/down? I would guess once the cube is in and the gripper has grabbed it, the intake can go up.
  • At some point there was an idea to use the triggers to control the intake in/out speed (they are analog and so could change the right/left intake speeds to manage misaligned cubes). Otherwise, if the switches in the intake break, this may come in handy to manually control the intake to be able to pick up a cube

Title: Re: User Interface
Post by: Louis L on January 28, 2018, 05:37:35 PM
The buttons on the Right Joystick need to be remapped. The current choices were made based on the Logitech Xtreme 3D joysticks we use in the lab. The joysticks we use on the competition driver station are older model Logitech units that are ambidextrous. The buttons on those joysticks are placed differently. Will do that in the coming days.
Title: Re: User Interface
Post by: Louis L on January 30, 2018, 07:18:00 PM
The buttons on the Right Joystick need to be remapped. The current choices were made based on the Logitech Xtreme 3D joysticks we use in the lab. The joysticks we use on the competition driver station are older model Logitech units that are ambidextrous. The buttons on those joysticks are placed differently. Will do that in the coming days.

Here's the remap onto the Logitech Attack 3 joysticks.

Buttons 7-10 will now be 6 to 9. The previous post with the button map will be updated shortly.
Title: Re: User Interface
Post by: Louis L on January 30, 2018, 08:03:28 PM
Had a conversation with Ohad, BatChen and Matt. Looks like WPILib will handle mutliple button presses and avoid the problems that LabVIEW has. So the priority scheme is mainly for the LabVIEW implementation. Cancel will still have higher priority than other commands in WPIlib implementations. The rest will behave differently as there won't be a priority ordering.
Title: Re: User Interface
Post by: Ishita G on February 19, 2018, 05:47:20 PM
Left Joystick

Button 8- Raises Intake
Button 9- Intake cube
Button 10- Sets Claw to level position and waits
Button 12- Grips cube
Title: Re: User Interface
Post by: Matt S on February 22, 2018, 03:22:01 PM
Buttons changed:
Buttons added (these may need to be modified):
Title: Re: User Interface
Post by: Louis L on February 23, 2018, 01:59:05 PM
Updated latest info as of 2/23 onto OP
Title: Re: User Interface
Post by: Matt S on February 26, 2018, 07:07:34 PM
Buttons changed:
Title: Re: User Interface
Post by: Louis L on February 27, 2018, 10:02:01 AM
Updated OP to reflect reply #18
Title: Re: User Interface
Post by: Matt S on March 10, 2018, 04:18:50 PM
For the existing version of the robot, we will be changing the get cube command by breaking it up into two parts.  The first part will be run by the right trigger on the controller, which gets the arm in place for picking up a cube and then starts the intake.  The second part will be run by the left trigger on the controller, replacing the fix stuck cube command (it was never used in competition).  This second part will continue running the intake until the cube is grabbed by the claw, and the tucks the arm away into a safe position like it did previously.
Title: Re: User Interface
Post by: Louis L on March 31, 2018, 12:33:32 PM
OP has been updated to reflect the code used at RIDE with the new Pincher mechanism (that replaced the old arm extension / wrist / gripper / intake)
Title: Re: User Interface
Post by: Louis L on April 27, 2018, 11:07:27 AM
Minor cleanup to OP wording for clarification.
Title: Re: User Interface
Post by: Louis L on October 17, 2018, 01:04:45 PM
Updated to reflect climber function UI