Valor 6800 1.0
Loading...
Searching...
No Matches
valor::GrappleSensor Class Reference

Specific implementation of the LaserProximitySensor for Grapple Robotics. More...

#include <GrappleSensor.h>

Inheritance diagram for valor::GrappleSensor:
valor::LaserProximitySensor valor::BaseSensor< LaserProximityData > valor::LidarSensor valor::DebounceSensor valor::Loggable valor::BaseSensor< units::millimeter_t > valor::BaseSensor< bool > valor::Loggable valor::Loggable

Public Member Functions

 GrappleSensor (frc::TimedRobot &robot, int canId)
 Construct a new GrappleSensor object.
 
- Public Member Functions inherited from valor::LaserProximitySensor
 LaserProximitySensor (frc::TimedRobot &robot)
 Construct a new LaserProximitySensor object.
 
void setThresholdDistance (units::millimeter_t threshold)
 Set the threshold distance for triggering the sensor.
 
void reset () override
 Reset the sensor state, including Lidar and debounce logic.
 
LaserProximityData get ()
 Get the current sensor data.
 
void setGetter (std::function< units::millimeter_t()> getter)
 Set the getter function for the Lidar sensor.
 
- Public Member Functions inherited from valor::BaseSensor< LaserProximityData >
void setGetter (std::function< LaserProximityData()> _lambda)
 Set the lambda function to fetch sensor data.
 
void applyPostProcessing (std::function< LaserProximityData(LaserProximityData)> func)
 Set a post-processing function for sensor data.
 
LaserProximityData get ()
 Get the current sensor state.
 
- Public Member Functions inherited from valor::Loggable
void LogChild (std::string_view name, Loggable *child)
 Register a child Loggable under a named subtree.
 
void LogChild (std::string_view name, wpi::Sendable *child)
 Register a child Sendable under a named subtree.
 
void setLoggingPeriod (units::millisecond_t period)
 Set the minimum period between LoggablePeriodic() invocations.
 
template<>
decltype(Loggable::subscribers) ::iterator addSubscriber (std::string_view field, const std::vector< bool > &defaultValue)
 
template<>
void WriteLogImpl (nt::Publisher *pub, const std::vector< bool > &data)
 
template<>
std::vector< boolReadLogImpl (nt::Subscriber *sub)
 
- Public Member Functions inherited from valor::LidarSensor
 LidarSensor (frc::TimedRobot &robot)
 Construct a new LidarSensor object.
 
units::millimeter_t getMaxDistance ()
 Get the maximum distance threshold for the Lidar sensor.
 
void setMaxDistance (units::millimeter_t maxDistance)
 Set the maximum distance threshold for the Lidar sensor.
 
void setupSim (std::function< frc::Pose2d()> robotPoseGetter, frc::Transform2d sensorPosition, std::vector< sim::FieldFeature > features)
 
void setGetter (std::function< units::millimeter_t()> getter)
 
- Public Member Functions inherited from valor::BaseSensor< units::millimeter_t >
void setGetter (std::function< units::millimeter_t()> _lambda)
 Set the lambda function to fetch sensor data.
 
void applyPostProcessing (std::function< units::millimeter_t(units::millimeter_t)> func)
 Set a post-processing function for sensor data.
 
units::millimeter_t get ()
 Get the current sensor state.
 
- Public Member Functions inherited from valor::DebounceSensor
 DebounceSensor (frc::TimedRobot &robot)
 Construct a new DebounceSensor object.
 
void setEdgeCallback (std::function< void()> _lambda)
 Set a callback function for detecting any edge (rising or falling).
 
void setRisingEdgeCallback (std::function< void()> _lambda)
 Set a callback function for detecting a rising edge.
 
void setFallingEdgeCallback (std::function< void()> _lambda)
 Set a callback function for detecting a falling edge.
 
- Public Member Functions inherited from valor::BaseSensor< bool >
void setGetter (std::function< bool()> _lambda)
 Set the lambda function to fetch sensor data.
 
void applyPostProcessing (std::function< bool(bool)> func)
 Set a post-processing function for sensor data.
 
bool get ()
 Get the current sensor state.
 

Additional Inherited Members

- Static Public Member Functions inherited from valor::Loggable
static units::millisecond_t GetLoggingTime ()
 
- Protected Member Functions inherited from valor::LaserProximitySensor
void calculate () override
 Perform proximity sensor-specific calculations.
 
void refresh () override
 Refresh the sensor state.
 
- Protected Member Functions inherited from valor::BaseSensor< LaserProximityData >
 BaseSensor (frc::TimedRobot &robot)
 Construct a new BaseSensor object.
 
- Protected Member Functions inherited from valor::Loggable
 Loggable (std::string_view name)
 Construct a Loggable that registers a top-level table name.
 
 Loggable ()
 Default construct an uninitialized Loggable.
 
virtual ~Loggable ()=default
 Virtual destructor.
 
virtual void OnLoggingStart ()
 Hook invoked when logging is started for this object.
 
virtual void LoggablePeriodic ()
 Periodic callback for logging updates.
 
template<typename T >
T WriteLog (std::string_view field, const T &data)
 Publish a value to NetworkTables under the given field.
 
template<typename T >
ReadLog (std::string_view field, const T &defaultValue={})
 Read a value from NetworkTables for the given field.
 
- Protected Member Functions inherited from valor::LidarSensor
void calculate () override
 Perform Lidar-specific calculations.
 
- Protected Member Functions inherited from valor::BaseSensor< units::millimeter_t >
 BaseSensor (frc::TimedRobot &robot)
 Construct a new BaseSensor object.
 
- Protected Member Functions inherited from valor::BaseSensor< bool >
 BaseSensor (frc::TimedRobot &robot)
 Construct a new BaseSensor object.
 
- Protected Attributes inherited from valor::BaseSensor< LaserProximityData >
std::function< LaserProximityData()> sensorLambda
 Lambda function to fetch sensor data.
 
std::function< LaserProximityData(LaserProximityData)> postProcessor
 Lambda function to post-process sensor data.
 
LaserProximityData prevState
 Previous and current sensor states.
 
LaserProximityData currState
 
frc::Timer profiler
 
- Protected Attributes inherited from valor::LidarSensor
std::unique_ptr< SimStatesimState
 
- Protected Attributes inherited from valor::BaseSensor< units::millimeter_t >
std::function< units::millimeter_t()> sensorLambda
 Lambda function to fetch sensor data.
 
std::function< units::millimeter_t(units::millimeter_t)> postProcessor
 Lambda function to post-process sensor data.
 
units::millimeter_t prevState
 Previous and current sensor states.
 
units::millimeter_t currState
 
frc::Timer profiler
 
- Protected Attributes inherited from valor::BaseSensor< bool >
std::function< bool()> sensorLambda
 Lambda function to fetch sensor data.
 
std::function< bool(bool)> postProcessor
 Lambda function to post-process sensor data.
 
bool prevState
 Previous and current sensor states.
 
bool currState
 
frc::Timer profiler
 

Detailed Description

Specific implementation of the LaserProximitySensor for Grapple Robotics.

This class integrates the Grapple Robotics LidarCAN device with the LaserProximitySensor framework, providing additional functionality specific to the Grapple sensor.

Constructor & Destructor Documentation

◆ GrappleSensor()

valor::GrappleSensor::GrappleSensor ( frc::TimedRobot & robot,
int canId )

Construct a new GrappleSensor object.

Parameters
robotReference to the robot, used to schedule the calculate method.
nameName of the sensor for identification.
canIdCAN ID of the Grapple sensor device.

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