-
Notifications
You must be signed in to change notification settings - Fork 616
/
Copy pathSophusPyBind.h
35 lines (29 loc) · 1.02 KB
/
SophusPyBind.h
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
#pragma once
#include "SE3PyBind.h"
#include "SO3PyBind.h"
#include <sstream>
// By default, Sophus calls std::abort when a pre-condition fails. Register a
// handler that raises an exception so we don't crash the Python process.
#ifdef SOPHUS_DISABLE_ENSURES
#undef SOPHUS_DISABLE_ENSURES
#endif
#ifndef SOPHUS_ENABLE_ENSURE_HANDLER
#define SOPHUS_ENABLE_ENSURE_HANDLER
#endif
namespace Sophus {
inline void ensureFailed(char const* function, char const* file, int line,
char const* description) {
std::stringstream message;
message << "'SOPHUS_ENSURE' failed in function '" << function
<< "', on line '" << line << "' of file '" << file
<< "'. Full description:" << std::endl
<< description;
throw std::domain_error(message.str());
}
inline void exportSophus(pybind11::module& module) {
exportSO3Group<double>(module, "SO3");
exportSE3Transformation<double>(module, "SE3");
exportSE3Average<double>(module);
exportSE3Interpolate<double>(module);
}
} // namespace Sophus