Unverified Commit 707745a6 authored by Andrea Del Prete's avatar Andrea Del Prete Committed by GitHub
Browse files

Merge pull request #46 from proyan/devel

[robotwrapper] create constructor from pinocchio::model
parents e8642f31 7b9724a5
......@@ -44,6 +44,7 @@ namespace tsid
{
cl
.def(bp::init<std::string, std_vec, bool>((bp::arg("filename"), bp::arg("package_dir"), bp::arg("verbose")), "Default constructor without RootJoint."))
.def(bp::init<pinocchio::Model, bool>((bp::arg("Pinocchio Model"), bp::arg("verbose")), "Default constructor from pinocchio model"))
.def(bp::init<std::string, std_vec, pinocchio::JointModelVariant, bool>((bp::arg("filename"), bp::arg("package_dir"), bp::arg("roottype"), bp::arg("verbose")), "Default constructor without RootJoint."))
.add_property("nq", &Robot::nq)
.add_property("nv", &Robot::nv)
......
......@@ -59,7 +59,9 @@ namespace tsid
RobotWrapper(const std::string & filename,
const std::vector<std::string> & package_dirs,
bool verbose=false);
RobotWrapper(const Model & m, bool verbose=false);
RobotWrapper(const std::string & filename,
const std::vector<std::string> & package_dirs,
const pinocchio::JointModelVariant & rootJoint,
......
......@@ -44,6 +44,16 @@ namespace tsid
m_Md.setZero(m_model.nv);
m_M.setZero(m_model.nv, m_model.nv);
}
RobotWrapper::RobotWrapper(const pinocchio::Model& m, bool verbose)
: m_verbose(verbose)
{
m_model = m;
m_model_filename = "";
m_rotor_inertias.setZero(m_model.nv);
m_gear_ratios.setZero(m_model.nv);
m_Md.setZero(m_model.nv);
m_M.setZero(m_model.nv, m_model.nv);
}
RobotWrapper::RobotWrapper(const std::string & filename,
const std::vector<std::string> & ,
......
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