[Rock-dev] <base/motion_command.h>

Sylvain Joyeux sylvain.joyeux at dfki.de
Tue Nov 29 19:26:41 CET 2011


On 11/29/2011 02:20 PM, Matthias Goldhoorn wrote:
> I currently cleaning up some "controllers" for this i would like to
> check how old the last message really is.
> I would prevent something like:
>
> if(last_message_time - base::Time::now()).toSeconds()>  foo) throw_error;
>
> do something....
>
> last_message_time = base::Time:now();
>
>
> instead i would like to use
>
>
> if(current_message.time - base::Time::now()).toSeconds()>  foo) throw_error;
>
> What make more sense from my point of view, all old controller dosn't
> need to change, but i don't want to create and "not so good written"
> controller only because, "yeah we think it make sense, but no we dont'
> want to change because we dont't want changes in base stuff even it make
> sense"
Well.. Life is hard.

I do find your attitude commendable. Now here are the hard facts: not 
everyone has a lot of time on their hand to update log files and make 
sure that everything is fine with the proposed change. So, unless there 
is a very important and good reason, changing base types should not be 
done whenever someone feels like it. Which is why we discuss and vote on 
this mailing list.

Using base::Time::now() as the "last message timestamp" is suboptimal, 
agreed. Now:

* if you make sure that you don't introduce latencies (i.e. know what
   you are doing with the stream aligner, or even better not use it in
   control loop), and introduce proper priorities and realtime tasks,
   the latency that you are trying to measure here won't be a problem.
* in general, if you are trying to implement timeout, well, the
   difference between the "wakeup time" and "data time" are low enough
   that you can still do timeouting.
-- 
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