|
Stepdance Software Library
|
Used for generating circular motion signals. More...
#include <generators.hpp>
Public Member Functions | |
| void | begin () |
| Initialize the CircleGenerator. Must be called to set up the generator. | |
| void | setNoInput () |
| Use internal frame count for phase instead of an input signal. This will allow the circle generator to update automatically based on frame rate. When enabled, input is ignored. | |
| void | debugPrint () |
| Print debug information about the CircleGenerator to the Serial console. | |
Public Attributes | |
| volatile ControlParameter | radius = 1.0 |
| ControlParameter for the circle radius. You can set it directly or map an input to it. | |
| volatile ControlParameter | rotational_speed_rev_per_sec = 6 |
| ControlParameter for the rotational speed, in revolutions per second. You can set it directly or map an input to it. | |
| BlockPort | input |
| Optional input BlockPort (phase). If setNoInput() is called, this input is ignored. | |
| BlockPort | output_x |
| Output BlockPort for X component of the circular path. | |
| BlockPort | output_y |
| Output BlockPort for Y component of the circular path. | |
Protected Member Functions | |
| void | run () |
Protected Attributes | |
| volatile float64_t | current_angle_rad = 0 |
| volatile float64_t | delta = 0 |
Used for generating circular motion signals.
A CircleGenerator produces a motion signal that traverses a circle defined by a radius and a rotational speed. It can be driven by an input signal (phase) or run autonomously using the internal frame count when setNoInput() is called. The two outputs, output_x and output_y, provide the Cartesian components of the circle. Here's an example of how to instantiate and configure a CircleGenerator:
| BlockPort CircleGenerator::input |
Optional input BlockPort (phase). If setNoInput() is called, this input is ignored.
| BlockPort CircleGenerator::output_x |
Output BlockPort for X component of the circular path.
| BlockPort CircleGenerator::output_y |
Output BlockPort for Y component of the circular path.