borglab / GTDynamics

Full kinodynamics constraints for arbitrary robot configurations with factor graphs.
BSD 2-Clause "Simplified" License
39 stars 10 forks source link

adding jumping robot to ci #247

Closed yetongumich closed 3 years ago

yetongumich commented 3 years ago

Adding jumping robot to ci, and update according to new api changes.

dellaert commented 3 years ago

@gchenfc take a look at cable robot failures above.

gchenfc commented 3 years ago

I think they're jumping-robot failures?

/home/runner/work/GTDynamics/GTDynamics/build/python/jumpingrobot.cpp: In lambda function:
/home/runner/work/GTDynamics/GTDynamics/build/python/jumpingrobot.cpp:75:389: error: invalid initialization of reference of type ‘const KeyVector&’ {aka ‘const std::vector<long unsigned int, tbb::tbb_allocator<long unsigned int> >&’} from expression of type ‘const std::vector<long unsigned int>’
   75 |     m_.def("AddSourceMassCollocationFactor",[](gtsam::NonlinearFactorGraph* graph, const std::vector<gtsam::Key>& mdot_prev_keys, const std::vector<gtsam::Key>& mdot_curr_keys, gtsam::Key source_mass_key_prev, gtsam::Key source_mass_key_curr, gtsam::Key dt_key, bool isEuler, const boost::shared_ptr<gtsam::noiseModel::Base> cost_model){ gtdynamics::AddSourceMassCollocationFactor(graph, mdot_prev_keys, mdot_curr_keys, source_mass_key_prev, source_mass_key_curr, dt_key, isEuler, cost_model);}, py::arg("graph"), py::arg("mdot_prev_keys"), py::arg("mdot_curr_keys"), py::arg("source_mass_key_prev"), py::arg("source_mass_key_curr"), py::arg("dt_key"), py::arg("isEuler"), py::arg("cost_model"));
      |                                                                                                                                                                                                                                                                                                                                                                                                     ^~~~~~~~~~~~~~
In file included from /home/runner/work/GTDynamics/GTDynamics/build/python/jumpingrobot.cpp:22:
/home/runner/work/GTDynamics/GTDynamics/gtdynamics/jumpingrobot/factors/JRCollocationFactors.h:40:65: note: in passing argument 2 of ‘void gtdynamics::AddSourceMassCollocationFactor(gtsam::NonlinearFactorGraph*, const KeyVector&, const KeyVector&, gtsam::Key, gtsam::Key, gtsam::Key, bool, const shared_ptr&)’
   40 |     gtsam::NonlinearFactorGraph* graph, const gtsam::KeyVector& mdot_prev_keys,
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
make[2]: *** [python/CMakeFiles/gtdynamics_py.dir/jumpingrobot.cpp.o] Error 1
python/CMakeFiles/gtdynamics_py.dir/build.make:119: recipe for target 'python/CMakeFiles/gtdynamics_py.dir/jumpingrobot.cpp.o' failed
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:1273: recipe for target 'python/CMakeFiles/gtdynamics_py.dir/all' failed
Makefile:145: recipe for target 'all' failed
make[1]: *** [python/CMakeFiles/gtdynamics_py.dir/all] Error 2
make: *** [all] Error 2
Error: Process completed with exit code 2.

The errors were just listed directly after cablerobot.cpp probably because the -j make option is turned on on the CI.

Nevertheless @yetongumich, taking a look, I think you can just use const gtsam::KeyVector& instead of const std::vector<gtsam::Key>& in the .i file. Since it's defined in gtsam's preamble/specializations with implicitly_convertible (and handles TBB allocator), then it should still be transparent in python and won't get these TBB errors

https://github.com/borglab/gtsam/blob/d7f048b6c4d28708706c5bab4032808df04eb0a0/python/gtsam/specializations/gtsam.h#L14-L20

gchenfc commented 3 years ago

See the first half of #208

Ignore part about MacOS needing TBB

yetongumich commented 3 years ago

Passing all CI tests and merge.