@@ -56,15 +56,24 @@ estimate of shortest time per invposkin (ms) 0.155544
5656#include < chainfksolverpos_recursive.hpp>
5757#include < utilities/utility.h>
5858
59+ #include < boost/version.hpp>
60+ #if BOOST_VERSION < 108300
5961#include < boost/timer.hpp>
62+ #else
63+ #include < boost/timer/timer.hpp>
64+ #endif
6065
6166/* *
6267 * tests the inverse kinematics on the given kinematic chain for a
6368 * large number of times and provides statistics on the result.
6469 * \TODO provide other examples.
6570 */
6671void test_inverseposkin (KDL::Chain& chain) {
72+ #if BOOST_VERSION < 108300
6773 boost::timer timer;
74+ #else
75+ boost::timer::cpu_timer timer;
76+ #endif
6877 int num_of_trials = 1000000 ;
6978 int total_number_of_iter = 0 ;
7079 int n = chain.getNrOfJoints ();
@@ -159,7 +168,12 @@ void test_inverseposkin(KDL::Chain& chain) {
159168 std::cout << " max. trans. difference after solving " << max_trans_diff << std::endl;
160169 std::cout << " min. rot. difference after solving " << min_rot_diff << std::endl;
161170 std::cout << " max. rot. difference after solving " << max_rot_diff << std::endl;
171+ #if BOOST_VERSION < 108300
162172 double el = timer.elapsed ();
173+ #else
174+ boost::timer::cpu_times const ct (timer.elapsed ());
175+ double el = ct.user / 1e9 ;
176+ #endif
163177 std::cout << " elapsed time " << el << std::endl;
164178 std::cout << " estimate of average time per invposkin (ms)" << el/num_of_trials*1000 << std::endl;
165179 std::cout << " estimate of longest time per invposkin (ms) " << el/total_number_of_iter*max_num_of_iter *1000 << std::endl;
0 commit comments