The QRB ROS IMU is a ROS package that publishes IMU data collected from ICM-42688 hardware on the Qualcomm Robotics Platform. It provides:
- Composable ROS Node support.
- Zero-Copy transport powered by QRB ROS Transport.
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.
Interface | Name | Type | Description |
---|---|---|---|
Publisher | /imu | sensor_msgs/msg/Imu | output imu data |
Name | Type | Description | Default Value |
---|---|---|---|
debug | bool | To measure the latency from IMU data generation to its output by the ROS node. | false |
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) |
|
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. |
Development Hardware | Qualcomm Dragonwingβ’ RB3 Gen2 |
---|---|
Hardware Overview | |
IMU Hardware | ICM-42688 |
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
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
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])
To change the IMU sampling frequency:
- Edit the
/etc/sensors_info.conf
file and set the desired frame rate tosample_rate
.
imu:
sample_rate: 200
- Restart the
sensor-service
(a systemd service) to apply the changes.
sudo systemctl restart sensor-service
Note
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
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π‘.
Thanks to all our contributors who have helped make this project better!
quic-zhanlin |
jiaxshi |
quic-zhaoyuan |
penww |
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.
Project is licensed under the BSD-3-Clause License. See LICENSE for the full license text.