Robotics StackExchange | Archived questions

Turtlebot Gyro Measurements

I'm trying to measure the distance my turtlebot has rotated around its vertical z-axis. I have subscribed to "imu/data" to access the gyro. Here's my callback function:

void TurtlebotTeleop::gyro_callback(const sensor_msgs::Imu& msg)
{
  current_time_ = ros::Time::now();
  double vth = msg.angular_velocity.z; //radians per second
  double dt = (current_time_ - previous_time_).toSec();
  double delta_th = dt * vth;

  theta_ += delta_th;

  previous_time_ = current_time_;
}

The code is fairly straightforward. However, the values of vth are much lower than they should be. I have tried following the instructions on the ros wiki to calibrate the gyro. I have tried using all gyro sensor types in the reconfigure_gui.

Can anyone help me get accurate values from my gyro?

Asked by LogicalUnit on 2013-10-10 22:21:17 UTC

Comments

Answers