Skip to content

Free function templating does not work (as expected) #148

@dellaert

Description

@dellaert

I think the global function templating is broken. It should not add the type to the function name (just create the overload for the function), and it also omits the namespace in the code, leading to a compile error

Instead of

    m_.def("triangulatePoint3Cal3_S2",[](
const gtsam::Pose3Vector& poses, boost::shared_ptr<gtsam::Cal3_S2> sharedCal, 
const gtsam::Point2Vector& measurements, double rank_tol, bool optimize, 
const gtsam::SharedNoiseModel& model){
return gtsam::triangulatePoint3<Cal3_S2>
(poses, sharedCal, measurements, rank_tol, optimize, model);},
py::arg("poses"), py::arg("sharedCal"), py::arg("measurements"), py::arg("rank_tol"), py::arg("optimize"), py::arg("model") = nullptr);

It should be

    m_.def("triangulatePoint3",[](
const gtsam::Pose3Vector& poses, boost::shared_ptr<gtsam::Cal3_S2> sharedCal, 
const gtsam::Point2Vector& measurements, double rank_tol, bool optimize, 
const gtsam::SharedNoiseModel& model){
return gtsam::triangulatePoint3<gtsam::Cal3_S2>
(poses, sharedCal, measurements, rank_tol, optimize, model);},
py::arg("poses"), py::arg("sharedCal"), py::arg("measurements"), py::arg("rank_tol"), py::arg("optimize"), py::arg("model") = nullptr);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions