This class encapsulates a shooting problem. More...
#include <shooting.hpp>
Public Types | |
| typedef ActionDataAbstractTpl< Scalar > | ActionDataAbstract |
| typedef ActionModelAbstractTpl< Scalar > | ActionModelAbstract |
| typedef MathBaseTpl< Scalar > | MathBase |
| typedef MathBase::VectorXs | VectorXs |
Public Member Functions | |
| ShootingProblemTpl (const ShootingProblemTpl< Scalar > &problem) | |
| Initialize the shooting problem. | |
| ShootingProblemTpl (const VectorXs &x0, const std::vector< std::shared_ptr< ActionModelAbstract > > &running_models, std::shared_ptr< ActionModelAbstract > terminal_model) | |
| Initialize the shooting problem and allocate its data. | |
| ShootingProblemTpl (const VectorXs &x0, const std::vector< std::shared_ptr< ActionModelAbstract > > &running_models, std::shared_ptr< ActionModelAbstract > terminal_model, const std::vector< std::shared_ptr< ActionDataAbstract > > &running_datas, std::shared_ptr< ActionDataAbstract > terminal_data) | |
| Initialize the shooting problem (models and datas) | |
| Scalar | calc (const std::vector< VectorXs > &xs, const std::vector< VectorXs > &us) |
| Compute the cost and the next states. | |
| Scalar | calcDiff (const std::vector< VectorXs > &xs, const std::vector< VectorXs > &us) |
| Compute the derivatives of the cost and dynamics. | |
| template<typename NewScalar> | |
| ShootingProblemTpl< NewScalar > | cast () const |
| Cast the shooting problem to a different scalar type. | |
| void | circularAppend (std::shared_ptr< ActionModelAbstract > model) |
| Circular append of the model and data onto the end running node. | |
| void | circularAppend (std::shared_ptr< ActionModelAbstract > model, std::shared_ptr< ActionDataAbstract > data) |
| Circular append of the model and data onto the end running node. | |
| std::size_t | get_ndx () const |
| Return the dimension of the tangent space of the state manifold. | |
| std::size_t | get_nthreads () const |
| Return the number of threads. | |
| std::size_t | get_nx () const |
| Return the dimension of the state tuple. | |
| const std::vector< std::shared_ptr< ActionDataAbstract > > & | get_runningDatas () const |
| Return the running datas. | |
| const std::vector< std::shared_ptr< ActionModelAbstract > > & | get_runningModels () const |
| Return the running models. | |
| std::size_t | get_T () const |
| Return the number of running nodes. | |
| const std::shared_ptr< ActionDataAbstract > & | get_terminalData () const |
| Return the terminal data. | |
| const std::shared_ptr< ActionModelAbstract > & | get_terminalModel () const |
| Return the terminal model. | |
| const VectorXs & | get_x0 () const |
| Return the initial state. | |
| bool | is_updated () |
| Return only once true is the shooting problem has been changed, otherwise false. | |
| void | quasiStatic (std::vector< VectorXs > &us, const std::vector< VectorXs > &xs) |
| Compute the quasic static commands given a state trajectory. | |
| std::vector< VectorXs > | quasiStatic_xs (const std::vector< VectorXs > &xs) |
| Compute the quasic static commands given a state trajectory. | |
| void | rollout (const std::vector< VectorXs > &us, std::vector< VectorXs > &xs) |
| Integrate the dynamics given a control sequence. | |
| std::vector< VectorXs > | rollout_us (const std::vector< VectorXs > &us) |
| Integrate the dynamics given a control sequence. | |
| void | set_nthreads (const int nthreads) |
| Modify the number of threads using with multithreading support. | |
| void | set_runningModels (const std::vector< std::shared_ptr< ActionModelAbstract > > &models) |
| Modify the running models and allocate new data. | |
| void | set_terminalModel (std::shared_ptr< ActionModelAbstract > model) |
| Modify the terminal model and allocate new data. | |
| void | set_x0 (const VectorXs &x0_in) |
| Modify the initial state. | |
| void | updateModel (const std::size_t i, std::shared_ptr< ActionModelAbstract > model) |
| Update a model and allocated new data for a specific node. | |
| void | updateNode (const std::size_t i, std::shared_ptr< ActionModelAbstract > model, std::shared_ptr< ActionDataAbstract > data) |
| Update the model and data for a specific node. | |
Public Attributes | |
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
Protected Attributes | |
| Scalar | cost_ |
| Total cost. | |
| bool | is_updated_ |
| std::size_t | ndx_ |
| State rate dimension. | |
| std::size_t | nthreads_ |
| std::size_t | nx_ |
| State dimension. | |
| std::vector< std::shared_ptr< ActionDataAbstract > > | running_datas_ |
| Running action data. | |
| std::vector< std::shared_ptr< ActionModelAbstract > > | running_models_ |
| Running action model. | |
| std::size_t | T_ |
| number of running nodes | |
| std::shared_ptr< ActionDataAbstract > | terminal_data_ |
| Terminal action data. | |
| std::shared_ptr< ActionModelAbstract > | terminal_model_ |
| Terminal action model. | |
| VectorXs | x0_ |
| Initial state. | |
Friends | |
| template<class Scalar> | |
| std::ostream & | operator<< (std::ostream &os, const ShootingProblemTpl< Scalar > &problem) |
| Print information on the 'ShootingProblem'. | |
This class encapsulates a shooting problem.
A shooting problem encapsulates the initial state 


