[Rock-dev] Joystick and twice a std vector in RawCommand

Javier Hidalgo Carrió javier.hidalgo_carrio at dfki.de
Tue Apr 8 14:32:43 CEST 2014


Hi rocks!

Is there any particular reason why the axisValue is a 2D array?

  /* Index 1: num-of input axis, //index 2: dimensions of this axis
          * If you have an gamepand which has 2 2Dknops you have an [2][2]
          * size'd array for an 3D Mouse you could have [1][6]
          */
         std::vector<std::vector<double> > axisValue;

Why not to create a plain  std::vector<double> instead?

I am controlling with a joystick the ESA rover and there are several 
types of joysticks. They do not all have 4 axis in the main/principal 
joystick.
Therefore, I do not see the benefit of having a std::vector inside 
another std::vector.
My suggestion is to change it to a plain (1D array) std::vector and use 
the first 4 axis as it is now but without a 2D structure.

Javier.




More information about the Rock-dev mailing list