Go to the documentation of this file.
18 #ifndef __tsid_python_robot_wrapper_hpp__
19 #define __tsid_python_robot_wrapper_hpp__
29 template <
typename Robot>
31 :
public boost::python::def_visitor<RobotPythonVisitor<Robot> > {
33 typedef Eigen::Matrix<double, 3, Eigen::Dynamic>
Matrix3x;
35 template <
class PyClass>
39 .def(bp::init<std::string, std_vec, bool>(
40 (bp::arg(
"filename"), bp::arg(
"package_dir"), bp::arg(
"verbose")),
41 "Default constructor without RootJoint."))
43 bool>((bp::arg(
"filename"), bp::arg(
"package_dir"),
44 bp::arg(
"roottype"), bp::arg(
"verbose")),
45 "Default constructor with RootJoint."))
46 .def(bp::init<pinocchio::Model, bool>(
47 (bp::arg(
"Pinocchio Model"), bp::arg(
"verbose")),
48 "Default constructor from pinocchio model without RootJoint."))
51 (bp::arg(
"Pinocchio Model"), bp::arg(
"rootJoint"),
53 "Default constructor from pinocchio model with RootJoint."))
56 .add_property(
"nq", &Robot::nq)
59 .add_property(
"nq_actuated", &Robot::nq_actuated)
60 .add_property(
"is_fixed_base", &Robot::is_fixed_base)
68 bp::arg(
"inertia vector"))
70 bp::arg(
"gear ratio vector"))
73 bp::args(
"data",
"q",
"v"),
"compute all dynamics")
82 bp::args(
"data",
"index"))
84 bp::args(
"data",
"index"))
86 bp::args(
"data",
"index"))
89 bp::args(
"data",
"index"))
91 bp::args(
"data",
"index"))
93 bp::args(
"data",
"index"))
94 .def(
"frameClassicAcceleration",
96 bp::args(
"data",
"index"))
97 .def(
"frameVelocityWorldOriented",
99 bp::args(
"data",
"index"))
100 .def(
"frameAccelerationWorldOriented",
102 bp::args(
"data",
"index"))
103 .def(
"frameClassicAccelerationWorldOriented",
105 bp::args(
"data",
"index"))
106 .def(
"angularMomentumTimeVariation",
112 const std::string &
filename,
const std::vector<std::string> &stdvec,
113 bp::object &bpObject,
bool verbose) {
115 bp::extract<pinocchio::JointModelFreeFlyer>(bpObject)();
116 boost::shared_ptr<Robot>
p(
127 return self.rotor_inertias();
130 return self.gear_ratios();
141 return self.com(
data);
143 static Eigen::Vector3d
com_vel(
const Robot &
self,
145 return self.com_vel(
data);
147 static Eigen::Vector3d
com_acc(
const Robot &
self,
149 return self.com_acc(
data);
152 return self.Jcom(
data);
155 const Eigen::VectorXd &
q,
156 const Eigen::VectorXd &
v) {
157 self.computeAllTerms(
data,
q,
v);
160 return self.mass(
data);
164 return self.nonLinearEffects(
data);
193 return self.frameAcceleration(
data,
index);
198 return self.frameClassicAcceleration(
data,
index);
203 return self.frameVelocityWorldOriented(
data,
index);
208 return self.frameAccelerationWorldOriented(
data,
index);
213 return self.frameClassicAccelerationWorldOriented(
data,
index);
217 return self.angularMomentumTimeVariation(
data);
220 return self.setGravity(
gravity);
222 static void expose(
const std::string &class_name) {
223 std::string doc =
"Robot Wrapper info.";
224 bp::class_<Robot>(
class_name.c_str(), doc.c_str(), bp::no_init)
227 bp::enum_<robots::RobotWrapper::RootJointType>(
"RootJointType")
229 .value(
"FLOATING_BASE_SYSTEM",
237 #endif // ifndef __tsid_python_robot_wrapper_hpp__
void init(bool compute_local_aabb=true)
static boost::shared_ptr< Robot > makeClass(const std::string &filename, const std::vector< std::string > &stdvec, bp::object &bpObject, bool verbose)
static Eigen::VectorXd nonLinearEffects(const Robot &self, const pinocchio::Data &data)
static Eigen::Vector3d com_acc(const Robot &self, const pinocchio::Data &data)
static Eigen::VectorXd gear_ratios(const Robot &self)
static pinocchio::Motion frameVelocity(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::FrameIndex &index)
Eigen::Matrix< double, 3, Eigen::Dynamic > Matrix3x
static bool set_rotor_inertias(Robot &self, const Eigen::VectorXd &rotor_inertias)
static Eigen::Vector3d com_vel(const Robot &self, const pinocchio::Data &data)
static pinocchio::Motion frameVelocityWorldOriented(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::FrameIndex &index)
static pinocchio::Data data(const Robot &self)
std::vector< std::string > std_vec
static pinocchio::Motion frameAccelerationWorldOriented(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::FrameIndex &index)
static pinocchio::Motion acceleration(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::JointIndex &index)
static pinocchio::Model model(const Robot &self)
static void expose(const std::string &class_name)
static void setGravity(Robot &self, const pinocchio::Motion &gravity)
pinocchio::JointIndex JointIndex
static pinocchio::Motion velocity(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::JointIndex &index)
JointCollectionDefault::JointModelVariant JointModelVariant
static Eigen::VectorXd rotor_inertias(const Robot &self)
pinocchio::FrameIndex FrameIndex
static Eigen::Vector3d com(const Robot &self, const pinocchio::Data &data)
static bool set_gear_ratios(Robot &self, const Eigen::VectorXd &gear_ratios)
static pinocchio::SE3 framePosition(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::FrameIndex &index)
static pinocchio::SE3 position(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::JointIndex &index)
static Eigen::Vector3d angularMomentumTimeVariation(const Robot &self, const pinocchio::Data &data)
static Matrix3x Jcom(const Robot &self, const pinocchio::Data &data)
Wrapper for a robot based on pinocchio.
static pinocchio::Motion frameClassicAccelerationWorldOriented(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::FrameIndex &index)
void visit(PyClass &cl) const
static void computeAllTerms(const Robot &self, pinocchio::Data &data, const Eigen::VectorXd &q, const Eigen::VectorXd &v)
static Eigen::MatrixXd mass(Robot &self, pinocchio::Data &data)
enum tsid::robots::RobotWrapper::e_RootJointType RootJointType
static pinocchio::Motion frameClassicAcceleration(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::FrameIndex &index)
static pinocchio::Motion frameAcceleration(const Robot &self, const pinocchio::Data &data, const pinocchio::Model::FrameIndex &index)
tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Thu Apr 3 2025 02:47:15