Curves API
skelarm.curves
Closed periodic task-space curves for repeated tracing.
A periodic-curve task makes the robot's tip trace a closed planar curve over and over.
Each curve is a position function of a phase angle theta (2*pi-periodic);
:class:PeriodicTaskReference maps simulated time to phase (theta = omega * t with
omega = 2*pi / period) and exposes the TaskReference interface, so
:func:~skelarm.ik_joint_reference converts it to a joint reference for the tracking
controllers. The built-in curves are circle, ellipse, lemniscate (the
horizontal Bernoulli infinity), vertical_lemniscate (an upright figure-eight), and
rose (a k-petal rhodonea r = a*cos(k*theta)). Register your own with
:func:register_curve.
See docs/reference/09_trajectory_filtering.md and the
Control Configuration guide.
PeriodicTaskReference
A task-space reference that traces a closed curve with a fixed period.
Implements the TaskReference interface (sample + duration). The
velocity and acceleration are obtained by central differences in time (they are not
needed by :func:~skelarm.ik_joint_reference, which uses only the position).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
curve
|
CurveFunction
|
A |
required |
period
|
float
|
Time for one full loop (seconds). |
required |
duration
|
float
|
Total trace time (seconds); |
required |
Source code in src/skelarm/curves.py
__init__(curve, *, period, duration)
Store the curve and its time mapping.
Source code in src/skelarm/curves.py
position(t)
sample(t)
Return (p, dp, ddp) at time t (position and time derivatives).
Source code in src/skelarm/curves.py
build_curve(kind, params)
Build the position function for curve kind from params.
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/skelarm/curves.py
curve_kinds()
register_curve(name, factory)
Register a closed-curve factory under name for the periodic_curve task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The |
required |
factory
|
CurveFactory
|
A callable |
required |