100 void enroll(
RPC *rpc,
const String& instance_name);
103 DecimalPosition input_position;
104 DecimalPosition output_position;
105 volatile ControlParameter _lower_threshold = 0;
106 volatile ControlParameter _upper_threshold = 0;
107 void (*callback_on_lower_threshold)() =
nullptr;
108 void (*callback_on_upper_threshold)() =
nullptr;
109 bool clamp_lower =
false;
110 bool clamp_upper =
false;
111 bool upper_set =
false;
112 bool lower_set =
false;
143 volatile ControlParameter
phase = 0.0;
186 void enroll(
RPC *rpc,
const String& instance_name);
192 DecimalPosition input_position;
193 DecimalPosition output_position;
194 bool no_input =
false;
198 volatile float64_t current_angle_rad = 0;
199 volatile float64_t delta = 0;
214class WaveGenerator2D :
public Plugin{
233 void enroll(
RPC *rpc,
const String& instance_name);
300 DecimalPosition input_frequency_value;
301 DecimalPosition input_t_value;
303 DecimalPosition input_theta_value;
304 DecimalPosition output_x_position;
305 DecimalPosition output_y_position;
307 bool no_input =
false;
310 volatile float64_t current_angle_rad = 0;
325class CircleGenerator :
public Plugin{
353 void enroll(
RPC *rpc,
const String& instance_name);
378 DecimalPosition input_position;
379 DecimalPosition output_x_position;
380 DecimalPosition output_y_position;
381 bool no_input =
false;
385 volatile float64_t current_angle_rad = 0;
386 volatile float64_t delta = 0;
400class VelocityGenerator :
public Plugin{
416 void enroll(
RPC *rpc,
const String& instance_name);
429 DecimalPosition target_position = 0;
467 void go(float64_t distance_or_position, uint8_t mode);
474 void go(float64_t distance_or_position, uint8_t mode, ControlParameter speed);
492 void enroll(
RPC *rpc,
const String& instance_name);
496 DecimalPosition target_position = 0;
497 DecimalPosition current_position = 0;
513class PathLengthGenerator2D :
public Plugin{
517 PathLengthGenerator2D();
527 inline void set_ratio(ControlParameter output_distance, ControlParameter input_distance){
528 set_ratio(output_distance / input_distance);
546 void enroll(
RPC *rpc,
const String& instance_name);
569 DecimalPosition input_1_position;
570 DecimalPosition input_2_position;
571 DecimalPosition output_position;
589class PathLengthGenerator3D :
public Plugin{
593 PathLengthGenerator3D();
603 inline void set_ratio(ControlParameter output_distance, ControlParameter input_distance){
604 set_ratio(output_distance / input_distance);
610 void enroll(
RPC *rpc,
const String& instance_name);
635 DecimalPosition input_1_position;
636 DecimalPosition input_2_position;
637 DecimalPosition input_3_position;
638 DecimalPosition output_position;
BlockPorts provide a unified interface for mapping inputs and outputs of different StepDance componen...
Definition core.hpp:148
void debugPrint()
Print debug information about the CircleGenerator to the Serial console.
void setNoInput()
Use internal frame count for phase instead of an input signal. This will allow the circle generator t...
volatile ControlParameter radius
ControlParameter for the circle radius. You can set it directly or map an input to it.
Definition generators.hpp:331
BlockPort output_y
Output BlockPort for Y component of the circular path.
Definition generators.hpp:375
BlockPort input
Optional input BlockPort (phase). If setNoInput() is called, this input is ignored.
Definition generators.hpp:361
void begin()
Initialize the CircleGenerator. Must be called to set up the generator.
volatile ControlParameter rotational_speed_rev_per_sec
ControlParameter for the rotational speed, in revolutions per second. You can set it directly or map ...
Definition generators.hpp:336
BlockPort output_x
Output BlockPort for X component of the circular path.
Definition generators.hpp:368
void set_ratio_for_circle(ControlParameter circle_radius, ControlParameter output_per_revolution)
Configure the generator for circular motion (e.g., from CircleGenerator). Sets the ratio so that the ...
void begin()
Initialize the PathLengthGenerator2D. Must be called to set up the generator.
BlockPort output
Output BlockPort proportional to 2D path length.
Definition generators.hpp:567
ControlParameter ratio
ControlParameter scaling output relative to input path length (output/input).
Definition generators.hpp:551
BlockPort input_2
Second input BlockPort (e.g., Y position).
Definition generators.hpp:560
void set_ratio(ControlParameter ratio)
Set the ratio between output distance and input path length.
BlockPort input_1
First input BlockPort (e.g., X position).
Definition generators.hpp:556
void set_ratio(ControlParameter ratio)
Set the ratio between output distance and input path length.
BlockPort input_2
Second input BlockPort (e.g., Y position).
Definition generators.hpp:624
BlockPort input_1
First input BlockPort (e.g., X position).
Definition generators.hpp:620
ControlParameter ratio
ControlParameter scaling output relative to input path length (output/input).
Definition generators.hpp:615
void begin()
Initialize the PathLengthGenerator3D. Must be called to set up the generator.
BlockPort input_3
Third input BlockPort (e.g., Z position).
Definition generators.hpp:628
BlockPort output
Output BlockPort proportional to 3D path length.
Definition generators.hpp:632
void go(float64_t distance_or_position, uint8_t mode)
Command the PositionGenerator to move to a specified distance or position.
PositionGenerator()
Default constructor for PositionGenerator. Does not initialize the Generator. Call begin() to set up ...
void set_speed(ControlParameter speed)
Set the speed (maximum velocity) for the PositionGenerator.
volatile ControlParameter speed_units_per_sec
ControlParameter that determines the speed of the PositionGenerator. Will not be used if speed is pro...
Definition generators.hpp:478
BlockPort output
Output BlockPort for the PositionGenerator. This is what you map from to a downstream component.
Definition generators.hpp:487
void begin()
Initialize the PositionGenerator. Must be called to set up the generator.
void go(float64_t distance_or_position, uint8_t mode, ControlParameter speed)
Command the PositionGenerator to move to a specified distance or position with a specified speed.
RPC class for handling remote procedure calls over serial streams.
Definition rpc.hpp:35
void setUpperThreshold(float64_t upper_threshold, bool clamp_to_upper=false)
Set the upper threshold value and optionally enable clamping to the upper threshold....
void begin()
Initialize the ThresholdGenerator.
void setUpperCallback(void(*callback_function)())
Set the callback function to be called when the input crosses the upper threshold.
void setLowerThreshold(float64_t lower_threshold, bool clamp_to_lower=false)
Set the lower threshold value and optionally enable clamping to the lower threshold....
void clearLowerThreshold()
Clear the lower threshold, disabling its effect.
void clearUpperThreshold()
Clear the upper threshold, disabling its effect.
void enable()
Enable the ThresholdGenerator.
BlockPort output
Output BlockPort for the ThresholdGenerator. This is what you map from to a downstream component....
Definition generators.hpp:95
void setLowerCallback(void(*callback_function)())
Set the callback function to be called when the input crosses the lower threshold.
void disable()
Disable the ThresholdGenerator.
void debugPrint()
Print debug information about the ThresholdGenerator to the Serial console.
ThresholdGenerator()
Default constructor for ThresholdGenerator. Does not initialize board hardware. Call begin() to set u...
BlockPort input
Input BlockPort for the ThresholdGenerator. This is what you map to with an upstream component.
Definition generators.hpp:88
void begin()
Initialize the VelocityGenerator. Must be called to set up the generator.
BlockPort output
Output BlockPort for the generated position signal.
Definition generators.hpp:424
volatile ControlParameter speed_units_per_sec
ControlParameter specifying the generation speed in units per second. You can set it directly or map ...
Definition generators.hpp:407
BlockPort input
Input BlockPort for the WaveGenerator1D. This is what you map to with an upstream component....
Definition generators.hpp:174
void enable()
Enable the WaveGenerator1D.
volatile ControlParameter frequency
ControlParameter for the frequency of the waveform in revolutions per second (e.g....
Definition generators.hpp:147
volatile ControlParameter phase
ControlParameter for the phase of the waveform in radians. Phase is the offset of the waveform from i...
Definition generators.hpp:143
void debugPrint()
Print debug information about the WaveGenerator1D to the Serial console.
volatile ControlParameter amplitude
ControlParameter for the amplitude of the waveform- the distance from the center line of the wave for...
Definition generators.hpp:139
WaveGenerator1D()
Default constructor for WaveGenerator1D. Does not initialize board hardware. Call begin() to set up t...
void setNoInput()
Set the generator to use internal frame count for waveform generation instead of an input signal....
void begin()
Initialize the WaveGenerator1D. Must be called to set up the generator.
BlockPort output
Output BlockPort for the WaveGenerator1D. This is what you map from to a downstream component.
Definition generators.hpp:181
void disable()
Disable the WaveGenerator1D.
BlockPort input_theta
Input BlockPort to map the desired 2D orientation of the wave. This is given as an angle in radians,...
Definition generators.hpp:281
BlockPort output_y
Output BlockPort for the generated position signal on axis Y.
Definition generators.hpp:297
volatile ControlParameter amplitude
Wave amplitude.
Definition generators.hpp:220
void setNoInput()
Call to configure the wave generator to not need/user input_t and instead just base the wave paramete...
BlockPort output_x
Output BlockPort for the generated position signal on axis X.
Definition generators.hpp:289
BlockPort input_t
Input BlockPort to map a parameter that will be used to compute the wave.
Definition generators.hpp:268
BlockPort input_frequency
Input BlockPort to map a variable wave frequency value.
Definition generators.hpp:258
void begin()
Initialize the time-based interpolator. This must be called to set up the interpolator.