2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
argos_lib::led::animation Namespace Reference

Functions

Animation Pong (unsigned offset, unsigned width, unsigned height, unsigned ballSize, bool rainbow, frc::AddressableLED::LEDData ballColor, frc::AddressableLED::LEDData backgroundColor, units::millisecond_t frameTime, argos_lib::led::PanelScanParams scanParams)
 Animation that kind of works like a DVD player screensaver (https://youtu.be/QOtuX0jL85Y). A ball bounces around the panel changing color.
 
AnimatedSprite ChompingPacMan (float radius, frc::AddressableLED::LEDData color, units::degree_t direction, units::millisecond_t chompPeriod, bool feathered=false)
 
AnimatedSprite DyingPacMan (float radius, frc::AddressableLED::LEDData color, units::degree_t direction, units::degree_t initialMouthAngle, units::millisecond_t animationTime, bool feathered=false)
 
Animation PacManPacing (unsigned offset, unsigned width, unsigned height, bool rainbow, frc::AddressableLED::LEDData pacManColor, argos_lib::led::PrimaryScanDirection paceDirection, units::millisecond_t chompPeriod, units::millisecond_t moveSpeed, argos_lib::led::PanelScanParams scanParams, bool feathered=false)
 
void DrawRectangle (Panel &dest, unsigned rectWidth, unsigned rectHeight, float x, float y, frc::AddressableLED::LEDData color)
 Draws an axis-aligned rectangle to a panel. All pixels outside the rectangle are unmodified.
 
void DrawCircle (Panel &dest, float radius, float x, float y, frc::AddressableLED::LEDData color, bool feathered=false)
 Draw a circle to the panel.
 
Sprite DrawCircleSprite (float radius, frc::AddressableLED::LEDData color, bool feathered=false)
 Generate a sprite containing a circle with transparent background.
 
void RenderSprite (Panel &dest, const Sprite &sprite, float x, float y, float alpha=1.0)
 Draw a sprite centered at a point to a panel. This will align the sprite to the nearest pixel alignment on the panel.
 
Sprite DrawPacMan (float radius, frc::AddressableLED::LEDData color, units::degree_t direction, units::degree_t mouthAngle, bool feathered=false)
 Generate PacMan sprite :D.
 

Function Documentation

◆ ChompingPacMan()

argos_lib::led::AnimatedSprite argos_lib::led::animation::ChompingPacMan ( float  radius,
frc::AddressableLED::LEDData  color,
units::degree_t  direction,
units::millisecond_t  chompPeriod,
bool  feathered = false 
)

◆ DrawCircle()

void argos_lib::led::animation::DrawCircle ( Panel dest,
float  radius,
float  x,
float  y,
frc::AddressableLED::LEDData  color,
bool  feathered = false 
)

Draw a circle to the panel.

Parameters
destPanel to draw to
floatradius
xHorizontal center
yVertical center
colorFill color
featheredWhen true, make border pixels semi-transparent to soften edge

◆ DrawCircleSprite()

argos_lib::led::Sprite argos_lib::led::animation::DrawCircleSprite ( float  radius,
frc::AddressableLED::LEDData  color,
bool  feathered = false 
)

Generate a sprite containing a circle with transparent background.

Parameters
radiusRadius in pixels
colorFill color
featheredWhen true, make border pixels semi-transparent to soften edge
Returns
Sprite within square canvas with edge size ceil(2*radius)

◆ DrawPacMan()

argos_lib::led::Sprite argos_lib::led::animation::DrawPacMan ( float  radius,
frc::AddressableLED::LEDData  color,
units::degree_t  direction,
units::degree_t  mouthAngle,
bool  feathered = false 
)

Generate PacMan sprite :D.

Parameters
radiusRadius of our fearless hero
colorWhy does he have to be yellow?
directionMouth direction
mouthAngleJaw separation angle from mandible to palate
featheredWhen true, make border pixels semi-transparent to soften edge
Returns
PacMan

◆ DrawRectangle()

void argos_lib::led::animation::DrawRectangle ( Panel dest,
unsigned  rectWidth,
unsigned  rectHeight,
float  x,
float  y,
frc::AddressableLED::LEDData  color 
)

Draws an axis-aligned rectangle to a panel. All pixels outside the rectangle are unmodified.

Parameters
destPanel to draw to
rectWidthWidth of rectangle in pixels
rectHeightHeight of rectangle in pixels
xRectangle center x coordinate
yRectangle center y coordinate
colorColor of drawn rectangle

◆ DyingPacMan()

argos_lib::led::AnimatedSprite argos_lib::led::animation::DyingPacMan ( float  radius,
frc::AddressableLED::LEDData  color,
units::degree_t  direction,
units::degree_t  initialMouthAngle,
units::millisecond_t  animationTime,
bool  feathered = false 
)

◆ PacManPacing()

argos_lib::led::Animation argos_lib::led::animation::PacManPacing ( unsigned  offset,
unsigned  width,
unsigned  height,
bool  rainbow,
frc::AddressableLED::LEDData  pacManColor,
argos_lib::led::PrimaryScanDirection  paceDirection,
units::millisecond_t  chompPeriod,
units::millisecond_t  moveSpeed,
argos_lib::led::PanelScanParams  scanParams,
bool  feathered = false 
)

◆ Pong()

argos_lib::led::Animation argos_lib::led::animation::Pong ( unsigned  offset,
unsigned  width,
unsigned  height,
unsigned  ballSize,
bool  rainbow,
frc::AddressableLED::LEDData  ballColor,
frc::AddressableLED::LEDData  backgroundColor,
units::millisecond_t  frameTime,
argos_lib::led::PanelScanParams  scanParams 
)

Animation that kind of works like a DVD player screensaver (https://youtu.be/QOtuX0jL85Y). A ball bounces around the panel changing color.

Parameters
offsetAddress of first LED in controlled panel
widthWidth of panel in pixels
heightHeight of panel in pixels
ballSizeWidth and height of ball in pixels (it's a square... a circle would basically be the same at this size and I'm lazy)
rainbowWhen true, ball changes to a random hue on every bounce!
ballColorInitial color of the bouncing ball
backgroundColorBackground color behind the ball
frameTimeTime for ball to travel one pixel distance
scanParamsParameters controlling the serialization of the internal panel to pixel addresses
Returns
Animation to use to control a panel with this animation pattern

◆ RenderSprite()

void argos_lib::led::animation::RenderSprite ( Panel dest,
const Sprite sprite,
float  x,
float  y,
float  alpha = 1.0 
)

Draw a sprite centered at a point to a panel. This will align the sprite to the nearest pixel alignment on the panel.

Parameters
destPanel to draw to
spriteSprite to draw
xHorizontal center
yVertical center
alphaGlobal sprite transparency where 0 is fully transparent and 1 is fully opaque