Robotics StackExchange | Archived questions

Rotate the coordinates of IMU

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)?

Asked by S.Yildiz on 2019-01-08 05:41:45 UTC

Comments

Answers

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.

Asked by Dyson sphere on 2019-01-08 06:22:45 UTC

Comments