Ask Your Question
0

Kobuki "gyro" versus "inertia" packets?

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

Pi Robot gravatar image

Hello,

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?

Thanks!
patrick

http://www.pirobot.org/wordpress

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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>(inertia.data.angle) / 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>(inertia.data.angle_rate) / 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

Stats

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

Seen: 109 times

Last updated: Apr 24 '16