Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
robotpkg-wip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gepetto
robotpkg-wip
Commits
4cf74920
Commit
4cf74920
authored
5 years ago
by
Olivier Stasse
Browse files
Options
Downloads
Patches
Plain Diff
[wip/py-tsid] Fix bindings problem with tsid.
parent
cfa519e4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
py-tsid/Makefile
+1
-0
1 addition, 0 deletions
py-tsid/Makefile
py-tsid/distinfo
+2
-0
2 additions, 0 deletions
py-tsid/distinfo
py-tsid/patches/patch-ad
+113
-0
113 additions, 0 deletions
py-tsid/patches/patch-ad
py-tsid/patches/patch-ae
+16
-0
16 additions, 0 deletions
py-tsid/patches/patch-ae
with
132 additions
and
0 deletions
py-tsid/Makefile
+
1
−
0
View file @
4cf74920
...
...
@@ -5,6 +5,7 @@
ORG
=
stack-of-tasks
NAME
=
tsid
VERSION
=
1.2.1
PKGREVISION
=
1
CATEGORIES
=
wip
COMMENT
=
Efficient Inverse Dynamics based on Pinocchio
(
python bindings
)
...
...
This diff is collapsed.
Click to expand it.
py-tsid/distinfo
+
2
−
0
View file @
4cf74920
...
...
@@ -4,3 +4,5 @@ Size (tsid-1.2.1.tar.gz) = 9247070 bytes
SHA1 (patch-aa) = 5794c89861c6a84d47428939af6d19da36930631
SHA1 (patch-ab) = 4af606a78e78c4e14c489e0b86b9eb4d8aca03f3
SHA1 (patch-ac) = c5625ba8c746eb5e04d63e258171d4f947aa90ed
SHA1 (patch-ad) = 50a7fa80e9dd0e5d7d4a8f07716119a4f3149011
SHA1 (patch-ae) = 0361dfe851401d831c1a150c246ef1ec5d044969
This diff is collapsed.
Click to expand it.
py-tsid/patches/patch-ad
0 → 100644
+
113
−
0
View file @
4cf74920
--- bindings/python/robots/robot-wrapper.hpp
+++ bindings/python/robots/robot-wrapper.hpp
@@ -23,15 +23,17 @@
#include <string>
#include <eigenpy/eigenpy.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
+#include <boost/python/make_constructor.hpp>
+#include <pinocchio/bindings/python/parsers/parsers.hpp>
#include "tsid/robots/robot-wrapper.hpp"
namespace tsid
{
namespace python
- {
+ {
namespace bp = boost::python;
-
+
template<typename Robot>
struct RobotPythonVisitor
: public boost::python::def_visitor< RobotPythonVisitor<Robot> >
@@ -39,18 +41,19 @@
namespace tsid
typedef std::vector<std::string> std_vec;
typedef Eigen::Matrix<double,3,Eigen::Dynamic> Matrix3x;
- template<class PyClass>
+ template<class PyClass >
void visit(PyClass& cl) const
{
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."))
+ .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."))
+ .def("__init__",bp::make_constructor(RobotPythonVisitor<Robot> ::makeClass))
.add_property("nq", &Robot::nq)
.add_property("nv", &Robot::nv)
.add_property("na", &Robot::na)
-
+
.def("model", &RobotPythonVisitor::model)
.def("data", &RobotPythonVisitor::data)
@@ -58,18 +61,18 @@
namespace tsid
.add_property("gear_ratios", &RobotPythonVisitor::gear_ratios)
.def("set_rotor_inertias", &RobotPythonVisitor::set_rotor_inertias, bp::arg("inertia vector"))
.def("set_gear_ratios", &RobotPythonVisitor::set_gear_ratios, bp::arg("gear ratio vector"))
-
+
.def("computeAllTerms", &RobotPythonVisitor::computeAllTerms, bp::args("data", "q", "v"), "compute all dynamics")
.def("com", &RobotPythonVisitor::com, bp::arg("data"))
.def("com_vel", &RobotPythonVisitor::com_vel, bp::arg("data"))
.def("com_acc", &RobotPythonVisitor::com_acc, bp::arg("data"))
.def("Jcom", &RobotPythonVisitor::Jcom, bp::arg("data"))
- .def("mass", &RobotPythonVisitor::mass, bp::arg("data"))
+ .def("mass", &RobotPythonVisitor::mass, bp::arg("data"))
.def("nonLinearEffect", &RobotPythonVisitor::nonLinearEffects, bp::arg("data"))
- .def("position", &RobotPythonVisitor::position, bp::args("data", "index"))
+ .def("position", &RobotPythonVisitor::position, bp::args("data", "index"))
.def("velocity", &RobotPythonVisitor::velocity, bp::args("data", "index"))
.def("acceleration", &RobotPythonVisitor::acceleration, bp::args("data", "index"))
-
+
.def("framePosition", &RobotPythonVisitor::framePosition, bp::args("data", "index"))
.def("frameVelocity", &RobotPythonVisitor::frameVelocity, bp::args("data", "index"))
.def("frameAcceleration", &RobotPythonVisitor::frameAcceleration, bp::args("data", "index"))
@@ -77,9 +80,27 @@
namespace tsid
.def("frameVelocityWorldOriented", &RobotPythonVisitor::frameVelocityWorldOriented, bp::args("data", "index"))
.def("frameAccelerationWorldOriented", &RobotPythonVisitor::frameAccelerationWorldOriented, bp::args("data", "index"))
.def("frameClassicAccelerationWorldOriented", &RobotPythonVisitor::frameClassicAccelerationWorldOriented, bp::args("data", "index"))
-
+
;
}
+
+ static boost::shared_ptr<Robot> makeClass(const std::string &filename,
+ const std::vector<std::string>
+ &stdvec,
+ bp::object & bpObject,
+ bool verbose)
+ {
+ std::cout << "Before extraction " << std::endl;
+ pinocchio::JointModelFreeFlyer root_joint =
+ bp::extract<pinocchio::JointModelFreeFlyer>(bpObject)();
+ std::cout << "After extraction " << std::endl;
+ boost::shared_ptr<Robot> p(new tsid::robots::RobotWrapper(filename,
+ stdvec,
+ root_joint,
+ verbose));
+ return p;
+ }
+
static pinocchio::Model model (const Robot & self){
return self.model();
}
@@ -108,10 +129,10 @@
namespace tsid
}
static Eigen::Vector3d com_acc (const Robot & self, const pinocchio::Data & data){
return self.com_acc(data);
- }
+ }
static Matrix3x Jcom (const Robot & self, const pinocchio::Data & data){
return self.Jcom(data);
- }
+ }
static void computeAllTerms (const Robot & self, pinocchio::Data & data, const Eigen::VectorXd & q, const Eigen::VectorXd & v){
self.computeAllTerms(data, q, v);
}
--
2.7.4
This diff is collapsed.
Click to expand it.
py-tsid/patches/patch-ae
0 → 100644
+
16
−
0
View file @
4cf74920
--- bindings/python/robots/robot-wrapper.hpp
+++ bindings/python/robots/robot-wrapper.hpp
@@ -90,10 +90,8 @@
namespace tsid
bp::object & bpObject,
bool verbose)
{
- std::cout << "Before extraction " << std::endl;
pinocchio::JointModelFreeFlyer root_joint =
bp::extract<pinocchio::JointModelFreeFlyer>(bpObject)();
- std::cout << "After extraction " << std::endl;
boost::shared_ptr<Robot> p(new tsid::robots::RobotWrapper(filename,
stdvec,
root_joint,
--
2.7.4
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment