Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The imu (raw) has a bias in the x component #72

Open
mllofriu opened this issue May 2, 2023 · 3 comments
Open

The imu (raw) has a bias in the x component #72

mllofriu opened this issue May 2, 2023 · 3 comments
Assignees
Labels

Comments

@mllofriu
Copy link

mllofriu commented May 2, 2023

Please provide the following information:

  • OS: Ubuntu 20.04 in Tegra
  • ROS Distro: Foxy
  • Built from source or installed: Installed, built jackal packages from source
  • Package version: ee4e3f6

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.
image

To Reproduce
Provide the steps to reproduce:

  1. run jackal bringup
  2. let the robot be still
  3. ros2 topic echo /imu/data_raw --csv
  4. plot with R
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))) 

@mllofriu mllofriu added the bug label May 2, 2023
@mllofriu mllofriu changed the title The z axis of the imu (raw) flips at certain times The z axis of the imu (raw) has a bias in the x component May 2, 2023
@tonybaltovski
Copy link
Member

The accelerometer when stationary is measuring the force of gravity. If the platform is not perfectly aligned with Earth's gravity vector it could have X or Y direction offsets. Is the Jackal started on a flat surface? Does the filtered data have the same offset?

@mllofriu mllofriu changed the title The z axis of the imu (raw) has a bias in the x component The imu (raw) has a bias in the x component May 9, 2023
@mllofriu
Copy link
Author

mllofriu commented May 9, 2023

The jackal is started in a flat surface. It's just running on the floor.

The z component seems close to the expected value for the gravity, so I wouldn't expect a significant component in x or y (unless that is not to scale).

By 'filtered output' do you mean the madgwick filter? Does that correct for a potential offset of the imu_link?

@marco-ambrosio
Copy link

I would like to add that the data published on /Imu/data_raw are without covariance, thus standard filter implemented in ROS can do pretty nothing on them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants