What this code means?

v vector?
i can’t understand that!
why multiply ‘v’ vector??

this page377 line

This line initializes a variable of type math::Vector<3> (a class), with the name v, with values (1.0f, 0.0f, 0.4f) (passed to the constructor).

Thank you but, I want to know
math::Matrix<3, 3> Rvis = q.to_dcm();
math::Vector<3> v(1.0f, 0.0f, 0.4f);

// Rvis is Rwr (robot respect to world) while v is respect to world.
// Hence Rvis must be transposed having (Rwr)’ * Vw
// Rrw * Vw = vn. This way we have consistency
_vision_hdg = Rvis.transposed() * v;

this code meaning.

Hello Lion,

First consider the two following definitions:

  1. Rvis is a rotation matrix “from robot to world coordinates”.
  2. v is a vector expressed in the world frame.

In order to have the vector v expressed in the robot frame, you have to rotate it with the inverse of Rvis which is also its transpose (for a rotation matrix, R^-1 = R’).

In conclusion: v(in robot frame) = R(from world to robot) x v(in world frame)