require('reshape2')
read_csv_and_groom <-function(path, cols_to_select, source)
{
data <- read.csv(path, header = FALSE)
data <- data[,cols_to_select]
colnames(data) <- c('ts', 'ns','x', 'y', 'z')
data$ns <- as.integer(data$ns)
data$ts <- as.integer(data$ts)
# transform secs rel to start
data$ts <- data$ts - data$ts[1]
# keep only milliseconds
data$ms <- data$ns / 1e6
print(data$ns)
print(data$ms)
data$ms <- data$ts * 1e3 + data$ms
data <- melt(data, na.rm = TRUE, id.vars = 'ms', measure.vars = c('x', 'y', 'z'))
data$source <- source
data
}
imu <- read_csv_and_groom('~/Downloads/imu.csv', c(1,2,29,30,31), 'imu')
mag <- read_csv_and_groom('~/Downloads/mag.csv', c(1,2,4,5,6), 'mag')
all <- rbind(imu, mag)
require('ggplot2')
ggplot(all[all$source == 'imu',], aes(x = ms)) +
geom_point(aes(y = value, color=interaction(source, variable)))
Please provide the following information:
Expected behaviour
The messages in /imu/data_raw have a near zero values in the x and y components when the robot is still.
Actual behaviour

A bias observed throughout a log, in which the robot starts at a still position.
To Reproduce
Provide the steps to reproduce: