Commit bf00d2b7 authored by flforget's avatar flforget Committed by Olivier Stasse
Browse files

simplify ddp-actuator-solver wrt to change in package API

parent b491d9f5
Pipeline #3356 failed with stage
in 41 minutes and 10 seconds
......@@ -52,7 +52,7 @@ namespace dynamicgraph {
protected:
double m_dt;
double m_ambiant_temperature;
DDPSolver<double,5,1>::stateVec_t m_xinit,m_xDes,m_x;
DDPSolver<double,5,1>::stateVec_t m_xinit,m_xDes,m_x,m_zeroState;
DDPSolver<double,5,1>::commandVec_t m_u;
DCTemp m_model;
CostTemp m_cost;
......
......@@ -58,6 +58,10 @@ namespace dynamicgraph
DISABLE_QPBOX)
{
Entity::signalRegistration( ALL_INPUT_SIGNALS << ALL_OUTPUT_SIGNALS );
m_zeroState.setZero();
/* Commands. */
addCommand("init",
makeCommandVoid4(*this, &DdpActuatorSolver::param_init,
docCommandVoid4("Initialize the DDP solver.",
......@@ -99,19 +103,11 @@ namespace dynamicgraph
xDes << m_pos_desSIN(0), 0.0, 0.0, 0.0, 0.0;
m_solver.FirstInitSolver(xinit,xDes,m_T,m_dt,m_iterMax, m_stopCrit);
m_solver.initSolver(xinit,xDes);
/// --- Solve the DDP ---
m_solver.solveTrajectory();
/// --- Get the command ---
DDPSolver<double,5,1>::traj lastTraj;
lastTraj = m_solver.getLastSolvedTrajectory();
DDPSolver<double,5,1>::commandVecTab_t uList;
uList = lastTraj.uList;
s = m_solver.solveTrajectory();
s = uList[0];
return s;
}
......@@ -125,6 +121,8 @@ namespace dynamicgraph
m_dt = timestep;
m_iterMax = nbItMax;
m_stopCrit = stopCriteria;
m_solver.FirstInitSolver( m_zeroState, m_zeroState,
m_T ,m_dt,m_iterMax,m_stopCrit);
}
void DdpActuatorSolver::
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment