Skip to content

MATLAB wrapper fails to build after Galilean IMU wrapper additions #2756

Description

@dellaert

Description

The MATLAB wrapper no longer builds on current develop when the MATLAB toolbox is enabled. Building or installing reaches the generated gtsam_wrapper.cpp and fails because it refers to three types that do not exist in the public gtsam C++ namespace:

  • gtsam::PreintegratedImuMeasurementsManifold
  • gtsam::PreintegratedImuMeasurementsTangent
  • gtsam::PreintegratedImuMeasurementsLieGroup

Representative compiler output:

error: no template named 'PreintegratedImuMeasurementsManifold' in namespace 'gtsam'
error: no template named 'PreintegratedImuMeasurementsTangent' in namespace 'gtsam'
error: no template named 'PreintegratedImuMeasurementsLieGroup' in namespace 'gtsam'

The subsequent collector errors in the generated wrapper are consequences of these missing types.

Reproduction

Configure GTSAM with the MATLAB toolbox enabled, then build or install:

cmake -S . -B build -DGTSAM_INSTALL_MATLAB_TOOLBOX=ON
cmake --build build -j6
cmake --install build

The failure occurs while compiling the generated MATLAB MEX wrapper:

Building CXX object matlab/CMakeFiles/gtsam_matlab_wrapper.dir/__/wrap/gtsam/gtsam_wrapper.cpp.o

Why it fails

The three class declarations were added to the shared wrapper interface in gtsam/navigation/navigation.i, which is consumed by both the Python and MATLAB wrapper generators.

Their corresponding C++ shim definitions were added only to python/gtsam/preamble/navigation.h. The Python wrapper includes that preamble, but the MATLAB wrapper does not. Consequently, MATLAB wrapper generation emits code for the declared class names without any C++ definitions for them.

Introducing pull request

This was introduced by #2231, Galilean IMU Factor, specifically commit e8873828a291952d7c3c46890bd7b800b912db90 (“Add Galilean IMU NEES comparison”), which added both the shared interface declarations and the Python-only preamble definitions.

Environment observed

  • macOS on Apple Silicon
  • MATLAB MEX target: mexmaca64
  • GTSAM develop

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions