Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic/hrg #57

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
23be1c5
Mehdi Damping
rafaelxero Sep 6, 2017
fc621d3
Added rotor inertia to the mass matrix
rafaelxero Sep 28, 2017
da3dcbf
Merge branch 'master' of https://github.com/jrl-umi3218/RBDyn into to…
rafaelxero Sep 28, 2017
d1beeef
Fixed the indices for the allocation of the rotor inertia
rafaelxero Oct 25, 2017
13997be
Implemented the computation of the Coriolis factorization in FD
rafaelxero Oct 31, 2017
45edce9
Merge branch 'master' of https://github.com/jrl-umi3218/RBDyn into to…
rafaelxero Nov 13, 2017
3d3f186
Added the optimized Coriolis Factorization calculation
rafaelxero Dec 15, 2017
733f34e
Merge branch 'master' of https://github.com/jrl-umi3218/RBDyn into to…
rafaelxero Dec 15, 2017
8e66d43
Added IntegralTerm class
rafaelxero Mar 6, 2018
2659326
Changed Int to Intgl and added a more optimal way of computing inv(H)
rafaelxero Mar 9, 2018
e0faa38
Merge branch 'master' of https://github.com/jrl-umi3218/RBDyn into to…
rafaelxero Mar 9, 2018
aae675f
Merge branch 'topic/HRG' of github.com:rafaelxero/RBDyn into topic/HRG
rafaelxero Mar 9, 2018
52d812a
Debugging IntglTerm [WIP]
rafaelxero Mar 25, 2018
398bc33
Little format correction
rafaelxero Mar 26, 2018
3c679b8
Fixed conflicts
rafaelxero Mar 26, 2018
18db62c
Removed commented prints and a dirty patch to put P[i] as 0 for some …
rafaelxero Mar 29, 2018
6cf99fa
added a print for debugging
rafaelxero Mar 30, 2018
4949d67
debugging gammaD and H
rafaelxero Apr 16, 2018
21bdd96
Changes for debugging
rafaelxero Jul 27, 2018
23768fa
In order to merge
rafaelxero Jul 28, 2018
f64b144
Added MassDiagonal and debugging prints
rafaelxero Jul 29, 2018
e09afd8
Added some debugging prints
rafaelxero Jul 30, 2018
440e958
Added computeHIr, enabled the computation of gammaD and commented out…
rafaelxero Jul 30, 2018
b2c3096
Changed some debugging comments
rafaelxero Jul 31, 2018
70c2bbd
Removed debugging comments
rafaelxero Aug 7, 2018
5fdeb9c
Merge branch 'topic/HRG_FD' into topic/HRG
rafaelxero Aug 7, 2018
92a4e3a
Added iostream to print
rafaelxero Aug 13, 2018
3c0cf21
Created a base class: TorqueFeedbackTerm, and added the subclass Pass…
rafaelxero Dec 3, 2018
ab3d2e8
Cleaned debugging comments
rafaelxero Dec 3, 2018
d7d6f51
Modified the definition of L in Passivity PID Term
rafaelxero Feb 18, 2019
15cab80
Merged master into this temporal branch, created from topic/HRG
rafaelxero Feb 18, 2019
49f7835
Changed namespace from coriolis to rbd
rafaelxero Feb 18, 2019
ab466ef
Merged Pierre's branch with mine
rafaelxero Mar 4, 2019
78ed239
Merge branch 'master' of https://github.com/jrl-umi3218/RBDyn into temp
rafaelxero Mar 6, 2019
f8831d9
Started to code IntegralTermAntiWindup [WIP]
rafaelxero Jun 23, 2019
45837f3
Implemented the Rev_Fixed type of joint as well as the method fixRevJ…
rafaelxero Jul 7, 2019
8fd9785
Finished to code the antiwindup gain
rafaelxero Jul 7, 2019
fafea4e
Some debugging comments
rafaelxero Jul 8, 2019
c6038bb
Changed temporarily sComputeH to use a python script without errors
rafaelxero Jul 10, 2019
9857f87
Degugging message on the size of H()
rafaelxero Jul 10, 2019
2e50e2d
Solved conflicts
rafaelxero Jul 11, 2019
2e86051
Solved conflicts
rafaelxero Jul 17, 2019
a1c3c49
Had erased these by mistake
rafaelxero Jul 17, 2019
2ea72cd
They are actually considered as submodules now
rafaelxero Jul 17, 2019
72dc2ca
Updated .gitmodules from master
rafaelxero Jul 17, 2019
e24ad64
Calculated time spent on computations
rafaelxero Jul 29, 2019
0f14fe9
Added ElapsedTimeMap to TorqueFeedbackTerm
rafaelxero Jul 30, 2019
708d6e9
Updated the antiwindup solution using max acceleration for the floati…
rafaelxero Aug 5, 2019
3f38499
Added IntegralTermAntiWindup to the enum and disabled debugging comments
rafaelxero Aug 5, 2019
fcdefbe
Started to implement the feedforward friction term
rafaelxero Aug 22, 2019
453c199
Improved the Coriolis computation
rafaelxero Aug 23, 2019
27ede5d
Added feedforward Friction vector computation
rafaelxero Aug 23, 2019
1b4ada8
Added three models of friction and centralized it
rafaelxero Aug 25, 2019
67ebd56
Modified IntegralTermAntiWindup to specify each maximum acceleration …
rafaelxero Sep 2, 2019
82ed1a8
New model of friction
rafaelxero Sep 13, 2019
9a46b6c
Added simplified rational model of the stiction
rafaelxero Sep 16, 2019
9a14b74
Improved the computation of r, Bf and delta
rafaelxero Sep 17, 2019
9f0c1d9
Prepare to log the Coriolis matrix
rafaelxero Oct 7, 2019
6f6fa8f
Coriolis matrix as member variable and get function
rafaelxero Oct 10, 2019
a525756
fixed conflicts
rafaelxero Oct 11, 2019
4b8b3b0
Disabled debugging comments on the anti-windup solution
rafaelxero Nov 10, 2019
e9bc784
Add the possibility of using a filtered integral
mehdi-benallegue Dec 4, 2019
427545a
Merge pull request #1 from mehdi-benallegue/topic/HRG
rafaelxero Dec 5, 2019
65905af
Correct the computation of the filtered S
mehdi-benallegue Dec 5, 2019
1e7bba5
Working on the smooth torque transition [WIP]
rafaelxero Jan 10, 2020
929d347
Merge remote-tracking branch 'rafaelxero/topic/HRG' into topic/HRG
mehdi-benallegue Jan 20, 2020
7eaa455
Merge pull request #2 from mehdi-benallegue/topic/HRG
rafaelxero Jan 21, 2020
125f73d
Continued working on the smooth transition but still testing
rafaelxero Jan 23, 2020
dc3f4d5
Solved conflicts by moving my files to the new subdirectory
rafaelxero May 22, 2020
1eaaab7
Cleaned commented out code from TorqueFeedbackTerm and disabled (temp…
rafaelxero May 29, 2020
9f6fbfd
Fixed index error related to the anti-windup solution of the floating…
rafaelxero Jun 2, 2020
bdf2bfe
Fixed asser error related to zero sized matrices when building H and C
mehdi-benallegue Jul 1, 2020
2c9150a
Merge pull request #4 from mehdi-benallegue/topic/HRG
rafaelxero Jul 1, 2020
036fbca
Added some debugging comments for the smooth transition to torque con…
rafaelxero Jul 9, 2020
7c79aa9
Merge branch 'master' of https://github.com/jrl-umi3218/RBDyn into to…
rafaelxero Jul 21, 2020
8d6c247
Temporarily disabled the lambda for the positions of the floating-bas…
rafaelxero Jul 21, 2020
26877a7
Solved conflicts
rafaelxero Feb 4, 2021
8ab0c73
Solved the issues that were warnings before and now they are errors
rafaelxero Feb 4, 2021
3005fe5
Treat the part of K corresponding to the free-flyer different (test)
rafaelxero Feb 14, 2021
cfdfa0c
Merge branch 'master' into topic/HRG
rafaelxero Aug 6, 2021
83549fb
[Joint.h] Specified missing Eigen::
rafaelxero Aug 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/RBDyn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

set(SOURCES MultiBodyGraph.cpp MultiBody.cpp MultiBodyConfig.cpp
FK.cpp FV.cpp FA.cpp Jacobian.cpp ID.cpp IK.cpp IS.cpp FD.cpp EulerIntegration.cpp
CoM.cpp Momentum.cpp ZMP.cpp IDIM.cpp VisServo.cpp Coriolis.cpp)
CoM.cpp Momentum.cpp ZMP.cpp IDIM.cpp VisServo.cpp Coriolis.cpp Friction.cpp TorqueFeedbackTerm.cpp)
set(HEADERS RBDyn/Body.h RBDyn/Joint.h RBDyn/MultiBodyGraph.h RBDyn/MultiBody.h RBDyn/MultiBodyConfig.h
RBDyn/FK.h RBDyn/FV.h RBDyn/FA.h RBDyn/Jacobian.h RBDyn/ID.h RBDyn/IK.h RBDyn/IS.h RBDyn/FD.h RBDyn/EulerIntegration.h RBDyn/CoM.h
RBDyn/Momentum.h RBDyn/ZMP.h RBDyn/IDIM.h RBDyn/VisServo.h RBDyn/util.hh RBDyn/util.hxx RBDyn/Coriolis.h)
RBDyn/Momentum.h RBDyn/ZMP.h RBDyn/IDIM.h RBDyn/VisServo.h RBDyn/util.hh RBDyn/util.hxx RBDyn/Coriolis.h RBDyn/Friction.h RBDyn/TorqueFeedbackTerm.h
RBDyn/LambertW/LambertW.h RBDyn/LambertW/LambertW.hxx RBDyn/LambertW/Horner.h)

add_library(RBDyn SHARED ${SOURCES} ${HEADERS})
target_include_directories(RBDyn PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include> $<INSTALL_INTERFACE:include>)
Expand Down
44 changes: 40 additions & 4 deletions src/RBDyn/FD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
#include "RBDyn/MultiBody.h"
#include "RBDyn/MultiBodyConfig.h"

// #include <iostream>

namespace rbd
{

ForwardDynamics::ForwardDynamics(const MultiBody & mb)
: H_(mb.nrDof(), mb.nrDof()), C_(mb.nrDof()), I_st_(static_cast<size_t>(mb.nrBodies())),
F_(static_cast<size_t>(mb.nrJoints())), acc_(static_cast<size_t>(mb.nrBodies())),
F_(static_cast<size_t>(mb.nrJoints())), HIr_(mb.nrDof(), mb.nrDof()), acc_(static_cast<size_t>(mb.nrBodies())),
f_(static_cast<size_t>(mb.nrBodies())), tmpFd_(mb.nrDof()), dofPos_(static_cast<size_t>(mb.nrJoints())),
ldlt_(mb.nrDof())
{
HIr_.setZero();
int dofP = 0;
for(int i = 0; i < mb.nrJoints(); ++i)
{
Expand All @@ -41,6 +44,18 @@ void ForwardDynamics::forwardDynamics(const MultiBody & mb, MultiBodyConfig & mb
vectorToParam(tmpFd_, mbc.alphaD);
}

void ForwardDynamics::computeHIr(const MultiBody& mb)
{
for(int i = 0; i < mb.nrJoints(); ++i)
{
if(mb.joint(i).type() == Joint::Rev)
{
double gr = mb.joint(i).gearRatio();
HIr_(dofPos_[i], dofPos_[i]) = mb.joint(i).rotorInertia() * gr * gr;
}
}
}

void ForwardDynamics::computeH(const MultiBody & mb, const MultiBodyConfig & mbc)
{
const std::vector<Body> & bodies = mb.bodies();
Expand All @@ -67,8 +82,11 @@ void ForwardDynamics::computeH(const MultiBody & mb, const MultiBodyConfig & mbc
F_[ui].col(dof).noalias() = (I_st_[ui] * sva::MotionVecd(mbc.motionSubspace[ui].col(dof))).vector();
}

H_.block(dofPos_[ui], dofPos_[ui], joints[ui].dof(), joints[ui].dof()).noalias() =
if ( joints[i].dof() > 0)
{
H_.block(dofPos_[ui], dofPos_[ui], joints[ui].dof(), joints[ui].dof()).noalias() =
mbc.motionSubspace[ui].transpose() * F_[ui];
}

size_t j = ui;
while(pred[j] != -1)
Expand All @@ -90,6 +108,8 @@ void ForwardDynamics::computeH(const MultiBody & mb, const MultiBodyConfig & mbc
}
}
}

H_.noalias() = H_ + HIr_;
}

void ForwardDynamics::computeC(const MultiBody & mb, const MultiBodyConfig & mbc)
Expand Down Expand Up @@ -120,7 +140,11 @@ void ForwardDynamics::computeC(const MultiBody & mb, const MultiBodyConfig & mbc
for(int i = static_cast<int>(bodies.size()) - 1; i >= 0; --i)
{
const auto ui = static_cast<size_t>(i);
C_.segment(dofPos_[ui], joints[ui].dof()).noalias() = mbc.motionSubspace[ui].transpose() * f_[ui].vector();

if (joints[i].dof() > 0)
{
C_.segment(dofPos_[ui], joints[ui].dof()).noalias() = mbc.motionSubspace[ui].transpose() * f_[ui].vector();
}

if(pred[ui] != -1)
{
Expand Down Expand Up @@ -148,7 +172,7 @@ void ForwardDynamics::sForwardDynamics(const MultiBody & mb, MultiBodyConfig & m
void ForwardDynamics::sComputeH(const MultiBody & mb, const MultiBodyConfig & mbc)
{
checkMatchParentToSon(mb, mbc);
checkMatchMotionSubspace(mb, mbc);
// checkMatchMotionSubspace(mb, mbc); // Commented out by Rafa as a test

computeH(mb, mbc);
}
Expand All @@ -165,4 +189,16 @@ void ForwardDynamics::sComputeC(const MultiBody & mb, const MultiBodyConfig & mb
computeC(mb, mbc);
}

/*
Eigen::Matrix3d ForwardDynamics::SkewSymmetric(const Eigen::Vector3d& v)
{
Eigen::Matrix3d R = Eigen::Matrix3d::Zero();
R(0,1) = -(R(1,0) = v[2]);
R(2,0) = -(R(0,2) = v[1]);
R(1,2) = -(R(2,1) = v[0]);

return R;
}
*/

} // namespace rbd
225 changes: 225 additions & 0 deletions src/RBDyn/Friction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
/*
* Copyright 2012-2019 CNRS-UM LIRMM, CNRS-AIST JRL
*/

// associated header
#include "RBDyn/Friction.h"
#include "RBDyn/LambertW/LambertW.h"

#define EPSILON 1E-6

namespace rbd
{

Friction::Friction(const MultiBody & mb)
: Fr_(mb.nrDof()), dofPos_(mb.nrJoints())
{
int dofP = 0;
for(int i = 0; i < mb.nrJoints(); ++i)
{
dofPos_[i] = dofP;
dofP += mb.joint(i).dof();
}
}

StaticModelFriction::StaticModelFriction(const MultiBody & mb)
: Friction(mb)
{}

void StaticModelFriction::computeFriction(const MultiBody & mb, const MultiBodyConfig & mbc)
{
Fr_.setZero();

for(int i = 0; i < mb.nrJoints(); ++i)
{
if(mb.joint(i).type() == Joint::Rev)
{
double Ts = mb.joint(i).staticFriction();
double Tc = mb.joint(i).kineticFriction();
double Tv = mb.joint(i).viscousFrictionCoeff();

double wbrk = mb.joint(i).breakawayVelocity();

double w = mbc.alpha[i][0];
unsigned short sign = w > EPSILON ? 1 : (w < -EPSILON ? -1 : 0);

Fr_(dofPos_[i]) =
(Ts - Tc) * exp(pow(-abs(w / wbrk), 2)) * sign +
Tc * sign + Tv * w;
}
}
}

StribeckModelFriction::StribeckModelFriction(const MultiBody & mb)
: Friction(mb)
{}

void StribeckModelFriction::computeFriction(const MultiBody & mb, const MultiBodyConfig & mbc)
{
Fr_.setZero();

for(int i = 0; i < mb.nrJoints(); ++i)
{
if(mb.joint(i).type() == Joint::Rev)
{
double Ts = mb.joint(i).staticFriction();
double Tc = mb.joint(i).kineticFriction();
double Tv = mb.joint(i).viscousFrictionCoeff();

double wbrk = mb.joint(i).breakawayVelocity();
double wst = wbrk * sqrt(2);
double wcoul = wbrk / 10;

double w = mbc.alpha[i][0];

Fr_(dofPos_[i]) =
sqrt(2 * exp(1)) * (Ts - Tc) * exp(pow(-abs(w / wst), 2)) * (w / wst) +
Tc * tanh(w / wcoul) + Tv * w;
}
}
}

ImplEulerIntModelFriction::ImplEulerIntModelFriction(const MultiBody & mb, double Kf, double dt)
: Friction(mb), Kf_(Kf), dt_(dt), e_(Eigen::VectorXd::Zero(mb.nrDof()))
{}

ImplEulerIntModelCoulombFriction::ImplEulerIntModelCoulombFriction(const MultiBody & mb, double Kf, double dt)
: ImplEulerIntModelFriction(mb, Kf, dt)
{}

void ImplEulerIntModelCoulombFriction::computeFriction(const MultiBody & mb, const MultiBodyConfig & mbc)
{
Fr_.setZero();

for(int i = 0; i < mb.nrJoints(); ++i)
{
if(mb.joint(i).type() == Joint::Rev)
{
double Tc = mb.joint(i).kineticFriction();
double Tv = mb.joint(i).viscousFrictionCoeff();

double w = mbc.alpha[i][0];

double Bf = 1 / dt_;
if (Tv >= Kf_ * dt_ + Bf)
Bf = Tv - Kf_ * dt_ + EPSILON;

double Z = 1 / (Kf_ * dt_ + Bf);

double w_ast = w + Z * Kf_ * e_(dofPos_[i]);
double T_ast = w_ast / Z;

double den = 1 + Z * Tv;

if (T_ast > Tc)
Fr_(dofPos_[i]) = (Tc + Tv * w_ast) / den;
else if (T_ast < -Tc)
Fr_(dofPos_[i]) = (-Tc + Tv * w_ast) / den;
else
Fr_(dofPos_[i]) = T_ast;

e_(dofPos_[i]) = Z * (Bf * e_(dofPos_[i]) + Fr_(dofPos_[i]) * dt_);
}
}
}

ImplEulerIntModelExpStictionFriction::ImplEulerIntModelExpStictionFriction(const MultiBody & mb, double Kf, double dt)
: ImplEulerIntModelFriction(mb, Kf, dt)
{}

void ImplEulerIntModelExpStictionFriction::computeFriction(const MultiBody & mb, const MultiBodyConfig & mbc)
{
Fr_.setZero();

for(int i = 0; i < mb.nrJoints(); ++i)
{
if(mb.joint(i).type() == Joint::Rev)
{
double Ts = mb.joint(i).staticFriction();
double Tc = mb.joint(i).kineticFriction();
double Tv = mb.joint(i).viscousFrictionCoeff();
double wbrk = mb.joint(i).breakawayVelocity();

double Tsc = Ts - Tc;

double w = mbc.alpha[i][0];

double Bf = Ts / wbrk - Kf_ * dt_;
double Z = 1 / (Kf_ * dt_ + Bf);

double w_ast = w + Z * Kf_ * e_(dofPos_[i]);
double T_ast = w_ast / Z;

double den = 1 + Z * Tv;

if (T_ast > Ts) {
double lambArg = -Z/wbrk * Tsc/den * exp(Z/wbrk * (Tc + Tv*w_ast) / den - w_ast/wbrk);
Fr_(dofPos_[i]) = -(wbrk/Z) * utl::LambertW<0>(lambArg) + (Tc + Tv*w_ast) / den;
}
else if (T_ast < -Ts) {
double lambArg = -Z/wbrk * Tsc/den * exp(-Z/wbrk * (-Tc + Tv*w_ast) / den + w_ast/wbrk);
Fr_(dofPos_[i]) = (wbrk/Z) * utl::LambertW<0>(lambArg) + (-Tc + Tv*w_ast) / den;
}
else
Fr_(dofPos_[i]) = T_ast;

e_(dofPos_[i]) = Z * (Bf * e_(dofPos_[i]) + Fr_(dofPos_[i]) * dt_);
}
}
}

ImplEulerIntModelRatStictionFriction::ImplEulerIntModelRatStictionFriction(const MultiBody & mb, double Kf, double dt)
: ImplEulerIntModelFriction(mb, Kf, dt)
{}

void ImplEulerIntModelRatStictionFriction::computeFriction(const MultiBody & mb, const MultiBodyConfig & mbc)
{
Fr_.setZero();

for(int i = 0; i < mb.nrJoints(); ++i)
{
if(mb.joint(i).type() == Joint::Rev)
{
double Ts = mb.joint(i).staticFriction();
double Tc = mb.joint(i).kineticFriction();
double Tv = mb.joint(i).viscousFrictionCoeff();
double wbrk = mb.joint(i).breakawayVelocity();

double Tsc = Ts - Tc;
double r = Tsc / wbrk - Tv;

double w = mbc.alpha[i][0];

double Bf = Ts / wbrk - Kf_ * dt_;
if (r >= Kf_ * dt_ + Bf)
Bf = r - Kf_ * dt_ + EPSILON;

double Z = 1 / (Kf_ * dt_ + Bf);

double w_ast = w + Z * Kf_ * e_(dofPos_[i]);
double T_ast = w_ast / Z;

double delta = abs(r + Tv) > EPSILON ? Tsc / (r + Tv) : 0.0;
double alpha = Tv * delta + Tc;
double beta = Ts * delta;
double a = Tv * pow(Z, 2) + Z;

if (T_ast > Ts) {
double b = -(w_ast + delta + 2 * Tv * Z * w_ast + alpha * Z);
double c = Tv * pow(w_ast, 2) + alpha * w_ast + beta;
Fr_(dofPos_[i]) = (-b - sqrt(pow(b, 2) - 4 * a * c)) / (2 * a);
}
else if (T_ast < -Ts) {
double b = -(-w_ast + delta - 2 * Tv * Z * w_ast + alpha * Z);
double c = Tv * pow(w_ast, 2) - alpha * w_ast + beta;
Fr_(dofPos_[i]) = ( b + sqrt(pow(b, 2) - 4 * a * c)) / (2 * a);
}
else
Fr_(dofPos_[i]) = T_ast;

e_(dofPos_[i]) = Z * (Bf * e_(dofPos_[i]) + Fr_(dofPos_[i]) * dt_);
}
}
}

} // namespace rbd
2 changes: 2 additions & 0 deletions src/RBDyn/Jacobian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// RBDyn
#include "RBDyn/MultiBodyConfig.h"

#include <iostream>

namespace rbd
{

Expand Down
10 changes: 5 additions & 5 deletions src/RBDyn/MultiBodyConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ void checkMatchJointTorque(const MultiBody & mb, const MultiBodyConfig & mbc)
{
std::ostringstream str;
str << "Bad number of torque variable for Joint " << mb.joint(i) << " at position " << i << ": expected size "
<< mb.joint(i).dof() << " gived " << mbc.jointTorque[ui].size();
<< mb.joint(i).dof() << " gave " << mbc.jointTorque[ui].size();
throw std::domain_error(str.str());
}
}
Expand All @@ -423,7 +423,7 @@ void checkMatchMotionSubspace(const MultiBody & mb, const MultiBodyConfig & mbc)
{
std::ostringstream str;
str << "Bad motionSubspace matrix size for Joint " << mb.joint(i) << " at position " << i
<< ": expected column number " << mb.joint(i).dof() << " gived " << mbc.motionSubspace[ui].cols();
<< ": expected column number " << mb.joint(i).dof() << " gave " << mbc.motionSubspace[ui].cols();
throw std::domain_error(str.str());
}
}
Expand All @@ -440,7 +440,7 @@ void checkMatchQ(const MultiBody & mb, const MultiBodyConfig & mbc)
{
std::ostringstream str;
str << "Bad number of generalized position variable for Joint " << mb.joint(i) << " at position " << i
<< ": expected size " << mb.joint(i).params() << " gived " << mbc.q[ui].size();
<< ": expected size " << mb.joint(i).params() << " gave " << mbc.q[ui].size();
throw std::domain_error(str.str());
}
}
Expand All @@ -457,7 +457,7 @@ void checkMatchAlpha(const MultiBody & mb, const MultiBodyConfig & mbc)
{
std::ostringstream str;
str << "Bad number of generalized velocity variable for Joint " << mb.joint(i) << " at position " << i
<< ": expected size " << mb.joint(i).dof() << " gived " << mbc.alpha[ui].size();
<< ": expected size " << mb.joint(i).dof() << " gave " << mbc.alpha[ui].size();
throw std::domain_error(str.str());
}
}
Expand All @@ -474,7 +474,7 @@ void checkMatchAlphaD(const MultiBody & mb, const MultiBodyConfig & mbc)
{
std::ostringstream str;
str << "Bad number of generalized acceleration variable for Joint " << mb.joint(i) << " at position " << i
<< ": expected size " << mb.joint(i).dof() << " gived " << mbc.alphaD[ui].size();
<< ": expected size " << mb.joint(i).dof() << " gave " << mbc.alphaD[ui].size();
throw std::domain_error(str.str());
}
}
Expand Down
Loading