WPILibC++ 2023.4.3-108-ge5452e3
CommandJoystick.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6#include <frc/Joystick.h>
7
8#include "Trigger.h"
10
11namespace frc2 {
12/**
13 * A version of {@link Joystick} with {@link Trigger} factories for
14 * command-based.
15 *
16 * @see Joystick
17 */
19 public:
20 using Joystick::Joystick;
21
22 /**
23 * Constructs an event instance around this button's digital signal.
24 *
25 * @param button the button index
26 * @param loop the event loop instance to attach the event to. Defaults to the
27 * CommandScheduler's default loop.
28 * @return an event instance representing the button's digital signal attached
29 * to the given loop.
30 */
31 class Trigger Button(
32 int button, frc::EventLoop* loop = CommandScheduler::GetInstance()
33 .GetDefaultButtonLoop()) const;
34
35 /**
36 * Constructs an event instance around the trigger button's digital signal.
37 *
38 * @param loop the event loop instance to attach the event to. Defaults to the
39 * CommandScheduler's default loop.
40 * @return an event instance representing the trigger button's digital signal
41 * attached to the given loop.
42 */
44 frc::EventLoop* loop =
45 CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
46
47 /**
48 * Constructs an event instance around the top button's digital signal.
49 *
50 * @param loop the event loop instance to attach the event to. Defaults to the
51 * CommandScheduler's default loop.
52 * @return an event instance representing the top button's digital signal
53 * attached to the given loop.
54 */
55 class Trigger Top(frc::EventLoop* loop = CommandScheduler::GetInstance()
56 .GetDefaultButtonLoop()) const;
57};
58} // namespace frc2
A version of Joystick with Trigger factories for command-based.
Definition: CommandJoystick.h:18
class Trigger Top(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the top button's digital signal.
static CommandScheduler & GetInstance()
Returns the Scheduler instance.
This class provides an easy way to link commands to conditions.
Definition: Trigger.h:35
Handle input from standard Joysticks connected to the Driver Station.
Definition: Joystick.h:23
Definition: ProfiledPIDCommand.h:18
Definition: AprilTagPoseEstimator.h:15