Robot Core Documentation
Loading...
Searching...
No Matches
edu.wpi.first.wpilibj2.command.button.CommandJoystick Class Reference
Inheritance diagram for edu.wpi.first.wpilibj2.command.button.CommandJoystick:
edu.wpi.first.wpilibj2.command.button.CommandGenericHID

Public Member Functions

 CommandJoystick (int port)
 
Joystick getHID ()
 
Trigger trigger ()
 
Trigger trigger (EventLoop loop)
 
Trigger top ()
 
Trigger top (EventLoop loop)
 
void setXChannel (int channel)
 
void setYChannel (int channel)
 
void setZChannel (int channel)
 
void setThrottleChannel (int channel)
 
void setTwistChannel (int channel)
 
int getXChannel ()
 
int getYChannel ()
 
int getZChannel ()
 
int getTwistChannel ()
 
int getThrottleChannel ()
 
double getX ()
 
double getY ()
 
double getZ ()
 
double getTwist ()
 
double getThrottle ()
 
double getMagnitude ()
 
double getDirectionRadians ()
 
double getDirectionDegrees ()
 
- Public Member Functions inherited from edu.wpi.first.wpilibj2.command.button.CommandGenericHID
 CommandGenericHID (int port)
 
Trigger button (int button)
 
Trigger button (int button, EventLoop loop)
 
Trigger pov (int angle)
 
Trigger pov (int pov, int angle, EventLoop loop)
 
Trigger povUp ()
 
Trigger povUpRight ()
 
Trigger povRight ()
 
Trigger povDownRight ()
 
Trigger povDown ()
 
Trigger povDownLeft ()
 
Trigger povLeft ()
 
Trigger povUpLeft ()
 
Trigger povCenter ()
 
Trigger axisLessThan (int axis, double threshold)
 
Trigger axisLessThan (int axis, double threshold, EventLoop loop)
 
Trigger axisGreaterThan (int axis, double threshold)
 
Trigger axisGreaterThan (int axis, double threshold, EventLoop loop)
 
double getRawAxis (int axis)
 

Detailed Description

A version of Joystick with Trigger factories for command-based.

See also
Joystick

Constructor & Destructor Documentation

◆ CommandJoystick()

edu.wpi.first.wpilibj2.command.button.CommandJoystick.CommandJoystick ( int port)

Construct an instance of a controller.

Parameters
portThe port index on the Driver Station that the controller is plugged into.

Member Function Documentation

◆ getDirectionDegrees()

double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getDirectionDegrees ( )

Get the direction of the vector formed by the joystick and its origin in degrees.

Returns
The direction of the vector in degrees

◆ getDirectionRadians()

double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getDirectionRadians ( )

Get the direction of the vector formed by the joystick and its origin in radians.

Returns
The direction of the vector in radians

◆ getHID()

Joystick edu.wpi.first.wpilibj2.command.button.CommandJoystick.getHID ( )

Get the underlying GenericHID object.

Returns
the wrapped GenericHID object

Reimplemented from edu.wpi.first.wpilibj2.command.button.CommandGenericHID.

◆ getMagnitude()

double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getMagnitude ( )

Get the magnitude of the direction vector formed by the joystick's current position relative to its origin.

Returns
The magnitude of the direction vector

◆ getThrottle()

double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getThrottle ( )

Get the throttle value of the current joystick. This depends on the mapping of the joystick connected to the current port.

Returns
The Throttle value of the joystick.

◆ getThrottleChannel()

int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getThrottleChannel ( )

Get the channel currently associated with the throttle axis.

Returns
The channel for the axis.

◆ getTwist()

double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getTwist ( )

Get the twist value of the current joystick. This depends on the mapping of the joystick connected to the current port.

Returns
The Twist value of the joystick.

◆ getTwistChannel()

int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getTwistChannel ( )

Get the channel currently associated with the twist axis.

Returns
The channel for the axis.

◆ getX()

double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getX ( )

Get the x position of the HID.

Returns
the x position

◆ getXChannel()

int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getXChannel ( )

Get the channel currently associated with the X axis.

Returns
The channel for the axis.

◆ getY()

double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getY ( )

Get the y position of the HID.

Returns
the y position

◆ getYChannel()

int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getYChannel ( )

Get the channel currently associated with the Y axis.

Returns
The channel for the axis.

◆ getZ()

double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getZ ( )

Get the z position of the HID.

Returns
the z position

◆ getZChannel()

int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getZChannel ( )

Get the channel currently associated with the Z axis.

Returns
The channel for the axis.

◆ setThrottleChannel()

void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setThrottleChannel ( int channel)

Set the channel associated with the throttle axis.

Parameters
channelThe channel to set the axis to.

◆ setTwistChannel()

void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setTwistChannel ( int channel)

Set the channel associated with the twist axis.

Parameters
channelThe channel to set the axis to.

◆ setXChannel()

void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setXChannel ( int channel)

Set the channel associated with the X axis.

Parameters
channelThe channel to set the axis to.

◆ setYChannel()

void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setYChannel ( int channel)

Set the channel associated with the Y axis.

Parameters
channelThe channel to set the axis to.

◆ setZChannel()

void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setZChannel ( int channel)

Set the channel associated with the Z axis.

Parameters
channelThe channel to set the axis to.

◆ top() [1/2]

Trigger edu.wpi.first.wpilibj2.command.button.CommandJoystick.top ( )

Constructs an event instance around the top button's digital signal.

Returns
an event instance representing the top button's digital signal attached to the default scheduler button loop.
See also
top(EventLoop)

◆ top() [2/2]

Trigger edu.wpi.first.wpilibj2.command.button.CommandJoystick.top ( EventLoop loop)

Constructs an event instance around the top button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the top button's digital signal attached to the given loop.

◆ trigger() [1/2]

Trigger edu.wpi.first.wpilibj2.command.button.CommandJoystick.trigger ( )

Constructs an event instance around the trigger button's digital signal.

Returns
an event instance representing the trigger button's digital signal attached to the default scheduler button loop.
See also
trigger(EventLoop)

◆ trigger() [2/2]

Trigger edu.wpi.first.wpilibj2.command.button.CommandJoystick.trigger ( EventLoop loop)

Constructs an event instance around the trigger button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the trigger button's digital signal attached to the given loop.

The documentation for this class was generated from the following file: