A framework to create and manage trajectories.
Three motivations behing this framework:
- lack of unified description of trajectory management (I have a trajectory to follow, I am at a given state. What should I take from my trajectory?)
- unclear distinction between trajectories and paths (and account for path properties, such as curvature, to infer trajectory bounds w.r.t. e.g. Cartesian bounds)
- few multi-axis trajectory generators (make use of a 1D generator to synchronize multiple axes)
Five main objects are defined within this framework:
traxxs::path::PathSegment
: a path segment, defining a mapping between arc coordinates (any 1D parameterization of a path) and "real" ("path") coordinatestraxxs::path::Path
: a complete path, i.e. a consistent (continuous) list of path segmentstraxxs::arc::ArcTrajGen
: a 1D trajectory generator. Multiple implementations can be added. Is used to define trajectory on arc coordinates.traxxs::trajectory::Trajectory
: an object coupling a Path to an ArcTrajGentraxxs::tracker::Tracker
: a tracker object managing a Trajectory. Provides a new desired state with respect to a trajectory and the current state. Multiple implementations.
- Eigen 3
- softMotion (optional, shipped, as submodule)
- scurve_traj_gen (optional, shipped, as submodule)
sudo apt-get install libeigen3-dev
softMotion
depends on libxml2
sudo apt-get install libxml2-dev
# clone the repo and go the the root folder
git clone [...]
# update and initialize the submodules
git submodule update --init --recursive
# create a build directory
mkdir build && cd build
# build it
cmake ..
make
# install it, optionally
# sudo make install
USE_TG_SOFTMOTION
, defaults toON
: whether or not to use the softmotion implementationUSE_TG_SCURVETRAJGEN
, defaults toOFF
: whether or not to use the scurve_traj_gen implementation (SCurve is not mature yet at the time of writing)BUILD_SAMPLES
, defaults toON
: whether or not to build the samples
find_package(traxxs REQUIRED)
add_executable(foo main.cpp)
# example using the softMotion trajectory generator implementation
target_link_libraries(foo traxxs::traxxs traxxs::traxxs_softmotion)
# # example using the SCurve trajectory generator implementation
# target_link_libraries(foo traxxs::traxxs traxxs::traxxs_scurve)
Some samples output a json describing the trajectory. A python plotter is provided to interpret this output.
Example usage:
## Go to your build directory.
# samples for path creation
./samples/sample_path
./samples/sample_path_cart
# samples for raw trajectory
./samples/sample_traj > out.json && python samples/python/plot_json.py out.json
./samples/sample_traj_cart > out.json && python samples/python/plot_json.py out.json
# samples for trajectory tracking
./samples/sample_tracker_time_cart > out.json && python samples/python/plot_json.py out.json
./samples/sample_tracker_space_cart > out.json && python samples/python/plot_json.py out.json
- Check consistency of use of const reference passing of
shared_ptr
. - Extend to multi-axis trajectory generators