micro-ROS / micro-ROS/micro_ros_arduino

MicroRos does not publish imu data in higher rates

Open
#1,781 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
576
Forks
146
PR merge metrics
No merged PRs in 30d

Description

## Issue template

- I am working on ESP32 WROOM 32
- RTOS: It is running on (PC) linux ubuntu 20.04.6 LTS via
- Installation type: Arduino micro_ros_arduino library
- Version or commit hash: ROS2 galactic

#### Steps to reproduce the issue
I am using "Bolder Flight Systems MPU9250" library to read MPU9250 imu data. I created a imu publisher and message type was sensor_msgs/msg/imu. The sensor normally can run in 200 hz rate. I configured the timer callback for 200 hz, so timer_timeout was 5 ms and I used RCL_MS_TO_NS function to convert it nanoseconds. I used "rclc_publisher_init_best_effort" while creating the publisher and it spinned 1ms via "RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(1)))". I updated the imu data and assigned imu data to imu publisher messages in the timer callback. I also published in the timer callback.

#### Expected behavior
I expected 200 hz publisher rate.

#### Actual behavior
It is published in approximately 34 Hz when i checked with "ros2 topic hz /imu_data"

#### Additional information

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the Arduino micro_ros_arduino library on an ESP32 WROOM 32, using the rclc timer callback, rclc_publisher_init_best_effort, and rclc_executor_spin_some calls described. Measure /imu_data with ros2 topic hz and compare the result with the configured 200 Hz timer; done means the cause of the approximately 34 Hz rate is identified and the expected rate is reached or documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, c, ubuntu
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.