20 const boost::shared_ptr<crocoddyl::ShootingProblemTpl<Scalar>>
22 const crocoddyl::ShootingProblemTpl<Scalar> &cpb = *croc_problem;
23 using VectorXs =
typename math_types<Scalar>::VectorXs;
24 using StageModel = StageModelTpl<Scalar>;
25 using ActionModelWrapper = ActionModelWrapperTpl<Scalar>;
27 const std::size_t nsteps = cpb.get_T();
28 const VectorXs &x0 = cpb.get_x0();
30 const auto &running_models = cpb.get_runningModels();
34 std::vector<shared_ptr<StageModel>> stages;
35 stages.reserve(nsteps);
36 for (std::size_t i = 0; i < nsteps; i++) {
37 stages.push_back(std::make_shared<ActionModelWrapper>(running_models[i]));
39 auto converted_cost = std::make_shared<CrocCostModelWrapperTpl<Scalar>>(
40 cpb.get_terminalModel());
41 TrajOptProblemTpl<Scalar> problem(x0, stages, converted_cost);