Skip to content

qualcomm-qrb-ros/qrb_ros_imu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

QRB ROS IMU

Qualcomm QRB ROS

ROS Packages for IMU Hardware on Qualcomm Robotics Platforms

Qualcomm Ubuntu Jazzy


πŸ‘‹ Overview

The QRB ROS IMU is a ROS package that publishes IMU data collected from ICM-42688 hardware on the Qualcomm Robotics Platform. It provides:

architecture

The qrb_ros_imu is a ROS 2 package. It creates a publisher with qrb_ros_transport for zero-copy transport. It supports node composition, making it possible to improve performance using ROS intra-process communication.

The qrb_sensor_client is a C++ library, it provides APIs to qrb_ros_imu for querying imu data from lower layer Sensor Service.

The qrb_ros_transport is a ROS 2 package, it supports zero-copy implements ROS type adaptation to the sensor data structures defined by Android, make it compatible with both intra- and inter-process communication.

The Sensor Service is Qualcomm sensor framework, it exports APIs for accessing Qualcomm-powered device 's IMU hardware.

The ISession Framework provides the foundation for sensor data collecting on Qualcomm-powered devices.

πŸ”Ž Table of contents

βš“ APIs

πŸ”Ή qrb_ros_imu APIs

ROS interfaces

Interface Name Type Description
Publisher /imu sensor_msgs/msg/Imu output imu data

ROS parameters

Name Type Description Default Value
debug bool To measure the latency from IMU data generation to its output by the ROS node. false

πŸ”Ή qrb_sensor_client APIs

Function Parameters Description
bool create_connection() Empty Connect with sensor service, return true means create successfully.
void disconnect_server() Empty Disconnect with sensor service.
bool get_imu_data(sensors_event_t ** accel_ptr, sensors_event_t ** gyro_ptr, int32_t * sample_count)
  • accel_ptr: Pointer to accelerometer data
  • gyro_ptr: Pointer to gyroscope data
  • sample_count: Number of samples available
Retrieves IMU data. Returns true if successful. If true, accel_ptr and gyro_ptr will point to the latest IMU data, and sample_count specifies how many samples were retrieved.

🎯 Supported targets

Development Hardware Qualcomm Dragonwingβ„’ RB3 Gen2
Hardware Overview
IMU Hardware ICM-42688

✨ Installation

Important

PREREQUISITES: The following steps need to be run on Qualcomm Ubuntu and ROS Jazzy.
Reference Install Ubuntu on Qualcomm IoT Platforms and Install ROS Jazzy to setup environment.
For Qualcomm Linux, please check out the Qualcomm Intelligent Robotics Product SDK documents.

Add Qualcomm IOT PPA for Ubuntu:

sudo add-apt-repository ppa:ubuntu-qcom-iot/qcom-noble-ppa
sudo add-apt-repository ppa:ubuntu-qcom-iot/qirp
sudo apt update

Install Debian package:

sudo apt install ros-jazzy-qrb-ros-imu

πŸš€ Usage

Start the imu node

source /opt/ros/jazzy/setup.bash
ros2 run qrb_ros_imu imu_node

The output for these commands:

[INFO] [0315964882.610733770] [imu_node]: imu client connect success
[INFO] [0315964882.614361843] [imu_node]: imu component running...
[INFO] [SensorClient]: sensor client recv from msg. User set sample_rate: 200 adjusted sample_rate: 200 len: 8
[INFO] [SensorClient]: send get config success
[INFO] [SensorClient]: recvmsg success
...

Then you can check ROS topics with the topic /imu.

ros2 topic list
/imu

Enable zero copy transport

The qrb_ros_imu supports directly sharing imu data between nodes, which can avoid imu data memory copy with DDS in intra-process mode.

For detail about this feature, see https://docs.ros.org/en/rolling/Concepts/Intermediate/About-Composition.html

We recommend using launch to compose multiple nodes:

def generate_launch_description():
    container = ComposableNodeContainer(
        name='my_container',
        namespace='',
        package='rclcpp_components',
        executable='component_container',
        composable_node_descriptions=[
            ComposableNode(
                name='imu',
                package='qrb_ros_imu',
                plugin='qrb_ros::imu::ImuComponent'
            ),
            ComposableNode(
                package='qrb_ros_imu',
                plugin='qrb_ros::imu::ImuListener',
                name='imu_test',
            )
        ],
        output='screen',
    )

    return launch.LaunchDescription([container])

Change the imu frequency

To change the IMU sampling frequency:

  1. Edit the /etc/sensors_info.conf file and set the desired frame rate to sample_rate.
imu:
  sample_rate: 200
  1. Restart the sensor-service(a systemd service) to apply the changes.
sudo systemctl restart sensor-service

Note

⚠️ Make sure to set the frame rate according to the actual supported values of your IMU hardware. If you choose an unsupported value, the system will automatically adjust it to the nearest available frequency.


πŸ‘¨β€πŸ’» Build from source

Install dependencies

sudo apt install ros-jazzy-qrb-ros-transport-imu-type

Download the source code and build with colcon

source /opt/ros/jazzy/setup.bash
git clone https://github.com/qualcomm-qrb-ros/qrb_ros_imu.git
colcon build

Run and debug

source install/setup.bash
ros2 run qrb_ros_imu imu_node

🀝 Contributing

We love community contributions! Get started by reading our CONTRIBUTING.md.
Feel free to create an issue for bug report, feature requests or any discussionπŸ’‘.

❀️ Contributors

Thanks to all our contributors who have helped make this project better!

quic-zhanlin
quic-zhanlin
jiaxshi
jiaxshi
quic-zhaoyuan
quic-zhaoyuan
penww
penww

❔ FAQs

Why do I see the error: "IMU client connect failed"?
  • Please ensure that the IMU frame rate configured in /etc/sensors_info.conf is set within the range of 0–500.
Why is the configured frame rate sometimes different from the actual frame rate?
  • The IMU hardware only supports certain fixed frame rates.
  • If you specify a frame rate that is not supported, the system will automatically round up to the nearest higher supported value.

πŸ“œ License

Project is licensed under the BSD-3-Clause License. See LICENSE for the full license text.

About

qrb_ros_imu is a package to publish the imu data from sensor service.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 5