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;
244class CircleGenerator :
public Plugin{
272 void enroll(
RPC *rpc,
const String& instance_name);
297 DecimalPosition input_position;
298 DecimalPosition output_x_position;
299 DecimalPosition output_y_position;
300 bool no_input =
false;
304 volatile float64_t current_angle_rad = 0;
305 volatile float64_t delta = 0;
319class VelocityGenerator :
public Plugin{
335 void enroll(
RPC *rpc,
const String& instance_name);
348 DecimalPosition target_position = 0;
386 void go(float64_t distance_or_position, uint8_t mode);
393 void go(float64_t distance_or_position, uint8_t mode, ControlParameter speed);
411 void enroll(
RPC *rpc,
const String& instance_name);
415 DecimalPosition target_position = 0;
416 DecimalPosition current_position = 0;
432class PathLengthGenerator2D :
public Plugin{
436 PathLengthGenerator2D();
446 inline void set_ratio(ControlParameter output_distance, ControlParameter input_distance){
447 set_ratio(output_distance / input_distance);
465 void enroll(
RPC *rpc,
const String& instance_name);
488 DecimalPosition input_1_position;
489 DecimalPosition input_2_position;
490 DecimalPosition output_position;
508class PathLengthGenerator3D :
public Plugin{
512 PathLengthGenerator3D();
522 inline void set_ratio(ControlParameter output_distance, ControlParameter input_distance){
523 set_ratio(output_distance / input_distance);
529 void enroll(
RPC *rpc,
const String& instance_name);
554 DecimalPosition input_1_position;
555 DecimalPosition input_2_position;
556 DecimalPosition input_3_position;
557 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:250
BlockPort output_y
Output BlockPort for Y component of the circular path.
Definition generators.hpp:294
BlockPort input
Optional input BlockPort (phase). If setNoInput() is called, this input is ignored.
Definition generators.hpp:280
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:255
BlockPort output_x
Output BlockPort for X component of the circular path.
Definition generators.hpp:287
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:486
ControlParameter ratio
ControlParameter scaling output relative to input path length (output/input).
Definition generators.hpp:470
BlockPort input_2
Second input BlockPort (e.g., Y position).
Definition generators.hpp:479
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:475
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:543
BlockPort input_1
First input BlockPort (e.g., X position).
Definition generators.hpp:539
ControlParameter ratio
ControlParameter scaling output relative to input path length (output/input).
Definition generators.hpp:534
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:547
BlockPort output
Output BlockPort proportional to 3D path length.
Definition generators.hpp:551
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:397
BlockPort output
Output BlockPort for the PositionGenerator. This is what you map from to a downstream component.
Definition generators.hpp:406
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:343
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:326
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.