[Rock-dev] assumptions in joint_dispatcher -- NamedVector

Steffen Planthaber Steffen.Planthaber at dfki.de
Fri Mar 7 08:31:54 CET 2014


Hi,

When touching the Joints.hpp, I'd also propose to change the NamedVector 
class in order to allow std::map- like behavior:

If an (named) element does not exist, it should be created when using 
the operator[](std::string name).

This way motion controllers do not have to initialize the size of the 
vector in configuration state, which again eliminates the need to put 
the joint names or the number of total joints into an configuration file 
(.yml) for the controller at all (one place less where they are defined).

As syskit may provide a different network plan at later times, 
additional joints may become available in a later stage, in the current 
case you need to start another controller to handle them.

Nevertheless, the check whether the joint is available should be done on 
Joint driver level, not on controller level.

This behavior would also remove an error source, as the [] operator 
throws an exception in case the joint is not available, if a dev forgot 
to catch it around the access, a joint controller whould exit and 
potentially the robot whould do something stupid then.

I personally have never seen something like this:

try{
	joints["wheel"].speed = 0.5;
}catch (InvalidName invalidName){
	LOG_ERROR("Joint %s does not exists\n",invalidName.name)
}

I think the joint controller should know best which joints exist.

Best, Steffen


Am 06.03.2014 19:02, schrieb Janosch Machowinski:
> Hey,
> I just ran into some assumptions that are used
> in the joint_dispatcher. The code assumes, that the
> input size and the input name order of a
> base::sample::Joints never changes.
> For my use case this assumption is not working.
> Should I change the code and remove this assumption ?
> Greetings
>       Janosch
>


-- 
  Steffen Planthaber
  Weltraumrobotik

  Besuchsadresse der Nebengeschäftstelle:
  DFKI GmbH
  Robotics Innovation Center
  Robert-Hooke-Straße 5
  28359 Bremen, Germany

  Postadresse der Hauptgeschäftsstelle Standort Bremen:
  DFKI GmbH
  Robotics Innovation Center
  Robert-Hooke-Straße 1
  28359 Bremen, Germany

  Tel.:     +49 421 178 45-4125
  Zentrale: +49 421 178 45-0
  Fax:      +49 421 178 45-4150 (Faxe bitte namentlich kennzeichnen)
  E-Mail:   Steffen.Planthaber 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