Skip to content

Improper template expansion #175

Description

@p-zach

This function:

void add(const CAMERA::Measurement& measured, const gtsam::Key& poseKey, const size_t& cameraId = 0);

within the definition

template <CAMERA = {gtsam::PinholeCamera<gtsam::Cal3_S2>}>
class SmartProjectionRigFactor : gtsam::SmartProjectionFactor<CAMERA> {

is wrapped to this pybind code:

.def("add",[](gtsam::SmartProjectionRigFactor<gtsam::PinholeCamera<gtsam::Cal3_S2>>* self, 
  const gtsam::PinholeCamera::Measurement<gtsam::Cal3_S2>& measured, 
  const gtsam::Key& poseKey, const size_t& cameraId){ 
  self->add(measured, poseKey, cameraId);}, 
  py::arg("measured"), py::arg("poseKey"), py::arg("cameraId") = 0, "")

which does not compile because of the generated type of the second argument (measured). I would expect it to wrap to:

.def("add",[](gtsam::SmartProjectionRigFactor<gtsam::PinholeCamera<gtsam::Cal3_S2>>* self, 
  const gtsam::PinholeCamera<gtsam::Cal3_S2>::Measurement& measured, 
  const gtsam::Key& poseKey, const size_t& cameraId){ 
  self->add(measured, poseKey, cameraId);}, 
  py::arg("measured"), py::arg("poseKey"), py::arg("cameraId") = 0, "")

Note the difference in the second argument: the incorrect gtsam::PinholeCamera::Measurement<gtsam::Cal3_S2> vs. the correct gtsam::PinholeCamera<gtsam::Cal3_S2>::Measurement

Is this a bug, or something I can fix by modifying the signature of add?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions