[Rock-dev] std::vector<bool> allowed in types ?

Janosch Machowinski Janosch.Machowinski at dfki.de
Wed Jul 11 13:19:40 CEST 2012


Hi,
I know that there is an issue with the bool type.
Sadly I don't know the reason or have any detail
on when or where it is allowed. As a workaround
one can use uint8_t.
Greetings
     Janosch

On 11.07.2012 12:28, Felix Rehrmann wrote:
> Hi all,
>
> in Virgo we had the following data structure:
>
>       struct Bumpers
>       {
>           // Number of Bumpers (specific per Robot)
>           int nrFront;
>           int nrRear;
>           // States of Bumpers. See Aria Documentation and/or ArModes.cpp
>           // for an Example how to read out these values.
>           int front;
>           int rear;
>
>           std::vector<bool> bumpersFront;
>           std::vector<bool> bumpersRear;
>
>           base::Time time;
>       };
>
> When connecting to a port with this type via orocos.rb a segmentation
> fault happened.
> After changing std::vector<bool> to std::vector<int> the segmentation
> fault was gone.
>
> The questions is whether std::vector<bool> is not allowed at all (e.g.
> typelib cannot interpret it correctly,
> maybe because the interpretation of bool is not clear) or that this is a
> bug or missing feature?
>
> Thanks
> Felix
>
>


-- 
  Dipl. Inf. Janosch Machowinski
  SAR- & Sicherheitsrobotik
  
  DFKI Bremen
  Robotics Innovation Center
  Robert-Hooke-Straße 5
  28359 Bremen, Germany
  
  Phone: +49 (0)421 178 45-6614
  Fax:   +49 (0)421 178 45-4150
  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