Split into two units
parent
1ba304a2e3
commit
3bb34679be
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
#define ALLOW_DEPRECATED_IN_GTSAM4
|
|
||||||
#ifdef ALLOW_DEPRECATED_IN_GTSAM4
|
#ifdef ALLOW_DEPRECATED_IN_GTSAM4
|
||||||
/// @deprecated
|
/// @deprecated
|
||||||
struct PoseVelocityBias {
|
struct PoseVelocityBias {
|
||||||
|
|
|
@ -53,6 +53,7 @@ void exportBetweenFactors();
|
||||||
void exportGenericProjectionFactor();
|
void exportGenericProjectionFactor();
|
||||||
|
|
||||||
// navigation
|
// navigation
|
||||||
|
void exportImuFactor();
|
||||||
void exportScenario();
|
void exportScenario();
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,5 +100,6 @@ BOOST_PYTHON_MODULE(_libgtsam_python){
|
||||||
exportBetweenFactors();
|
exportBetweenFactors();
|
||||||
exportGenericProjectionFactor();
|
exportGenericProjectionFactor();
|
||||||
|
|
||||||
|
exportImuFactor();
|
||||||
exportScenario();
|
exportScenario();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
|
||||||
|
* Atlanta, Georgia 30332-0415
|
||||||
|
* All Rights Reserved
|
||||||
|
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
|
||||||
|
|
||||||
|
* See LICENSE for the license information
|
||||||
|
|
||||||
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief wraps ConstantTwistScenario class to python
|
||||||
|
* @author Frank Dellaert
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include <boost/python.hpp>
|
||||||
|
|
||||||
|
#define NO_IMPORT_ARRAY
|
||||||
|
#include <numpy_eigen/NumpyEigenConverter.hpp>
|
||||||
|
|
||||||
|
#include "gtsam/navigation/ImuFactor.h"
|
||||||
|
|
||||||
|
using namespace boost::python;
|
||||||
|
using namespace gtsam;
|
||||||
|
|
||||||
|
void exportImuFactor() {
|
||||||
|
class_<NavState>("NavState", init<>())
|
||||||
|
// TODO(frank): overload with jacobians
|
||||||
|
// .def("attitude", &NavState::attitude)
|
||||||
|
// .def("position", &NavState::position)
|
||||||
|
// .def("velocity", &NavState::velocity)
|
||||||
|
.def(repr(self))
|
||||||
|
.def("pose", &NavState::pose);
|
||||||
|
|
||||||
|
class_<imuBias::ConstantBias>("ConstantBias", init<>())
|
||||||
|
.def(init<const Vector3&, const Vector3&>())
|
||||||
|
.def(repr(self));
|
||||||
|
|
||||||
|
class_<PreintegrationParams, boost::shared_ptr<PreintegrationParams> >(
|
||||||
|
"PreintegrationParams", init<const Vector3&>())
|
||||||
|
.def_readwrite("gyroscopeCovariance",
|
||||||
|
&PreintegrationParams::gyroscopeCovariance)
|
||||||
|
.def_readwrite("omegaCoriolis", &PreintegrationParams::omegaCoriolis)
|
||||||
|
.def_readwrite("body_P_sensor", &PreintegrationParams::body_P_sensor)
|
||||||
|
.def_readwrite("accelerometerCovariance",
|
||||||
|
&PreintegrationParams::accelerometerCovariance)
|
||||||
|
.def_readwrite("integrationCovariance",
|
||||||
|
&PreintegrationParams::integrationCovariance)
|
||||||
|
.def_readwrite("use2ndOrderCoriolis",
|
||||||
|
&PreintegrationParams::use2ndOrderCoriolis)
|
||||||
|
.def_readwrite("n_gravity", &PreintegrationParams::n_gravity)
|
||||||
|
|
||||||
|
.def("MakeSharedD", &PreintegrationParams::MakeSharedD)
|
||||||
|
.staticmethod("MakeSharedD")
|
||||||
|
.def("MakeSharedU", &PreintegrationParams::MakeSharedU)
|
||||||
|
.staticmethod("MakeSharedU");
|
||||||
|
|
||||||
|
class_<PreintegratedImuMeasurements>(
|
||||||
|
"PreintegratedImuMeasurements",
|
||||||
|
init<const boost::shared_ptr<PreintegrationParams>&,
|
||||||
|
const imuBias::ConstantBias&>())
|
||||||
|
.def(repr(self))
|
||||||
|
.def("resetIntegration", &PreintegratedImuMeasurements::resetIntegration)
|
||||||
|
.def("integrateMeasurement",
|
||||||
|
&PreintegratedImuMeasurements::integrateMeasurement)
|
||||||
|
.def("preintMeasCov", &PreintegratedImuMeasurements::preintMeasCov);
|
||||||
|
|
||||||
|
// NOTE(frank): Abstract classes need boost::noncopyable
|
||||||
|
class_<ImuFactor, boost::noncopyable>("ImuFactor", no_init);
|
||||||
|
}
|
|
@ -48,42 +48,6 @@ void exportScenario() {
|
||||||
def("ScenarioPointer", &ScenarioPointer,
|
def("ScenarioPointer", &ScenarioPointer,
|
||||||
return_value_policy<reference_existing_object>());
|
return_value_policy<reference_existing_object>());
|
||||||
|
|
||||||
class_<PreintegrationParams, boost::shared_ptr<PreintegrationParams> >(
|
|
||||||
"PreintegrationParams", init<const Vector3&>())
|
|
||||||
.def_readwrite("gyroscopeCovariance",
|
|
||||||
&PreintegrationParams::gyroscopeCovariance)
|
|
||||||
.def_readwrite("omegaCoriolis", &PreintegrationParams::omegaCoriolis)
|
|
||||||
.def_readwrite("body_P_sensor", &PreintegrationParams::body_P_sensor)
|
|
||||||
.def_readwrite("accelerometerCovariance",
|
|
||||||
&PreintegrationParams::accelerometerCovariance)
|
|
||||||
.def_readwrite("integrationCovariance",
|
|
||||||
&PreintegrationParams::integrationCovariance)
|
|
||||||
.def_readwrite("use2ndOrderCoriolis",
|
|
||||||
&PreintegrationParams::use2ndOrderCoriolis)
|
|
||||||
.def_readwrite("n_gravity", &PreintegrationParams::n_gravity)
|
|
||||||
|
|
||||||
.def("MakeSharedD", &PreintegrationParams::MakeSharedD)
|
|
||||||
.staticmethod("MakeSharedD")
|
|
||||||
.def("MakeSharedU", &PreintegrationParams::MakeSharedU)
|
|
||||||
.staticmethod("MakeSharedU");
|
|
||||||
|
|
||||||
class_<PreintegratedImuMeasurements>(
|
|
||||||
"PreintegratedImuMeasurements",
|
|
||||||
init<const boost::shared_ptr<PreintegrationParams>&,
|
|
||||||
const imuBias::ConstantBias&>()).def(repr(self));
|
|
||||||
|
|
||||||
class_<NavState>("NavState", init<>())
|
|
||||||
// TODO(frank): overload with jacobians
|
|
||||||
// .def("attitude", &NavState::attitude)
|
|
||||||
// .def("position", &NavState::position)
|
|
||||||
// .def("velocity", &NavState::velocity)
|
|
||||||
.def(repr(self))
|
|
||||||
.def("pose", &NavState::pose);
|
|
||||||
|
|
||||||
class_<imuBias::ConstantBias>("ConstantBias", init<>())
|
|
||||||
.def(init<const Vector3&, const Vector3&>())
|
|
||||||
.def(repr(self));
|
|
||||||
|
|
||||||
class_<ScenarioRunner>(
|
class_<ScenarioRunner>(
|
||||||
"ScenarioRunner",
|
"ScenarioRunner",
|
||||||
init<const Scenario*, const boost::shared_ptr<PreintegrationParams>&,
|
init<const Scenario*, const boost::shared_ptr<PreintegrationParams>&,
|
||||||
|
|
Loading…
Reference in New Issue