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 magnetometer data is high and varying in the z dimension #71

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

The magnetometer data is high and varying in the z dimension #71

mllofriu opened this issue May 2, 2023 · 2 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/mag have low and non-varying z component of the magnetic field (not zero because the field is not parallel to the earth's surface)

Actual behaviour
The data has a high and varying z component

image

To Reproduce
Provide the steps to reproduce:

  1. run jackal bringup
  2. ros2 topic echo /imu/mag --csv
  3. plot in 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))) 


@tonybaltovski
Copy link
Member

Thanks for reporting this! We are going to looking into it and get back to you as soon as possible.

@mllofriu
Copy link
Author

mllofriu commented May 9, 2023

Thank you!

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

2 participants