Author Topic: User Interface - joystick & gamepad  (Read 5608 times)

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
User Interface - joystick & gamepad
« on: January 25, 2017, 11:40:55 PM »
This thread defines the user interface. The software is responsible for taking the user's input and making things happen on the robot.

Below are ideas for controls that we may want / need. We'll discuss this over the next few days, add and delete and narrow things down. The list is not in any order.

1/31/17 update - add / remove things to reflect the new hardware.
2/1/17 update - we reviewed the user interface; info below updated to reflect what agreed upon.
2/2/17 update - inserted button table to give hopefully an easier view of things

This table summarizes button action and implementation. Buttons with a Group / Priority work exclusively; that is to say only one button from a group may be active at any time. If more than one button in a group is pressed, the one with the highest priority is executed.

Gamepad buttonsMicrosoft button numberPress-release or Press-holdWhat this doesCancelable?Group / Priority
-----------------------------------------------------------------------------------------------------
Both Joysticks9 and 10Press-ReleaseWhen pressed together, cancels an operation - Always cancels any cancelable operation
Right TriggerZ minPress-ReleaseAuto fine-tune position and release GearYes 1 / 1
Right Bumper6Press-ReleaseManual release of GearYes 1 / 2
Left TriggerZ maxPress-HoldRuns intake rollerNo -
Start8Press-ReleaseDump balls from hopperYes 1 / 3
Y4Press-HoldActivate winch to climbNo 2 / 1
A1Press-HoldUnwind winchNo 2 / 2

Joystick buttonsMicrosoft button numberPress-release or Press-holdWhat this doesCancelable?Group / Priority
-------------------------------------------------------------------------------------------------------------
Re-calibrate wheelsLeft Joystick 11Press-ReleaseRe-calibrate swerve driveNo -

Left Joystick.
- Y (forward/backward), X (strafe side to side)

Right joystick
- X movement translate into robot rotation

Driver Station Console
- Enable / Disable autonomous (enabled by default). Being able to disable auto is there in case we know of a bad problem and we just want to nuke it because we don't have time to change the code.

