This package provides a C++ iLQR library that comes with its python bindings. It allows you to solve iLQR optimization problem on any robot as long as you provid an URDF file describing the kinematics chain of the robot. For debugging purposes it also provide a 2D planar robots class that you can use. You can also apply a spatial transformation to compute robot task space information in the base frame of your choice (e.g. object frame).
Currently, you can optimize different kind of systems:
- Task-space position.
- Task-space position + orientation (quaternion).
- Task-space position + orientation (quaternion) + time.
It also offers you the ability to optimize multiple systems at once (by concatenating them). These systems can be either single integrator or double integrator.
The iLQR problem can be solved by these different manners:
- Recursive solution.
- AL-iLQR solution.
- Batch iLQR with control primitives (sparse computation).
- Batch iLQR (sparse computation)
To use the library you have to define 3 different objects by answering to these three questions:
Once you have answered this question you can create a SimulationInterface
Object (either by using the KDLRobot
or 2DRobot
class).
Once you have answered this question you can create the appropriate System
object.
Once you have answered this question you can create the appropriate Solver
object.
ilqr_planner
contains the C++ library source code.pylqr_planner
contains the python bindings of the C++ library as well as python tutorials inpylqr_planner/Tutorials
.
All the computations use Eigen3.
For the kinematics model of the robot, we use KDL
To load the URDF file and transform it into a KDL Object we use TinyURDFParser, an URDF parser based on TinyXML2 that does not need ROS.
Python bindings are build with the help of pybind11.
Once you managed to install all the dependencies, you can install the library by:
$ cd <where you downloaded your package>
$ git submodule update --init --recursive
$ ./build.sh
The cmake supports three different way to install the python bindings:
- Inside a conda environment (it will automatically detect if you are using conda and install it in the active environment)
- Inside a ROS workspace, for this you can pass the parameter
-DUSE_CATKIN=1
. - If none of the possibilities above is available it will simply install the python package in your system directly.
- To uninstall the library, you can similarly execute the
uninstall.sh
file. *
- Make sure to clone the repository inside a ROS workspace (or move it manually).
- Build the workspace with:
catkin build -DUSE_CATKIN=1
.
No proper documentation is available at the moment. If you want to get API documention, Header files are documented.
API Documentation can be generated with sphinx:
$ cd <where you downloaded your package>/pylqr_planner/docs
$ make html
After that, you can access the generated documentation by opening the index.html
file in pylqr_planner/docs/build/html