Giter Site home page Giter Site logo

ros2_mpu9250_driver's Introduction

MPU9250 Driver for ROS2

This repository contains a ROS2 package that interfaces with an MPU9250 sensor over I2C. The accelerometer and gyroscope are calibrated on node startup (sensor needs to be on a plane with z-axis up and should not be moved during calibration). Calibration can be turned off in the parameters file. The orientation is calculated from accelerometer and magnetometer measurements and is currently unfiltered.

Dependencies

  • libi2c-dev

Setup

The number of iterations for calibration can be set up in include/mpu9250driver/mpu9250sensor.h. Following other parameters and default values are listed here and can be changed in params/mpu9250.yaml.

    gyro_range: 0
    accel_range: 0
    dlpf_bandwidth: 2
    gyro_x_offset: 0.0 # [deg/s]
    gyro_y_offset: 0.0 # [deg/s]
    gyro_z_offset: 0.0 # [deg/s]
    accel_x_offset: 0.0 # [m/s²]
    accel_y_offset: 0.0 # [m/s²]
    accel_z_offset: 0.0 # [m/s²]
    frequency: 100 # [Hz]

Build the package in your workspace:

colcon build --packages-select mpu9250driver

Source setup.bash in your workspace:

. install/setup.bash

Launch it:

ros2 launch mpu9250driver mpu9250driver_launch.py

Disclaimer

The project is still in work in progress state. I will spend some time every now and then when I'm free. Please don't expect everything to work flawlessly. Feel free to create a pull request if you want to contribute or fix bugs.

ros2_mpu9250_driver's People

Contributors

hiwad-aziz avatar leothehuman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ros2_mpu9250_driver's Issues

Remote I/O error

after i successfully installed all dependencies and launched this it gave me an error like this:
Note: I am using MPU 9250 and ROS2 (humble) + raspi-4

aiot@ubuntu:~$ ros2 launch mpu9250driver mpu9250driver_launch.py
[INFO] [launch]: All log files can be found below /home/aiot/.ros/log/2024-01-30-16-55-53-821800-ubuntu-10632
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [mpu9250driver-1]: process started with pid [10633]
[mpu9250driver-1] /dev/i2c-1
[mpu9250driver-1] [INFO] [1706601354.580129782] [mpu9250driver_node]: Calibrating...
[mpu9250driver-1] Accelerometer Range: +-2g
[mpu9250driver-1] Gyroscope Range: +-250 degree per sec
[mpu9250driver-1] DLPF Range: 94 Hz
[mpu9250driver-1] Accelerometer Offsets: x: 1.29235, y: -4.95298, z: -0.483442
[mpu9250driver-1] Gyroscope Offsets: x: 1.82969, y: -0.970473, z: 0.274786
[mpu9250driver-1] Error! Errno: Remote I/O error
[mpu9250driver-1] Error! Errno: Remote I/O error
[mpu9250driver-1] Error! Errno: Remote I/O error
[mpu9250driver-1] Error! Errno: Remote I/O error
[mpu9250driver-1] Error! Errno: Remote I/O error
[mpu9250driver-1] Error! Errno: Remote I/O error
[mpu9250driver-1] Error! Errno: Remote I/O error

message frequency

Hi. I am unable to change IMU message frequency. I've tried to update frequency from config file, also I've updated the wall timer from src. But frequency is around 160 Hz and does not change

Licensing

Hello!

First of all thanks for the great work on this driver!
I had a question regarding this project's licensing. I wanted to include your driver in one of my uni's projects and I noticed you didnt inlcude any license but the repo is public.
According to this:
https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository
"no one may reproduce, distribute, or create derivative works" if there is no license. So would you be interested to update your repo in the coming future in order for more people to be able to use your code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.