Skip to content

Commit

Permalink
Merge pull request #794 from borglab/feature/values-double
Browse files Browse the repository at this point in the history
Remove separate function for double in wrapper
  • Loading branch information
varunagrawal authored Jun 16, 2021
2 parents 57453a5 + 52bf1cd commit ce1c73e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
29 changes: 24 additions & 5 deletions gtsam/gtsam.i
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,7 @@ class Values {
void insert(size_t j, const gtsam::PinholeCamera<gtsam::Cal3Bundler>& camera);
void insert(size_t j, const gtsam::imuBias::ConstantBias& constant_bias);
void insert(size_t j, const gtsam::NavState& nav_state);
void insert(size_t j, double c);

void update(size_t j, const gtsam::Point2& point2);
void update(size_t j, const gtsam::Point3& point3);
Expand All @@ -2278,13 +2279,31 @@ class Values {
void update(size_t j, const gtsam::NavState& nav_state);
void update(size_t j, Vector vector);
void update(size_t j, Matrix matrix);

template<T = {gtsam::Point2, gtsam::Point3, gtsam::Rot2, gtsam::Pose2, gtsam::SO3, gtsam::SO4, gtsam::SOn, gtsam::Rot3, gtsam::Pose3, gtsam::Unit3, gtsam::Cal3_S2, gtsam::Cal3DS2, gtsam::Cal3Bundler, gtsam::EssentialMatrix, gtsam::PinholeCameraCal3_S2, gtsam::PinholeCamera<gtsam::Cal3Bundler>, gtsam::imuBias::ConstantBias, gtsam::NavState, Vector, Matrix}>
void update(size_t j, double c);

template <T = {gtsam::Point2,
gtsam::Point3,
gtsam::Rot2,
gtsam::Pose2,
gtsam::SO3,
gtsam::SO4,
gtsam::SOn,
gtsam::Rot3,
gtsam::Pose3,
gtsam::Unit3,
gtsam::Cal3_S2,
gtsam::Cal3DS2,
gtsam::Cal3Bundler,
gtsam::EssentialMatrix,
gtsam::PinholeCameraCal3_S2,
gtsam::PinholeCamera<gtsam::Cal3Bundler>,
gtsam::imuBias::ConstantBias,
gtsam::NavState,
Vector,
Matrix,
double}>
T at(size_t j);

/// version for double
void insertDouble(size_t j, double c);
double atDouble(size_t j) const;
};

#include <gtsam/nonlinear/Marginals.h>
Expand Down
10 changes: 10 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,13 @@ add_custom_target(${GTSAM_PYTHON_INSTALL_TARGET}
COMMAND ${PYTHON_EXECUTABLE} ${GTSAM_PYTHON_BUILD_DIRECTORY}/setup.py install
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES}
WORKING_DIRECTORY ${GTSAM_PYTHON_BUILD_DIRECTORY})

# Custom make command to run all GTSAM Python tests
add_custom_target(
python-test
COMMAND
${CMAKE_COMMAND} -E env # add package to python path so no need to install
"PYTHONPATH=${GTSAM_PYTHON_BUILD_DIRECTORY}/$ENV{PYTHONPATH}"
${PYTHON_EXECUTABLE} -m unittest discover
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES}
WORKING_DIRECTORY ${GTSAM_PYTHON_BUILD_DIRECTORY}/gtsam/tests)
8 changes: 2 additions & 6 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ For instructions on updating the version of the [wrap library](https://github.co
## Unit Tests

The Python toolbox also has a small set of unit tests located in the
test directory. To run them:

```bash
cd <GTSAM_SOURCE_DIRECTORY>/python/gtsam/tests
python -m unittest discover
```
test directory.
To run them, use `make python-test`.

## Utils

Expand Down

0 comments on commit ce1c73e

Please sign in to comment.