Turtlebot Gyro Measurements [closed]

asked 2013-10-10 22:21:17 -0500

LogicalUnit gravatar image

updated 2013-11-18 19:27:51 -0500

tfoote gravatar image

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?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2016-07-27 17:57:14.575019