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 {
26  namespace python
27  {
28  namespace bp = boost::python;
29 
30  template<typename TrajSE3>
32  : public boost::python::def_visitor< TrajectorySE3ConstantPythonVisitor<TrajSE3> >
33  {
34 
35  template<class PyClass>
36 
37  void visit(PyClass& cl) const
38  {
39  cl
40  .def(bp::init<std::string>((bp::arg("name")), "Default Constructor with name"))
41  .def(bp::init<std::string, pinocchio::SE3>((bp::arg("name"), bp::arg("reference")), "Default Constructor with name and ref_vec"))
42 
43  .add_property("size", &TrajSE3::size)
44  .def("setReference", &TrajectorySE3ConstantPythonVisitor::setReference, bp::arg("M_ref"))
46  .def("getLastSample", &TrajectorySE3ConstantPythonVisitor::getLastSample, bp::arg("sample"))
48  .def("getSample", &TrajectorySE3ConstantPythonVisitor::getSample, bp::arg("time"))
49  ;
50  }
51  static void setReference(TrajSE3 & self, const pinocchio::SE3 & ref){
52  self.setReference(ref);
53  }
55  return self.computeNext();
56  }
57  static void getLastSample(const TrajSE3 & self, trajectories::TrajectorySample & sample){
58  self.getLastSample(sample);
59  }
60  static bool has_trajectory_ended(const TrajSE3 & self){
61  return self.has_trajectory_ended();
62  }
63  static trajectories::TrajectorySample getSample(TrajSE3 & self, double time){
64  return self.operator()(time);
65  }
66 
67 
68  static void expose(const std::string & class_name)
69  {
70  std::string doc = "Trajectory SE3 Constant info.";
71  bp::class_<TrajSE3>(class_name.c_str(),
72  doc.c_str(),
73  bp::no_init)
75  }
76  };
77  }
78 }
79 
80 
81 #endif // ifndef __tsid_python_traj_se3_hpp__
static void setReference(TrajSE3 &self, const pinocchio::SE3 &ref)
Definition: trajectory-se3.hpp:51
static void getLastSample(const TrajSE3 &self, trajectories::TrajectorySample &sample)
Definition: trajectory-se3.hpp:57
pinocchio::SE3 SE3
Definition: trajectory-base.hpp:34
static void expose(const std::string &class_name)
Definition: trajectory-se3.hpp:68
Definition: trajectory-base.hpp:35
static trajectories::TrajectorySample getSample(TrajSE3 &self, double time)
Definition: trajectory-se3.hpp:63
Definition: trajectory-se3.hpp:31
static trajectories::TrajectorySample computeNext(TrajSE3 &self)
Definition: trajectory-se3.hpp:54
static bool has_trajectory_ended(const TrajSE3 &self)
Definition: trajectory-se3.hpp:60
Definition: constraint-bound.hpp:26
void visit(PyClass &cl) const
Definition: trajectory-se3.hpp:37