https://github.com/baggepinnen/trajectorylimiters.jl
Nonlinear filters to create dynamically feasible reference trajectories
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.3%) to scientific vocabulary
Keywords
Repository
Nonlinear filters to create dynamically feasible reference trajectories
Basic Info
Statistics
- Stars: 20
- Watchers: 3
- Forks: 1
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
TrajectoryLimiters
Contains an implementation of
Nonlinear filters for the generation of smooth trajectories R. Zanasi, C. Guarino Lo Bianco, A. Tonielli
This nonlinear trajectory filter takes a pre-defined reference trajectory $r(t)$ (uniformly sampled in $t$) and filters it (causally) such that the velocity and acceleration are bounded by $ẋM$ and $ẍM$.
What is this good for? Some applications call for a dynamically feasible reference trajectory, i.e., a trajectory with bounded velocity and acceleration, but all you have access to is an instantaneous reference $r(t)$ that might change abruptly, e.g., from an operator changing a set point. In such situations, this filter performs the required pre-processing of the reference to provide a smoother, dynamically feasible reference trajectory. If you already have a trajectory planner that outputs dynamically feasible trajectories, you do not need this package.
Usage
To filter an entire trajectory, create a TrajectoryLimiter and call it like a function:
```julia
using TrajectoryLimiters
ẍM = 50 # Maximum acceleration ẋM = 10 # Maximum velocity Ts = 0.005 # Sample time r(t) = 2.5 + 3 * (t - floor(t)) # Reference to be smoothed t = 0:Ts:3 # Time vector R = r.(t) # An array of sampled position references
limiter = TrajectoryLimiter(Ts, ẋM, ẍM)
X, Ẋ, Ẍ = limiter(R)
plot(
t,
[X Ẋ Ẍ],
plotu = true,
c = :black,
title = ["Position \$x(t)\$" "Velocity \$ẋ(t)\$" "Acceleration \$u(t)\$"],
ylabel = "",
layout = (3,1),
)
plot!(r, extrema(t)..., sp = 1, lab = "", l = (:black, :dashdot))
```

The figure above reproduces figure 10 from the reference, except that we did not increase the acceleration bound (which we call $ẍ_M$ but they call $U$) at time $t=2$ like they did. To do this, use the lower-level interface explained below.
The figure indicates that the limited (solid lines) trajectory follows the original reference trajectory (dashed line) whenever possible, but deviates whenever the original trajectory violates the velocity or acceleration constraints. When it has deviated, the limited trajectory converges to the original reference trajectory again with a time-optimal behavior whenever the velocity and acceleration profiles allow.
Since the trajectory limiter outputs position, velocity and acceleration, it is easy to use inverse-based feedforward models to improve the trajectory tracking compared to purely feedback-based controllers (always use some form of feedforward if trajectory-tracking performance is important).
To limit a trajectory online, i.e., one step at a time, call the limiter like so
julia
state, ẍ = limiter(state, r(t))
this outputs a new state, containing $x, ẋ, r, ṙ$ as well as the acceleration $ẍ$.
One can also call the lower-level function
julia
state, ẍ = TrajectoryLimiter.trajlim(state, rt, Ts, ẋM, ẍM)
directly in case one would like to change any of the parameters online.
To set the initial state of the trajectory limiter, create a
julia
TrajectoryLimiters.State(x, ẋ, r, ṙ)
manually. The default choice if no initial state is given when batch filtering an array R is TrajectoryLimiters.State(0, 0, r, 0) where r is the first value in the array R.
Performance
On a laptop from 2021, filtering a trajectory R of length 601 samples takes
```julia
julia> length(R)
601
julia> @btime $limiter($R); 23.745 μs (3 allocations: 14.62 KiB) ```
With preallocated output arrays, you can avoid the allocations completely: ```julia julia> X, Ẋ, Ẍ = similar.((R,R,R));
julia> @btime $limiter($X, $Ẋ, $Ẍ, $R); 20.813 μs (0 allocations: 0 bytes) ```
Taking a single step takes
julia
julia> @btime $limiter(TrajectoryLimiters.State(0.0), 0.0);
17.372 ns (0 allocations: 0 bytes)
Owner
- Name: Fredrik Bagge Carlson
- Login: baggepinnen
- Kind: user
- Location: Lund, Sweden
- Website: baggepinnen.github.io
- Twitter: baggepinnen
- Repositories: 59
- Profile: https://github.com/baggepinnen
Control systems, system identification, signal processing and machine learning
GitHub Events
Total
- Issues event: 4
- Watch event: 5
- Issue comment event: 6
- Push event: 1
- Pull request event: 2
- Fork event: 1
Last Year
- Issues event: 4
- Watch event: 5
- Issue comment event: 6
- Push event: 1
- Pull request event: 2
- Fork event: 1
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Fredrik Bagge Carlson | b****n@g****m | 9 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 4
- Total pull requests: 1
- Average time to close issues: about 4 hours
- Average time to close pull requests: 7 minutes
- Total issue authors: 3
- Total pull request authors: 1
- Average comments per issue: 1.5
- Average comments per pull request: 2.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 1
- Average time to close issues: about 7 hours
- Average time to close pull requests: 7 minutes
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 2.5
- Average comments per pull request: 2.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ufechner7 (2)
- JuliaTagBot (1)
- baggepinnen (1)
Pull Request Authors
- ufechner7 (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
juliahub.com: TrajectoryLimiters
Nonlinear filters to create dynamically feasible reference trajectories
- Documentation: https://docs.juliahub.com/General/TrajectoryLimiters/stable/
- License: MIT
-
Latest release: 0.1.0
published about 3 years ago
Rankings
Dependencies
- actions/checkout v2 composite
- codecov/codecov-action v2 composite
- julia-actions/cache v1 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
- JuliaRegistries/TagBot v1 composite