aligator  0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
fwd.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace boost {
6template <typename T, typename A>
7inline T *get_pointer(::xyz::polymorphic<T, A> const &x) {
8 const T *r = x.operator->();
9 return const_cast<T *>(r);
10}
11} // namespace boost
12
13#include <eigenpy/eigenpy.hpp>
14#include <eigenpy/std-vector.hpp>
15
17
19namespace aligator::python {
20namespace bp = boost::python;
21using eigenpy::StdVectorPythonVisitor;
22
24inline bp::arg operator""_a(const char *argname, std::size_t) {
25 return bp::arg(argname);
26}
27
28namespace internal {
29
30template <typename ret_type>
31ret_type suppress_if_void(bp::detail::method_result &&o) {
32 if constexpr (!std::is_void_v<ret_type>)
33 return o.operator ret_type();
34}
35
36} // namespace internal
37
39void exposeGAR();
41void exposeFunctions();
43void exposeCosts();
45void exposeConstraint();
47void exposeStage();
49void exposeProblem();
50
52void exposeDynamics();
57
59void exposeSolvers();
61void exposeCallbacks();
63void exposeAutodiff();
65void exposeUtils();
67void exposeFilter();
68
69#ifdef ALIGATOR_WITH_PINOCCHIO
73#endif
74} // namespace aligator::python
75
76#define ALIGATOR_PYTHON_OVERRIDE_IMPL(ret_type, pyname, ...) \
77 do { \
78 if (bp::override fo = this->get_override(pyname)) { \
79 decltype(auto) o = fo(__VA_ARGS__); \
80 return ::aligator::python::internal::suppress_if_void<ret_type>( \
81 std::move(o)); \
82 } \
83 } while (false)
84
90#define ALIGATOR_PYTHON_OVERRIDE_PURE(ret_type, pyname, ...) \
91 ALIGATOR_PYTHON_OVERRIDE_IMPL(ret_type, pyname, __VA_ARGS__); \
92 ALIGATOR_RUNTIME_ERROR("Tried to call pure virtual function {:s}.", pyname)
93
98#define ALIGATOR_PYTHON_OVERRIDE(ret_type, cname, fname, ...) \
99 ALIGATOR_PYTHON_OVERRIDE_IMPL(ret_type, #fname, __VA_ARGS__); \
100 return cname::fname(__VA_ARGS__)
The Python bindings.
Definition blk-matrix.hpp:5
void exposeGAR()
Expose GAR module.
void exposeConstraint()
Expose constraints.
void exposeStage()
Expose StageModel and StageData.
void exposeUtils()
Expose utils.
void exposeCosts()
Expose cost functions.
void exposeSolvers()
Expose solvers.
void exposeDynamics()
Expose discrete dynamics.
void exposeIntegrators()
Expose numerical integrators.
void exposeCallbacks()
Expose solver callbacks.
void exposeFilter()
Expose filter strategy.
void exposeProblem()
Expose TrajOptProblem.
void exposeContinuousDynamics()
Expose continuous dynamics.
void exposeAutodiff()
Expose autodiff helpers.
void exposeFunctions()
Expose stagewise function classes.