pantor / ruckig

Motion Generation for Robots and Machines. Real-time. Jerk-constrained. Time-optimal.
https://ruckig.com
MIT License
728 stars 164 forks source link

waypoint example compile error? #88

Closed QAbot-zh closed 3 years ago

QAbot-zh commented 3 years ago

hi, I try to compile the examples demo. I modify CMakeLists.txt to compile the 3_waypoints.cpp but I get the error like that :

/mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp: In function ‘int main()’: /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:14:61: error: no matching function for call to ‘ruckig::Ruckig<3>::Ruckig()’ Ruckig otg {control_cycle, max_number_of_waypoints}; ^ In file included from /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:3:0: /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:58:14: note: candidate: template<long unsigned int D, typename std::enable_if<(D == 0), int>::type > ruckig::Ruckig<DOFs, throw_error, return_error_at_maximal_duration>::Ruckig(size_t, double) explicit Ruckig(size_t dofs, double delta_time): degrees_of_freedom(dofs), delta_time(delta_time), calculator(Calculator<0>(dofs)), max_number_of_waypoints(0), current_input(InputParameter<0>(dofs)) { ^~ /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:58:14: note: template argument deduction/substitution failed: /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:57:77: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’ template <size_t D = DOFs, typename std::enable_if<D == 0, int>::type = 0> ^ /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:57:77: note: invalid template non-type parameter In file included from /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:3:0: /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:54:14: note: candidate: template<long unsigned int D, typename std::enable_if<(D == 0), int>::type > ruckig::Ruckig<DOFs, throw_error, return_error_at_maximal_duration>::Ruckig(size_t) explicit Ruckig(size_t dofs): degrees_of_freedom(dofs), delta_time(-1.0), calculator(Calculator<0>(dofs)), max_number_of_waypoints(0), current_input(InputParameter<0>(dofs)) { ^~ /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:54:14: note: template argument deduction/substitution failed: /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:14:61: note: candidate expects 1 argument, 2 provided Ruckig otg {control_cycle, max_number_of_waypoints}; ^ In file included from /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:3:0: /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:50:14: note: candidate: template<long unsigned int D, typename std::enable_if<(D >= 1), int>::type > ruckig::Ruckig<DOFs, throw_error, return_error_at_maximal_duration>::Ruckig(double) explicit Ruckig(double delta_time): degrees_of_freedom(DOFs), delta_time(delta_time), max_number_of_waypoints(0) { ^~ /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:50:14: note: template argument deduction/substitution failed: /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:14:61: note: candidate expects 1 argument, 2 provided Ruckig otg {control_cycle, max_number_of_waypoints}; ^ In file included from /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:3:0: /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:46:14: note: candidate: template<long unsigned int D, typename std::enable_if<(D >= 1), int>::type > ruckig::Ruckig<DOFs, throw_error, return_error_at_maximal_duration>::Ruckig() explicit Ruckig(): degrees_of_freedom(DOFs), delta_time(-1.0), max_number_of_waypoints(0) { ^~ /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:46:14: note: template argument deduction/substitution failed: /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:14:61: note: candidate expects 0 arguments, 2 provided Ruckig otg {control_cycle, max_number_of_waypoints}; ^ In file included from /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:3:0: /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:25:7: note: candidate: ruckig::Ruckig<3>::Ruckig(const ruckig::Ruckig<3>&) class Ruckig { ^~ /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:25:7: note: candidate expects 1 argument, 2 provided /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:25:7: note: candidate: ruckig::Ruckig<3>::Ruckig(ruckig::Ruckig<3>&&) /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:25:7: note: candidate expects 1 argument, 2 provided /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:16:58: error: no matching function for call to ‘ruckig::OutputParameter<3>::OutputParameter()’ OutputParameter output {max_number_of_waypoints}; ^ In file included from /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:15:0, from /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:3: /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:55:5: note: candidate: template<long unsigned int D, typename std::enable_if<(D == 0), int>::type > ruckig::OutputParameter::OutputParameter(size_t) OutputParameter(size_t dofs): degrees_of_freedom(dofs), trajectory(Trajectory<0>(dofs)) { ^~~~~~~ /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:55:5: note: template argument deduction/substitution failed: /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:54:77: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’ template <size_t D = DOFs, typename std::enable_if<D == 0, int>::type = 0> ^ /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:54:77: note: invalid template non-type parameter /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:52:5: note: candidate: template<long unsigned int D, typename std::enable_if<(D >= 1), int>::type > ruckig::OutputParameter::OutputParameter() OutputParameter(): degrees_of_freedom(DOFs) { } ^~~~~~~ /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:52:5: note: template argument deduction/substitution failed: /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:16:58: note: candidate expects 0 arguments, 1 provided OutputParameter output {max_number_of_waypoints}; ^ In file included from /mnt/data/old_home/learning-code/ruckig/include/ruckig/ruckig.hpp:15:0, from /mnt/data/old_home/learning-code/ruckig/examples/3_waypoints.cpp:3: /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:15:7: note: candidate: constexpr ruckig::OutputParameter<3>::OutputParameter(const ruckig::OutputParameter<3>&) class OutputParameter { ^~~~~~~ /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:15:7: note: no known conversion for argument 1 from ‘const size_t {aka const long unsigned int}’ to ‘const ruckig::OutputParameter<3>&’ /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:15:7: note: candidate: constexpr ruckig::OutputParameter<3>::OutputParameter(ruckig::OutputParameter<3>&&) /mnt/data/old_home/learning-code/ruckig/include/ruckig/output_parameter.hpp:15:7: note: no known conversion for argument 1 from ‘const size_t {aka const long unsigned int}’ to ‘ruckig::OutputParameter<3>&&’ CMakeFiles/example-3_waypoints.dir/build.make:62: recipe for target 'CMakeFiles/example-3_waypoints.dir/examples/3_waypoints.cpp.o' failed make[2]: [CMakeFiles/example-3_waypoints.dir/examples/3_waypoints.cpp.o] Error 1 CMakeFiles/Makefile2:326: recipe for target 'CMakeFiles/example-3_waypoints.dir/all' failed make[1]: [CMakeFiles/example-3_waypoints.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2

How should I do to fix it?

pantor commented 3 years ago

Hi!

The examples 3 and 4 show the usage of intermediate waypoints, and therefore you need the Ruckig Pro version to compile it. With the latest commit, I've added a comment at the top the files to clear that up.