Hello,
Does anybody know how exactly the Gyro messages (imu/data; imu/raw) are subscribed/published in the turtle-bot node?
I have an ICreate Robot that doesn't have an inbuilt Gyro..But when I launch the turtlebot dashboard, it displays some random values in place of Gyro messages! I am not sure why that happens! I am trying to use an external Gyroscope (it publishes IMU messages) to publish the Gyro messages instead of the default ones published from the turtlebot node... Can anyone tell me how to go about doing it?
I realized a simple "remapping" of messages wouldn't work in this case!
Would really appreciate any kind of help that you can provide!
Thanks. Divya
The TurtleBot power board has a gyro attached to the analog in. The create reads the data from the analog input and publishes it on imu/data. Set the has_gyro parameter to false and then it should not publish gyro data anymore.
To publish your own gyro data to ROS you need to either use an existing ROS driver for your gyro or write your own ROS drive to publish an Imu msg on the imu/data topic.
Hi, I echoed the topic /imu/raw and found out that the z and w keeps on changing. When w increases the z decreases. I kept the turtlebot at the same position , w decreases and then after some time it started increasing .
The data from the gyro was never stable.
Is it normal or is there something wrong in the gyro?
This is an answer to @rohan. Gyro data will drift. I found this link to be quite helpful. http://www.instructables.com/id/Guide-to-gyro-and-accelerometer-with-Arduino-inclu/
For those interested in adding a cheap angular rate gyro to their robot designs for helping with odometry calcs, here's some pseudo code for calculating the orientation that might help:
calibration = [] // array for building calibration offset
loop() {
gyro_adc = get_gyro_value_from_analog()
if (robotIsNotMoving) {
calibration.push_back(gyro_adc)
total = 0;
for each( float reading, calibration )
{
total += reading;
}
cal_offset = total / calibration.size()
}
this_reading_time = get_current_time()
dt = this_reading_time - last_reading_time
max_value = 255; // 8 bit ADC
v_ref = 5; // arduino is a 5V ref
zero_rate_v = cal_offset * v_ref / max_value
sensitivity = 0.013 // get from gyro data sheet
rate = (gyro_adc * v_ref / max_value - zero_rate_v) / sensitivity
orientation += rate * dt
// do something with orientation (put it in an IMU msg, etc.)
// ...
last_reading_time = this_reading_time
}
@jjcf89 Thanks a lot for the link.
I forgot to mention one thing the z and w under the orientation heading is unstable.
It starts decreasing from 0.999 to 0.00 and the again goes up.
Is this normal?
When i publish the analog input it is stable at 514 . So i think the gyro is working fine. http://answers.ros.org/question/34298/gyro-for-turtlebot
rohan ( 2012-05-18 10:09:27 -0500 )editAsked: 2011-12-08 02:16:11 -0500
Seen: 383 times
Last updated: May 18 '12
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.