[Rock-dev] New JointState / Joints representation type
Sylvain Joyeux
sylvain.joyeux at dfki.de
Fri Jun 14 13:39:47 CEST 2013
Seems like a fair point ... However this assumes that you accumulate in
radians. One can also accumulate internally to the driver in ticks and
then do the convertions in radians:
#include <iostream>
#include <stdint.h>
int main(void)
{
uint64_t ticks = 0;
double d = 0;
float f = 0;
uint64_t offset = 1215;
const size_t mi = 100000;
for(int i=0; i<mi; i++)
{
d = ticks / 124.0;
uint64_t d_ticks = d * 124;
f = ticks / 124.0f;
uint64_t f_ticks = f * 124;
if( i % (mi/10) == 0 )
std::cout << d << " " << (d - f) << " " << f_ticks - ticks
<< ": " << (d_ticks - ticks) << std::endl;
ticks += offset;
}
}
Which gives (the last two numbers are errors in ticks when position gets
re-converted into ticks)
0 0 0: 0
9758.06 6.3004e-05 0: 0
19516.1 0.000126008 0: 0
29274.2 0.000189012 0: 0
39032.3 0.000252016 0: 0
48790.3 -0.0016381 0: 0
58548.4 0.000378024 0: 0
68306.5 -0.0015121 0: 0
78064.5 0.000504032 0: 0
87822.6 0.00252016 0: 0
--
Sylvain Joyeux (Dr.Ing.)
Space & Security Robotics
!!! Achtung, neue Telefonnummer!!!
Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0)421 178-454136
Fax: +49 (0)421 218-454150
E-Mail: robotik at dfki.de
Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
-----------------------------------------------------------------------
More information about the Rock-dev
mailing list