File: bindings_sgal3.cpp

package info (click to toggle)
manif 0.0.5-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,576 kB
  • sloc: cpp: 11,789; ansic: 8,774; python: 2,158; sh: 24; makefile: 23; xml: 21
file content (73 lines) | stat: -rw-r--r-- 2,582 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <pybind11/pybind11.h>
#include <pybind11/operators.h>
#include <pybind11/eigen.h>
#include <pybind11/stl.h>

#include "manif/SGal3.h"

#include "bindings_optional.h"
#include "bindings_lie_group_base.h"
#include "bindings_tangent_base.h"

namespace py = pybind11;

void wrap_SGal3(py::module &m) {
  using Scalar = manif::SGal3d::Scalar;
  using Translation = manif::SGal3d::Translation;
  using Quaternion = Eigen::Quaternion<Scalar>;
  using LinearVelocity = manif::SGal3d::LinearVelocity;

  py::class_<
    manif::LieGroupBase<manif::SGal3d>,
    std::unique_ptr<manif::LieGroupBase<manif::SGal3d>, py::nodelete>
  > SGal3_base(m, "_SGal3Base");
  py::class_<
    manif::TangentBase<manif::SGal3Tangentd>,
    std::unique_ptr<manif::TangentBase<manif::SGal3Tangentd>, py::nodelete>
  > SGal3_tan_base(m, "_SGal3TangentBase");

  py::class_<manif::SGal3d, manif::LieGroupBase<manif::SGal3d>> SGal3(m, "SGal3");
  py::class_<
    manif::SGal3Tangentd, manif::TangentBase<manif::SGal3Tangentd>
  > SGal3_tan(m, "SGal3Tangent");

  //group

  wrap_lie_group_base<manif::SGal3d, manif::LieGroupBase<manif::SGal3d>>(SGal3);

  // SGal3.def(py::init<const Translation&, const Quaternion&, const LinearVelocity&>());
  // SGal3.def(py::init<const Translation&, const Eigen::AngleAxis<Scalar>&, const LinearVelocity&>());
  // SGal3.def(py::init<const Translation&, const manif::SO3<Scalar>&, const LinearVelocity&>());
  SGal3.def(
    py::init<
      const Scalar, const Scalar, const Scalar,
      const Scalar, const Scalar, const Scalar,
      const Scalar, const Scalar, const Scalar,
      const Scalar
    >()
  );
  // SGal3.def(py::init<igen::Transform<Scalar, 3, Eigen::Isometry>&, const LinearVelocity&>());

  // SGal3.def("isometry", &manif::SGal3d::isometry);
  SGal3.def("rotation", &manif::SGal3d::rotation);
  // SGal3.def("quat", &manif::SGal3d::quat);
  SGal3.def("translation", &manif::SGal3d::translation);
  SGal3.def("x", &manif::SGal3d::x);
  SGal3.def("y", &manif::SGal3d::y);
  SGal3.def("z", &manif::SGal3d::z);
  SGal3.def("linearVelocity", &manif::SGal3d::linearVelocity);
  SGal3.def("vx", &manif::SGal3d::vx);
  SGal3.def("vy", &manif::SGal3d::vy);
  SGal3.def("vz", &manif::SGal3d::vz);
  SGal3.def("t", &manif::SGal3d::t);
  SGal3.def("normalize", &manif::SGal3d::normalize);

  // tangent
  wrap_tangent_base<
    manif::SGal3Tangentd, manif::TangentBase<manif::SGal3Tangentd>
  >(SGal3_tan);

  // SGal3_tan.def("v", &manif::SE3Tangentd::v);
  // SGal3_tan.def("w", &manif::SE3Tangentd::w);
  // SGal3_tan.def("a", &manif::SE3Tangentd::a);
}