bindings/python/trajectories/trajectory-se3.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018 CNRS
3 //
4 // This file is part of tsid
5 // tsid is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 // tsid is distributed in the hope that it will be
10 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Lesser Public License for more details. You should have
13 // received a copy of the GNU Lesser General Public License along with
14 // tsid If not, see
15 // <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef __tsid_python_traj_se3_hpp__
19 #define __tsid_python_traj_se3_hpp__
20 
22 
24 namespace tsid {
25 namespace python {
26 namespace bp = boost::python;
27 
28 template <typename TrajSE3>
30  : public boost::python::def_visitor<
31  TrajectorySE3ConstantPythonVisitor<TrajSE3> > {
32  template <class PyClass>
33 
34  void visit(PyClass& cl) const {
35  cl.def(bp::init<std::string>((bp::arg("name")),
36  "Default Constructor with name"))
37  .def(bp::init<std::string, pinocchio::SE3>(
38  (bp::arg("name"), bp::arg("reference")),
39  "Default Constructor with name and ref_vec"))
40 
41  .add_property("size", &TrajSE3::size)
43  bp::arg("M_ref"))
45  .def("getLastSample",
47  bp::arg("sample"))
48  .def("has_trajectory_ended",
51  bp::arg("time"));
52  }
53  static void setReference(TrajSE3& self, const pinocchio::SE3& ref) {
54  self.setReference(ref);
55  }
57  return self.computeNext();
58  }
59  static void getLastSample(const TrajSE3& self,
61  self.getLastSample(sample);
62  }
63  static bool has_trajectory_ended(const TrajSE3& self) {
64  return self.has_trajectory_ended();
65  }
66  static trajectories::TrajectorySample getSample(TrajSE3& self, double time) {
67  return self.operator()(time);
68  }
69 
70  static void expose(const std::string& class_name) {
71  std::string doc = "Trajectory SE3 Constant info.";
72  bp::class_<TrajSE3>(class_name.c_str(), doc.c_str(), bp::no_init)
74  }
75 };
76 } // namespace python
77 } // namespace tsid
78 
79 #endif // ifndef __tsid_python_traj_se3_hpp__
tsid::python::TrajectorySE3ConstantPythonVisitor::setReference
static void setReference(TrajSE3 &self, const pinocchio::SE3 &ref)
Definition: bindings/python/trajectories/trajectory-se3.hpp:53
tsid::python::TrajectorySE3ConstantPythonVisitor::visit
void visit(PyClass &cl) const
Definition: bindings/python/trajectories/trajectory-se3.hpp:34
boost::python
class_name
str class_name(str s)
tsid::trajectories::TrajectorySample
Definition: trajectories/trajectory-base.hpp:33
tsid::python::TrajectorySE3ConstantPythonVisitor::expose
static void expose(const std::string &class_name)
Definition: bindings/python/trajectories/trajectory-se3.hpp:70
pinocchio::SE3
context::SE3 SE3
ref
list ref
tsid::python::TrajectorySE3ConstantPythonVisitor::getLastSample
static void getLastSample(const TrajSE3 &self, trajectories::TrajectorySample &sample)
Definition: bindings/python/trajectories/trajectory-se3.hpp:59
python
size
FCL_REAL size() const
tsid::python::TrajectorySE3ConstantPythonVisitor::getSample
static trajectories::TrajectorySample getSample(TrajSE3 &self, double time)
Definition: bindings/python/trajectories/trajectory-se3.hpp:66
test_Tasks.sample
sample
Definition: test_Tasks.py:47
demo_quadruped.time
time
Definition: demo_quadruped.py:213
tsid::python::TrajectorySE3ConstantPythonVisitor
Definition: bindings/python/trajectories/trajectory-se3.hpp:29
tsid::python::TrajectorySE3ConstantPythonVisitor::has_trajectory_ended
static bool has_trajectory_ended(const TrajSE3 &self)
Definition: bindings/python/trajectories/trajectory-se3.hpp:63
tsid
Definition: bindings/python/constraint/constraint-bound.cpp:21
cl
cl
tsid::python::TrajectorySE3ConstantPythonVisitor::computeNext
static trajectories::TrajectorySample computeNext(TrajSE3 &self)
Definition: bindings/python/trajectories/trajectory-se3.hpp:56
fwd.hpp
trajectory-se3.hpp


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Sat May 3 2025 02:48:17