7#include <frc/filter/LinearFilter.h>
8#include <frc/geometry/Pose3d.h>
9#include <frc/geometry/Transform3d.h>
10#include <frc2/command/SubsystemBase.h>
13#include "networktables/NetworkTable.h"
14#include "networktables/NetworkTableEntry.h"
15#include "networktables/NetworkTableInstance.h"
16#include "networktables/NetworkTableValue.h"
35 :
m_txFilter{frc::LinearFilter<
units::degree_t>::SinglePoleIIR(0.01, 0.02_s)}
36 ,
m_tyFilter{frc::LinearFilter<
units::degree_t>::SinglePoleIIR(0.01, 0.02_s)}
Provides methods for interacting with the camera on a high level.
Definition vision_subsystem.h:78
void SetDriverMode(bool mode)
Turns the camera's driver mode on and off.
std::optional< LimelightTarget > GetClosestTarget()
Get the closest target the camera can see CAN RETURN NONE.
void RequestTargetFilterReset()
Definition vision_subsytem.cpp:13
LimelightTarget m_target
object that holds the current target seen by the camera
Definition vision_subsystem.h:82
Definition vision_subsystem.h:19
bool HasTarget()
Does the camera see a target?
Definition vision_subsytem.cpp:173
tValues GetTarget(bool filter)
Get the values of the camera's current target.
Definition vision_subsytem.cpp:114
units::degree_t m_pitch
Pitch of target relative to camera -24.85 to 24.85 degrees.
Definition vision_subsystem.h:25
units::millisecond_t m_totalLatency
Total latency.
Definition vision_subsystem.h:28
double m_area
Area of the target in percentage of total pixels.
Definition vision_subsystem.h:27
LimelightTarget()
Definition vision_subsystem.h:34
bool m_resetFilterFlag
Definition vision_subsystem.h:31
frc::Pose3d m_robotPose
3d pose of robot relative to field center
Definition vision_subsystem.h:21
frc::Pose3d m_robotPoseTagSpace
3d pose of robot relative to primary april tag (biggest?)
Definition vision_subsystem.h:23
void ResetFilters()
Definition vision_subsytem.cpp:181
frc::LinearFilter< units::degree_t > m_tyFilter
Definition vision_subsystem.h:30
units::degree_t m_yaw
Yaw of target relative to camera -31.65 to 31.65 degrees.
Definition vision_subsystem.h:26
bool m_hasTargets
True if the camera has a target it can read.
Definition vision_subsystem.h:24
frc::LinearFilter< units::degree_t > m_txFilter
Definition vision_subsystem.h:29
void ResetOnNextTarget()
Definition vision_subsytem.cpp:177
frc::Pose3d m_robotPoseWPI
3d pose of robot relative to WPI reference for active alliance
Definition vision_subsystem.h:22
Subsystem for controlling the swerve drivetrain of the robot.
Definition swerve_drive_subsystem.h:56
Definition vision_subsystem.h:101
LimelightTarget::tValues m_oldTargetValues
Get the old robot poses and latencies.
Definition vision_subsystem.h:125
void Disable()
it disables (duh)
Definition vision_subsytem.cpp:108
SwerveDriveSubsystem * m_pDriveSubsystem
Pointer to drivetrain for reading some odometry.
Definition vision_subsystem.h:163
void RequestFilterReset()
Definition vision_subsytem.cpp:100
void Periodic() override
Definition vision_subsytem.cpp:21
void SetReflectiveVisionMode(bool mode)
Definition vision_subsytem.cpp:85
std::optional< units::degree_t > GetHorizontalOffsetToTarget()
Get the current offset to the retroreflective tape.
Definition vision_subsytem.cpp:38
bool AimToPlaceCone()
Definition vision_subsytem.cpp:96
CameraInterface m_cameraInterface
Interface to limelight camera.
Definition vision_subsystem.h:159
std::optional< units::degree_t > GetOffsetToTarget(LimelightTarget::tValues target)
Get the offset to the center of the target.
LimelightTarget::tValues GetCameraTargetValues()
Get the robot poses and latencies.
Definition vision_subsytem.cpp:104
argos_lib::RobotInstance m_instance
Contains either the competition bot or practice bot. Differentiates between the two.
Definition vision_subsystem.h:162
std::optional< units::inch_t > GetDistanceToPoleTape()
Get the longitudinal distance to the retroreflective tape.
Definition vision_subsytem.cpp:57
RobotInstance
Differentiates between practice robot and competition robot.
Definition config_types.h:13
Definition custom_units.h:11
Wraps members of LimelightTarget for use elsewhere.
Definition vision_subsystem.h:43
frc::Pose3d robotPoseWPI
3d pose of robot relative to WPI reference for active alliance
Definition vision_subsystem.h:45
units::degree_t m_yaw
Yaw of target relative to camera -31.65 to 31.65 degrees.
Definition vision_subsystem.h:49
bool hasTargets
True if the camera has a target it can read.
Definition vision_subsystem.h:47
units::degree_t m_pitch
Pitch of target relative to camera -24.85 to 24.85 degrees.
Definition vision_subsystem.h:48
frc::Pose3d robotPoseTagSpace
3d pose of robot relative to primary april tag (biggest?)
Definition vision_subsystem.h:46
frc::Pose3d robotPose
3d pose of robot relative to field center
Definition vision_subsystem.h:44
units::millisecond_t totalLatency
Total latency.
Definition vision_subsystem.h:51
double m_area
Area of the target in percentage of total pixels.
Definition vision_subsystem.h:50