ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Kobuki "gyro" versus "inertia" packets?

asked 2016-03-31 12:00:25 -0500

Pi Robot gravatar image


I have a Kobuki (a.k.a. TurtleBot 2) and I am trying to understand some of the source code in the kobuki and kobuki_core packages. Specifically, the inertia.hpp file refers to both the angle and the angle_rate. I was wondering how the raw angle is obtained at this low level if only a gyro is used? Also, there is a separate three_axis_gyro.hpp file that seems to be handling the gyro so I'm not sure which data is actually being used to compute the Kobuki's orientation.

Can someone help me find where in the source code the robot's orientation angle (around the z-axis) is actually computed or measured?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-24 09:21:01 -0500

woshidag gravatar image

updated 2016-04-24 10:07:39 -0500

gvdhoorn gravatar image

source code in kobuki.cpp

ecl::Angle<double> Kobuki::getHeading() const
  ecl::Angle<double> heading;
  // raw data angles are in hundredths of a degree, convert to radians.
  heading = (static_cast<double>( / 100.0) * ecl::pi / 180.0;
  return ecl::wrap_angle(heading - heading_offset);

double Kobuki::getAngularVelocity() const
  // raw data angles are in hundredths of a degree, convert to radians.
  return (static_cast<double>( / 100.0) * ecl::pi / 180.0;
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

1 follower


Asked: 2016-03-31 12:00:25 -0500

Seen: 196 times

Last updated: Apr 24 '16