Ask Your Question

Rotate the coordinates of IMU

asked 2019-01-08 04:41:45 -0500

S.Yildiz gravatar image

Hey, I'm using a imu but the problem is that the coordinate frame is wrong. y/roll is pointing to north, x/pitch is pointing to east and z is down. But I have to rotate it 180° to the positive side by roll. I know I have to do something like this:

  tf::Transform transform;
  transform.setOrigin( tf::Vector3(0.0, 0.0, 0.0) );
  transform.setRotation( tf::createQuaternionFromRPY(0,0,M_PI/2) );
  tf_broadcast->sendTransform(tf::StampedTransform(transform, ros::Time::now(), "/base_link", "imu_frame"));

But instead of using pi/2 I have to use pi? And it has to be (PI,0,0)?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-01-08 05:22:45 -0500

Dyson sphere gravatar image

updated 2019-01-08 05:25:49 -0500

At first I would advise you to check if you mounted the sensor in a "correct way" aka "correct" orientation (check your sensors documentation/manual on this one). Simple mistake of switching top and bottom side can be stressful and could be a cause of your problems. If this part is correct then the "problem" you are facing could be in coordinate system your IMU uses. There are left- and right-handed coordinate system, both of which are know to be used in robotics. Check this link for more information. Hope this helps you understand more about your problem.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-01-08 04:41:45 -0500

Seen: 676 times

Last updated: Jan 08 '19