Skip to content

Commit

Permalink
[examples] Add linear model.
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-stasse committed Apr 16, 2019
1 parent 9d6305f commit c6a414c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions examples/linear/modelLinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* x3 -> kart veolicity
*/

ModelLinear::ModelLinear(double& mydt, bool noiseOnParameters)
ModelLinear::ModelLinear(double& mydt, bool )
{
stateNb = 2;
commandNb = 1;
Expand Down Expand Up @@ -46,17 +46,19 @@ ModelLinear::ModelLinear(double& mydt, bool noiseOnParameters)
upperCommandBounds << 1.0;
}

ModelLinear::stateVec_t ModelLinear::computeDeriv(double&, const stateVec_t& X,
const commandVec_t &U)
ModelLinear::stateVec_t ModelLinear::
computeDeriv(double&, const stateVec_t& X,
const commandVec_t &U)
{
dX[0] = X[1];
dX[1] = U[0];
return dX;
}

ModelLinear::stateVec_t ModelLinear::computeNextState(double& dt,
const stateVec_t& X,
const commandVec_t& U)
ModelLinear::stateVec_t ModelLinear::
computeNextState(double& ,
const stateVec_t& X,
const commandVec_t& U)
{
/*k1 = computeDeriv(dt, X, U);
k2 = computeDeriv(dt, X + (dt / 2) * k1, U);
Expand All @@ -67,8 +69,10 @@ ModelLinear::stateVec_t ModelLinear::computeNextState(double& dt,
return x_next;
}

void ModelLinear::computeModelDeriv(double& dt, const stateVec_t& X,
const commandVec_t& U)
void ModelLinear::
computeModelDeriv(double& ,
const stateVec_t& ,
const commandVec_t& )
{
/*double dh = 1e-7;
stateVec_t Xp, Xm;
Expand Down

0 comments on commit c6a414c

Please sign in to comment.