tsid 1.9.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
Loading...
Searching...
No Matches
trajectory-euclidian.hpp
Go to the documentation of this file.
1//
2// Copyright (c) 2018 CNRS
3//
4
5#ifndef __tsid_python_traj_euclidian_hpp__
6#define __tsid_python_traj_euclidian_hpp__
7
9
11namespace tsid {
12namespace python {
13namespace bp = boost::python;
14
15template <typename Traj>
17 : public boost::python::def_visitor<
18 TrajectoryEuclidianConstantPythonVisitor<Traj> > {
19 template <class PyClass>
20
21 void visit(PyClass& cl) const {
22 cl.def(bp::init<std::string>((bp::arg("name")),
23 "Default Constructor with name"))
24 .def(bp::init<std::string, Eigen::VectorXd>(
25 (bp::arg("name"), bp::arg("reference")),
26 "Default Constructor with name and ref_vec"))
27
28 .add_property("size", &Traj::size)
29 .def("setReference",
31 bp::arg("ref_vec"))
32 .def("computeNext",
34 .def("getLastSample",
36 bp::arg("sample"))
37 .def("has_trajectory_ended",
40 bp::arg("time"));
41 }
42 static void setReference(Traj& self, const Eigen::VectorXd& ref) {
43 self.setReference(ref);
44 }
46 return self.computeNext();
47 }
48 static void getLastSample(const Traj& self,
50 self.getLastSample(sample);
51 }
52 static bool has_trajectory_ended(const Traj& self) {
53 return self.has_trajectory_ended();
54 }
55 static trajectories::TrajectorySample getSample(Traj& self, double time) {
56 return self.operator()(time);
57 }
58
59 static void expose(const std::string& class_name) {
60 std::string doc = "Trajectory Euclidian Constant info.";
61 bp::class_<Traj>(class_name.c_str(), doc.c_str(), bp::no_init)
63 }
64};
65} // namespace python
66} // namespace tsid
67
68#endif // ifndef __tsid_python_traj_euclidian_hpp__
Definition trajectory-base.hpp:33
Definition constraint-bound.hpp:26
Definition constraint-bound.hpp:25
Definition trajectory-euclidian.hpp:18
static trajectories::TrajectorySample getSample(Traj &self, double time)
Definition trajectory-euclidian.hpp:55
static void setReference(Traj &self, const Eigen::VectorXd &ref)
Definition trajectory-euclidian.hpp:42
static bool has_trajectory_ended(const Traj &self)
Definition trajectory-euclidian.hpp:52
static trajectories::TrajectorySample computeNext(Traj &self)
Definition trajectory-euclidian.hpp:45
static void expose(const std::string &class_name)
Definition trajectory-euclidian.hpp:59
void visit(PyClass &cl) const
Definition trajectory-euclidian.hpp:21
static void getLastSample(const Traj &self, trajectories::TrajectorySample &sample)
Definition trajectory-euclidian.hpp:48