Commit 2b5d56a8 authored by t steve's avatar t steve
Browse files

mass and gravity are public const

parent a6b81668
......@@ -26,6 +26,10 @@ enum CENTROIDAL_DYNAMICS_DLLAPI EquilibriumAlgorithm
class CENTROIDAL_DYNAMICS_DLLAPI Equilibrium
{
public:
const double m_mass; /// mass of the system
const Vector3 m_gravity; /// gravity vector
private:
static bool m_is_cdd_initialized; /// true if cdd lib has been initialized, false otherwise
......@@ -35,8 +39,6 @@ private:
SolverLP m_solver_type; /// type of LP solver
unsigned int m_generatorsPerContact; /// number of generators to approximate the friction cone per contact point
double m_mass; /// mass of the system
Vector3 m_gravity; /// gravity vector
/** Gravito-inertial wrench generators (6 X numberOfContacts*generatorsPerContact) */
Matrix6X m_G_centr;
......
......@@ -20,7 +20,9 @@ bool Equilibrium::m_is_cdd_initialized = false;
Equilibrium::Equilibrium(const string& name, const double mass, const unsigned int generatorsPerContact,
const SolverLP solver_type, const bool useWarmStart,
const unsigned int max_num_cdd_trials, const bool canonicalize_cdd_matrix)
: m_is_cdd_stable(true)
: m_mass(mass)
, m_gravity(0.,0.,-9.81)
, m_is_cdd_stable(true)
, max_num_cdd_trials(max_num_cdd_trials)
, canonicalize_cdd_matrix(canonicalize_cdd_matrix)
{
......@@ -43,9 +45,8 @@ Equilibrium::Equilibrium(const string& name, const double mass, const unsigned i
m_generatorsPerContact = 3;
}
m_mass = mass;
m_gravity.setZero();
m_gravity(2) = -9.81;
/*m_gravity.setZero();
m_gravity(2) = -9.81;*/
m_d.setZero();
m_d.head<3>() = m_mass*m_gravity;
......
Supports Markdown
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