This a module for the micro_rosso system.
It provides support for the MPU6050 IMU by publishing ROS2 topics.
First, import the module into your project's platformio.ini
:
lib_deps =
...
https://github.com/xopxe/micro_rosso_mpu6050.git
Then, in your main.cpp
:
...
#include "micro_rosso_mpu6050.h"
ImuMPU6050 imu;
...
void setup() {
Wire.begin(I2C_SDA, I2C_SCL); // initialize I2C as needed
...
imu.setup(Wire);
...
}
The setup method allows passing optional topic names and a different micro_rosso timer to change the publication rate (by default, it uses the 5Hz timer). It is declared as follows:
static bool setup(TwoWire &wire = Wire,
const char *topic_raw = "/imu/raw",
const char *topic_temp = "/imu/temperature",
timer_descriptor &timer = micro_rosso::timer_report);
The module emits the following topics:
- raw imu: sensor_msgs/msg/imu)
- temperature: sensor_msgs/msg/temperature
jvisca@fing.edu.uy - Grupo MINA, Facultad de Ingeniería - Udelar, 2024
MIT