Sylib
A C++ Library For V5
Loading...
Searching...
No Matches
sylib Namespace Reference

Classes

class  Addrled
 WS2812B Addressable LED Strip Controller. More...
 
class  DerivativeController
 D Controller. More...
 
class  Device
 Device Parent Class. More...
 
class  EMAFilter
 Exponential Moving Average Filter. More...
 
struct  hsv
 HSV Color. More...
 
class  IntegralController
 I Controller. More...
 
class  MedianFilter
 Median Filter. More...
 
class  Motor
 V5 Smart Motor. More...
 
class  Mutex
 Mutex. More...
 
class  ProportionalController
 P Controller. More...
 
class  RangeExtremaFilter
 Extrema Filter. More...
 
struct  rgb
 RGB Color. More...
 
class  SMAFilter
 Simple Moving Average Filter. More...
 
struct  SpeedControllerInfo
 Custom Velocity Controller. More...
 
class  SylibDaemon
 Sylib System Daemon. More...
 
class  SylviesPogVelocityEstimator
 Accurate Motor Velocity Estimator. More...
 
class  SympleDerivativeSolver
 Generic Derivative Solver. More...
 
class  TakeBackHalfController
 TBH Controller. More...
 
class  Task
 Task. More...
 
class  VoltageEstimation
 Feedforward Controller. More...
 

Typedefs

using kv_fn_t = std::function< double(double)>
 
using mutex_lock = const std::lock_guard< sylib::Mutex >
 

Enumerations

enum  SylibMotorControlMode {
  SylibMotorControlModeOFF = 0 , SylibMotorControlModeBRAKE = 1 , SylibMotorControlModeHOLD = 2 , SylibMotorControlModeCUSTOM = 3 ,
  SylibMotorControlModePOSITION = 4 , SylibMotorControlModeVelocityAUTO = 5 , SylibMotorControlModePositionAUTO = 6 , SylibMotorControlModeVOLTAGE = 7
}
 
enum  SylibAddrledControlMode {
  SylibAddrledControlModeOFF = 0 , SylibAddrledControlModeMANUAL = 1 , SylibAddrledControlModePULSE = 2 , SylibAddrledControlModeCYCLE = 3 ,
  SylibAddrledControlModeFADE = 4
}
 

Functions

void initialize ()
 Starts Sylib background processes. Called by the user in initialize() More...
 
void delay_until (std::uint32_t *const prev_time, const std::uint32_t delta)
 Delays the current task until a set time. More...
 
void delay (std::uint32_t delay)
 Delays the current task for a set number of milliseconds. More...
 
uint32_t millis ()
 The current system time. More...
 
uint64_t micros ()
 The current system time in microseconds. More...
 

Variables

Mutex sylib_port_mutexes [V5_MAX_DEVICE_PORTS]
 
Mutex sylib_controller_mutexes [2]
 

Typedef Documentation

◆ kv_fn_t

using sylib::kv_fn_t = typedef std::function<double(double)>

◆ mutex_lock

using sylib::mutex_lock = typedef const std::lock_guard<sylib::Mutex>

Enumeration Type Documentation

◆ SylibAddrledControlMode

Enumerator
SylibAddrledControlModeOFF 
SylibAddrledControlModeMANUAL 
SylibAddrledControlModePULSE 
SylibAddrledControlModeCYCLE 
SylibAddrledControlModeFADE 

◆ SylibMotorControlMode

Enumerator
SylibMotorControlModeOFF 
SylibMotorControlModeBRAKE 

Motor is off and in coast mode.

SylibMotorControlModeHOLD 

Motor is off and in brake mode.

SylibMotorControlModeCUSTOM 

Motor is holding at current position.

SylibMotorControlModePOSITION 

Motor is in velocity control mode.

SylibMotorControlModeVelocityAUTO 

Motor is in velocity control mode.

SylibMotorControlModePositionAUTO 

Motor is controlled by internal firmware.

SylibMotorControlModeVOLTAGE 

Function Documentation

◆ delay()

void sylib::delay ( std::uint32_t  delay)

Delays the current task for a set number of milliseconds.

This is a wrapper for pros::delay() if running in a PROS enviroment, and a wrapper for vex::this_thread::sleep_for if in a VEXcode enviroment

Parameters
delayThe number of milliseconds to pause the task for

◆ delay_until()

void sylib::delay_until ( std::uint32_t *const  prev_time,
const std::uint32_t  delta 
)

Delays the current task until a set time.

Updates the value at the pointer provided to the current time after the delay ends

This is a wrapper for pros::Task::delay_until() if running in a PROS enviroment, and a wrapper for vex::this_thread::sleep_until() if in a VEXcode enviroment

Parameters
prev_timeA pointer to a value containing the current system time
deltaThe number of milliseconds to pause the task for

◆ initialize()

void sylib::initialize ( )

Starts Sylib background processes. Called by the user in initialize()

◆ micros()

uint64_t sylib::micros ( )

The current system time in microseconds.

This value drifts slightly from the system clock over time

Returns
Microseconds

◆ millis()

uint32_t sylib::millis ( )

The current system time.

This is a wrapper for pros::millis() if running in a PROS enviroment, and a wrapper for vex::timer::system() if in a VEXcode enviroment

Returns
Milliseconds

Variable Documentation

◆ sylib_controller_mutexes

Mutex sylib::sylib_controller_mutexes[2]
extern

◆ sylib_port_mutexes

Mutex sylib::sylib_port_mutexes[V5_MAX_DEVICE_PORTS]
extern