- Autonomous mode selection. There will be several autonomous modes (including one that does nothing). Each one does something different depending on what our alliance partners can do. We want to be able to drop off the Gear on a Lift. How we get to the Lift depends on what our alliance partners do and how/where they do it (so we don't collide). Other functions we might do include empty the hopper (low goal), get more balls from a wall dispenser, and cross the baseline.

- Auto Lift selection (1, 2, 3). Which Lift position are headed to.

- Auto Side selection (left/right or red/blue). The 2 halves of the field are left/right reversed so make sure we have it set up correctly.

Gamepad
- Both joystick buttons - press both joysticks down at the same time to <cancel> an operation.

- Button "Right Trigger" - auto fine-tune and release Gear. Use same code as autonomous. Helps user.  Honors <cancel> operation.

- Button "Right bumper" - manual release of Gear; no auto fine-tune. Honors <cancel> operation.

- Button - auto distance to collect gear (this is only if needed)

- Button "Left Trigger" - press and hold to run the intake roller. Does not honor <cancel>

- Button - intake off. We can toggle but would need some sort of dashboard indicator.


- Button "Start" - release ball from hopper into low goal. Press to activate. Software does the work and resets the mechanism when done. [how does software stop the dump operation? is it based on time or is there a sensor] Honors <cancel> operation.

- Button - autoshoot balls from hopper. Press-and-hold.
- Button - Single manual shot release. No automation other than loading a ball into the shooter and firing. No targeting.
- Button - one or more preset auto-shots. No camera needed to work. Uses location on the field.
  - From the Key
  - From driver station wall
  - From airship
  - From side wall


- Shooter manual control - rotate head L/R
- Shooter manual control - lift head U/D
- Shooter manual control - adjust ball speed


- Button Y - push and hold to wind the winch (climb). Software needs to check for motor current to shut it down. There is also a software lockout in the last 30 seconds to prevent an accidental early climb. Ignores <cancel> operation.

- Button A - push and hold to unwind winch (useful for in-pit rope removal). Ignores <cancel> operation.

- Button 11 - re-calibrate swerve on demand using absolute encoder.

Autonomous
- Shoot 10 balls, hang gear, drive over baseline if not done yet
« Last Edit: February 04, 2017, 02:21:03 PM by Louis L »

Matt S

  • Guest
Re: User Interface - joystick & gamepad
« Reply #1 on: January 28, 2017, 12:24:16 PM »
  • E-Stop (press both joystick buttons)
  • Shooter
         
    • manual shoot (toggles, start button) sets shooter to a specific setpoint and shooter motor to a set rpm, displays target on dashboard
           
    • shoot (right trigger) only works in manual shoot, one press shoots 1 ball, hold shoots all balls
           
      • Enable autonomous shooting (right bumper)
             
      • Set Autoshoot preset (D-pad)
                   
        • in key (UP)
                     
        • driverstation wall (LEFT)
                     
          • airship (RIGHT)
                       
          • side wall (DOWN)
          • Climber
                 
          • climb (left trigger) could also define speed of movement when held
                 
            • uncoil climber (left bumper)?
            • Gear
                   
            • Move up against wall to grab gear (both triggers on driver side)
                   
              • Place gear (top buttons on driver side)
              • Drivetrain
                     
              • recalibrate wheels (button 10 on right and left joystick)
                     
                • Strafe Movement (Left Joystick X)
                       
                • Forward Movement (Left Joystick Y)
                       
                  • Rotate (Right Joystick X)

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: User Interface - joystick & gamepad
« Reply #2 on: January 31, 2017, 12:57:38 PM »
In light of the recent hardware changes, it looks like we need to reset some of this.

I've updated the top-most entry to this thread to reflect the new hardware.

Kyle Sa

  • Newbie
  • *
  • Posts: 31
Finalized User Interface Buttons- All Teams
« Reply #3 on: February 01, 2017, 08:20:50 PM »
***IMPORTANT!!***
The following is what buttons will be used for what purposes each button/joystick will accomplish if they are pressed. The "Joysticks" section are the driver's two large joysticks; "Console" is what appears on the screen, in LabVIEW Dashboard, Smart Dashboard, or whatever will be used; "Gamepad" is the XBox Controller that the operator will be using. Also, the attachment at the bottom is a labeled image of the XBox Controller in case you aren't sure of the layout

Joysticks-
   Left Joystick- Drive/Strafe
   Right Joystick- Rotate wheels
Console-
   Options to select which autonomous mode to use
   Pick which end of the field (red/blue) the robot is on
Gamepad-
   Press down on both joysticks- Global Cancel Button (Cancel whatever command is currently running)
   Right Bumper- Manual push-and-release gear
   Right Trigger- Automatic push-and-release gear
   Left hand trigger- Intake on (Hold to keep intake on, release to turn it off)
   Start/Menu/3-line Button (See diagram)- Dump balls into lower goal
   **The following will do nothing if they are pressed before the final 30 seconds of the match in order to minimize accidentally activating it:
      Y button- Climb (Wind Winch)- Hold Button
      A button- Unwind Winch- Hold Button
These were decided on 2/1/17, during a meeting with everyone that was there that day and was in software.
« Last Edit: February 02, 2017, 07:13:31 AM by Kyle Sa »

Louis L

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
Re: User Interface - joystick & gamepad
« Reply #4 on: February 01, 2017, 09:52:43 PM »
quick update - the Y and A button don't need to react to "cancel" because the act of letting the button go will stop the action.

Kyle Sa

  • Newbie
  • *
  • Posts: 31
Re: User Interface - joystick & gamepad
« Reply #5 on: February 01, 2017, 10:32:01 PM »
Just fixed that on the original post, thanks!

Matt S

  • Guest
Re: User Interface - joystick & gamepad
« Reply #6 on: February 22, 2017, 10:49:44 AM »
The button we will be using for switching between robot-centric and field-centric is the 7th button on the left joystick.  This button may be different on the newer controllers.