Definition at line 32 of file shooting.hpp.
| typedef ActionModelAbstractTpl<Scalar> ActionModelAbstract |
Definition at line 37 of file shooting.hpp.
| typedef ActionDataAbstractTpl<Scalar> ActionDataAbstract |
Definition at line 38 of file shooting.hpp.
| typedef MathBaseTpl<Scalar> MathBase |
Definition at line 39 of file shooting.hpp.
| typedef MathBase::VectorXs VectorXs |
Definition at line 40 of file shooting.hpp.
| ShootingProblemTpl | ( | const VectorXs & | x0, |
| const std::vector< std::shared_ptr< ActionModelAbstract > > & | running_models, | ||
| std::shared_ptr< ActionModelAbstract > | terminal_model ) |
Initialize the shooting problem and allocate its data.
| [in] | x0 | Initial state |
| [in] | running_models | Running action models (size ![]() |
| [in] | terminal_model | Terminal action model |
| ShootingProblemTpl | ( | const VectorXs & | x0, |
| const std::vector< std::shared_ptr< ActionModelAbstract > > & | running_models, | ||
| std::shared_ptr< ActionModelAbstract > | terminal_model, | ||
| const std::vector< std::shared_ptr< ActionDataAbstract > > & | running_datas, | ||
| std::shared_ptr< ActionDataAbstract > | terminal_data ) |
Initialize the shooting problem (models and datas)
| [in] | x0 | Initial state |
| [in] | running_models | Running action models (size ![]() |
| [in] | terminal_model | Terminal action model |
| [in] | running_datas | Running action datas (size ![]() |
| [in] | terminal_data | Terminal action data |
| Scalar calc | ( | const std::vector< VectorXs > & | xs, |
| const std::vector< VectorXs > & | us ) |
Compute the cost and the next states.
For each node 




| [in] | xs | time-discrete state trajectory ![]() ![]() |
| [in] | us | time-discrete control sequence ![]() ![]() |

| Scalar calcDiff | ( | const std::vector< VectorXs > & | xs, |
| const std::vector< VectorXs > & | us ) |
Compute the derivatives of the cost and dynamics.
For each node 




| [in] | xs | time-discrete state trajectory ![]() ![]() |
| [in] | us | time-discrete control sequence ![]() ![]() |

| void rollout | ( | const std::vector< VectorXs > & | us, |
| std::vector< VectorXs > & | xs ) |
Integrate the dynamics given a control sequence.
| [in] | xs | time-discrete state trajectory ![]() ![]() |
| [in] | us | time-discrete control sequence ![]() ![]() |
| std::vector< VectorXs > rollout_us | ( | const std::vector< VectorXs > & | us | ) |
Integrate the dynamics given a control sequence.
| [in] | us | time-discrete control sequence ![]() ![]() |


| void quasiStatic | ( | std::vector< VectorXs > & | us, |
| const std::vector< VectorXs > & | xs ) |
Compute the quasic static commands given a state trajectory.
| [out] | us | time-discrete control sequence ![]() ![]() |
| [in] | xs | time-discrete state trajectory ![]() ![]() |
| std::vector< VectorXs > quasiStatic_xs | ( | const std::vector< VectorXs > & | xs | ) |
Compute the quasic static commands given a state trajectory.
| [in] | xs | time-discrete state trajectory ![]() ![]() |


| void circularAppend | ( | std::shared_ptr< ActionModelAbstract > | model, |
| std::shared_ptr< ActionDataAbstract > | data ) |
Circular append of the model and data onto the end running node.
Once we update the end running node, the first running mode is removed as in a circular buffer.
| [in] | model | action model |
| [in] | data | action data |
| void circularAppend | ( | std::shared_ptr< ActionModelAbstract > | model | ) |
Circular append of the model and data onto the end running node.
Once we update the end running node, the first running mode is removed as in a circular buffer. Note that this method allocates new data for the end running node.
| [in] | model | action model |
| void updateNode | ( | const std::size_t | i, |
| std::shared_ptr< ActionModelAbstract > | model, | ||
| std::shared_ptr< ActionDataAbstract > | data ) |
Update the model and data for a specific node.
| [in] | i | node index ![]() |
| [in] | model | action model |
| [in] | data | action data |
| void updateModel | ( | const std::size_t | i, |
| std::shared_ptr< ActionModelAbstract > | model ) |
Update a model and allocated new data for a specific node.
| [in] | i | node index ![]() |
| [in] | model | action model |
Cast the shooting problem to a different scalar type.
It is useful for operations requiring different precision or scalar types.
| NewScalar | The new scalar type to cast to. |
| void set_nthreads | ( | const int | nthreads | ) |
Modify the number of threads using with multithreading support.
For values lower than 1, the number of threads is chosen by CROCODDYL_WITH_NTHREADS macro
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
Definition at line 36 of file shooting.hpp.
| protected |
Total cost.
Definition at line 289 of file shooting.hpp.
| protected |
number of running nodes
Definition at line 290 of file shooting.hpp.
| protected |
Initial state.
Definition at line 291 of file shooting.hpp.
| protected |
Terminal action model.
Definition at line 293 of file shooting.hpp.
| protected |
Terminal action data.
Definition at line 294 of file shooting.hpp.
| protected |
Running action model.
Definition at line 296 of file shooting.hpp.
| protected |
Running action data.
Definition at line 298 of file shooting.hpp.
| protected |
State dimension.
Definition at line 299 of file shooting.hpp.
| protected |
State rate dimension.
Definition at line 300 of file shooting.hpp.
| protected |
Number of threads launch by the multi-threading application
Definition at line 301 of file shooting.hpp.
| protected |
Definition at line 303 of file shooting.hpp.