ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Rotate the coordinates of IMU

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

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
0

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

Dyson sphere gravatar image

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

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

Question Tools

2 followers

Stats

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

Seen: 1,167 times

Last updated: Jan 08 '19