The features of MPT include:
High performance
MPT started with the design decision that the performance of robot-specific motion planners in small battery-powered robots is more important than runtime flexibility. For example, an articulated robot does not need the flexibility to compute motion plans for a wheeled robot or aerial drone. Thus MPT uses compile-time algorithms to generate robot-specific motion planners instead of using a flexible runtime system.
Floating-point precision selection
Robots with low-power CPUs may have performance and memory requirements that benefit from using single-precision (32-bit) floating-point arithmetic. Conversely, some robots will be required to plan motions with the precision that only double-precision (64-bit) or better will offer. MPT allows the selection of floating-point precision at compile-time.
Custom state and trajectory types
Motion planners must interoperate with other robot software components, and thus MPT should generate and operate on graph structures with robot-specific data types that do not require runtime translation. For example, when using a robot’s built-in software to send motion commands to the actuators, MPT can directly use the robot’s built-in data types when computing its motion planning graphs and storing the plan, creating added efficiency.
(De-)composible metric spaces
Some motion planners and nearest neighbor data structures benefit from the ability to decompose the state space into its constituent components. Complex metric state spaces in MPT can be composed from simpler metric spaces and decomposed at compile-time to select and construct state-space specific implementations of motion planners and data structures.
Multicore ready
CPUs are trending towards increased multicore parallelism. However, many low-power CPUs are still single-core, and robots with multicore CPUs may only wish to use a single core for motion planning. Since multi-core parallelism requires additional overhead and is not always necessary, MPT can switch between generating multi-core parallel and single-core planners.
C++ 17 header-only library
The latest C++ standard provides a wealth of capabilities that ease development of template-based programs while remaining compatible with existing C and C++ software libraries. A header-only library means that code is only compiled if your application needs it, which can ease deployment.
How it works
MPT uses C++ templates, a Turing-complete compile-time polymorphic system, to generate robot-specific motion planners based upon a robot/scenario description class and an algorithm selection tag.
The developer's job is thus to define a class for the robot that defines the configuration or state space in which the robot will plan, the state C++ data type, state and motion validity checks, and a sampler. MPT does not require or provide a base class for scenarios---they can be any class and part of an integrated robot system.
After the user defines the robot's scenario class,
the developer then selects the type of motion planning
algorithm to use, and combines them with
a mpt::Planner<>
template to create a
planner class and instance. When compiled, the
meta-programming in MPT's templates generate a motion
planner that is specific to the robot---it uses the
robot's data-types for states/configurations and
motions, and directly invokes the robot-specific
validation code.
The generated motion planner gains performance by giving up runtime flexiblity associated with runtime polymorphics systems (e.g., virtual classes and methods).
template <typename Scalar = double>
struct MyScenario {
// Use SE(3) state space
using Space = SE3Space<Scalar>;
using State = typename Space::State;
// Our goal is a single state (with tolerance)
using Goal = mpt::GoalState<State>;
// Bound the workspace for uniform sampling
using Bounds = mpt::BoxBounds<Scalar, 3>;
// Methods to return object instances to
// the planning algorithm templates.
const Space& space() const;
const Bounds& bounds() const;
const Goal& goal() const;
// State and motion validity checks
bool validState(const State& q) const;
bool validMotion(
const State& a, const State& b) const;
};
// use an RRT planner
mpt::Planner<MyScenario<>,mpt::RRT<>> planner;
// solve for 250 milliseconds
planner.solve(250ms);
Demos
The following images show some of the motion plans generated by the demos in included in MPT. Each of these motion planning scenarios was run on a laptop with an Intel Core i5 using all 4 cores.
In the images, the gray lines show the generated tree of motions. The red line shows the best path found by the motion planner before terminating the planner.
Click on the image to see it full size.
Stay tuned for more!
Releases
MPT is available on GitHub.
Requirements
MPT requires a C++ 17 capable compiler, and has been tested on clang 5+ and GCC 7+.
MPT's requires two header-only libraries: Eigen 3 linear algebra library, and Nigh concurrent nearest neighbors library.
Multicore planners require OpenMP (which may already be provided by your compiler).
MPT's test suite requires the Ninja build system.
The included demos require Flexible Collision Library, and Open-Asset-Importer-Lib.
Citing MPT
If you use MPT in your research, please cite the following paper:
- Jeffrey Ichnowski and Ron Alterovitz, “Motion Planning Templates: A Motion Planning Framework for Robots with Low-power CPUs,” in Proc. IEEE International Conference on Robotics and Automation (ICRA), May 2019. (PDF)
If you make specific use of the parallel sampling-based motion planners in MPT, please cite the following papers as appropriate:
- Jeffrey Ichnowski and Ron Alterovitz, “Scalable Multicore Motion Planning Using Lock-Free Concurrency,” IEEE Transactions on Robotics, vol. 30, no. 5, pp. 1123-1136, Oct. 2014. (PDF)
- Jeffrey Ichnowski, Jan Prins, and Ron Alterovitz, “Cloud-based Motion Plan Computation for Power-Constrained Robots,” in Algorithmic Foundations of Robotics (WAFR 2016), Dec. 2016. (PDF)