Skip to content

A ROS2 package that interfaces with an MPU6050 sensor over I2C.

Notifications You must be signed in to change notification settings

JosefGst/ros2_mpu6050_driver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPU6050 Driver for ROS2

This repository contains a ROS2 package that interfaces with an MPU6050 sensor over I2C. The sensor is 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 output is an IMU ROS message but the quaternion part is currently set to zero.

Dependencies

  • libi2c-dev

Setup

The number of iterations for calibration can be set up in include/mpu6050driver/mpu6050sensor.h. Following other parameters and default values are listed here and can be changed in params/mpu6050.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 mpu6050driver

Source setup.bash in your workspace:

. install/setup.bash

Grant user access to i2c, need to reboot afterwards:

sudo usermod <user-name> -aG i2c

Launch it:

ros2 launch mpu6050driver mpu6050driver_launch.py

About

A ROS2 package that interfaces with an MPU6050 sensor over I2C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 87.5%
  • Python 6.6%
  • CMake 5.9%