2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
intake_subsystem.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <ctre/Phoenix.h>
8#include <frc/filter/LinearFilter.h>
9#include <frc2/command/SubsystemBase.h>
10
11#include <TimeOfFlight.h>
12
15#include "units/length.h"
16
17class IntakeSubsystem : public frc2::SubsystemBase {
18 public:
20
24 void Periodic() override;
28
29 void IntakeCone();
30 void EjectCone();
31 void EjectConeForReal();
32 void IntakeCube();
33 void EjectCube();
34 void IntakeStop();
35 void Disable();
36
37 units::inch_t GetIntakeDistance();
38 bool TofConeDetected();
39 bool TofCubeDetected();
40 bool IsConeDetected();
41 bool IsCubeDetected();
42 bool IsGamepieceLost();
43
44 private:
45 // Components (e.g. motor controllers and sensors) should generally be
46 // declared private and exposed only through public methods.
47 WPI_TalonSRX m_intakeMotor;
49
50 frc::TimeOfFlight
52 frc::TimeOfFlight
54 frc::TimeOfFlight
58
59 frc::LinearFilter<units::inch_t> m_coneOffsetFilter;
60 units::inch_t
62
64 std::optional<units::inch_t> ReadSensorDistance(frc::TimeOfFlight& sensor);
65 std::optional<units::inch_t> GetRawConePosition();
66};
Definition intake_subsystem.h:17
bool m_haveCone
Definition intake_subsystem.h:56
void Disable()
Definition intake_subsystem.cpp:92
bool IsConeDetected()
For intake detection.
Definition intake_subsystem.cpp:111
void IntakeFastReverse()
void IntakeCube()
Definition intake_subsystem.cpp:72
frc::TimeOfFlight m_coneRightIntakeSensor
Time of flight distance sensor mounted on right side of intake (wheels up) to detect cone presence & ...
Definition intake_subsystem.h:53
std::optional< units::inch_t > ReadSensorDistance(frc::TimeOfFlight &sensor)
Definition intake_subsystem.cpp:127
void EjectCone()
Definition intake_subsystem.cpp:64
WPI_TalonSRX m_intakeMotor
Definition intake_subsystem.h:47
void IntakeCone()
Definition intake_subsystem.cpp:59
bool m_haveCube
Definition intake_subsystem.h:57
units::inch_t m_filteredConeOffset
Location of cone relative to intake center filtered to reduce noise. Positive is toward left side (wh...
Definition intake_subsystem.h:61
bool TofCubeDetected()
Definition intake_subsystem.cpp:107
frc::TimeOfFlight m_cubeIntakeSensor
Time of flight distance sensor mounted on left side of intake (wheels up) to detect cube presence & l...
Definition intake_subsystem.h:55
bool IsCubeDetected()
For intake detection.
Definition intake_subsystem.cpp:115
void IntakeForward()
units::inch_t GetIntakeDistance()
Definition intake_subsystem.cpp:98
void IntakeStop()
Definition intake_subsystem.cpp:82
bool IsGamepieceLost()
Definition intake_subsystem.cpp:123
void Periodic() override
Definition intake_subsystem.cpp:44
frc::LinearFilter< units::inch_t > m_coneOffsetFilter
Definition intake_subsystem.h:59
bool IsGamePieceDetected()
Definition intake_subsystem.cpp:119
std::optional< units::inch_t > GetRawConePosition()
Definition intake_subsystem.cpp:135
void EjectConeForReal()
Definition intake_subsystem.cpp:68
frc::TimeOfFlight m_coneLeftIntakeSensor
Time of flight distance sensor mounted on left side of intake (wheels up) to detect cone presence & l...
Definition intake_subsystem.h:51
void IntakeReverse()
void EjectCube()
Definition intake_subsystem.cpp:77
bool TofConeDetected()
Definition intake_subsystem.cpp:102
argos_lib::RobotInstance m_robotInstance
Definition intake_subsystem.h:48
RobotInstance
Differentiates between practice robot and competition robot.
Definition config_types.h:13