turtlebot3-burger_150.png
turtlebot3-waffle-pi_150.png
turtlebot3-arm_150.png
walking-y2_150.png
turbot3-multi_150.png
turbot3-dl-ros1_150.png
turbot3-ai.png
turbot3-dl-ros2_150.png
turbot3-slam_150.png
turbot3-arm_150.png
turtlebot4-lite_150.png
turtlebot4-pro_150.png
turbot4-dl_150.png
turbot4-ai_150.png
aidriving-racebot_150.png
aidriving-autodrive_150.png
turtlebot-arm_150.png
openmanipulator-x_150.png
Home » ROS2与传感器教程 » ros2与传感器-整合imu传感器bno055

ros2与传感器-整合imu传感器bno055

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号

ros2与传感器-整合imu传感器bno055

说明:

  • 介绍如何整合imu传感器bno055
  • 测试环境: ubuntu20.04 ros2 galactic 采用uart方式接bno055

BNO055简介

  • BNO055是BOSCH公司应用特定型ASSNs展品系列的新产品。
  • 是一款系统级封装(SiP)解决方案,集成了一个三轴14位加速度计,一个三轴16位陀螺仪,一个三轴地磁传感器和一个32位Cortex M0+微控制器。
  • 其封装尺寸只有3.8 x 5.2 x 1.13mm³,明显小于可比较的同级解决方案。
  • 通过将传感器和传感器融合功能集成到单个设备中,BNO055可以简化客户的集成过程,使其免受复杂的多供应产品的烦恼,从而使得他们可以花费更多时间在产品创新上。
  • 它是可穿戴,增强现实,个人健康,健身,室内导航和任何其他需要上下文感知的应用程序的完美选择。

步骤:

  • 源码安装
mkdir -p ~/ros2_common_ws/src
cd ~/ros2_common_ws/src
git clone https://gitee.com/ncnynl/bno055
cd ~/ros2_common_ws
colcon build --symlink-install
  • 配置端口
cd ~/ros2_common_ws/src/bno055/script
sudo ./create_udev_rules
  • 重插imu的USB线, 查看是否存在端口ls /dev/imu055

测试

  • 启动bno055
. ~/ros2_common_ws/install/local_setup.bash
ros2 launch bno055 bno055.launch.py
  • 查看话题如下
$ ros2 topic list
/bno055/calib_status
/bno055/imu
/bno055/imu_raw
/bno055/mag
/bno055/temp
/parameter_events
/rosout
  • 查看话题内容如下
$ ros2 topic echo /bno055/imu
-----------------
header:
  stamp:
    sec: 1646734954
    nanosec: 437958441
  frame_id: bno055
orientation:
  x: -0.7040389602526628
  y: -0.06475815663875814
  z: -0.07177718398414663
  w: 0.7035506800895053
orientation_covariance:
- 0.0159
- 0.0
- 0.0
- 0.0
- 0.0159
- 0.0
- 0.0
- 0.0
- 0.0159
angular_velocity:
  x: 0.0
  y: -0.0022222222222222222
  z: -0.0011111111111111111
angular_velocity_covariance:
- 0.04
- 0.0
- 0.0
- 0.0
- 0.04
- 0.0
- 0.0
- 0.0
- 0.04
linear_acceleration:
  x: -0.07
  y: -0.3
  z: -0.01
linear_acceleration_covariance:
- 0.017
- 0.0
- 0.0
- 0.0
- 0.017
- 0.0
- 0.0
- 0.0
- 0.017
---

通过rviz插件查看

  • 源码安装插件,这个目前只有基于ros2的eloquent版本,也可以在galactic下使用
  • 我们只需要rviz_imu_plugin,复制这个包到~/ros2_common_ws/src/再单独编译这个包
cd ~
git clone -b eloquent https://github.com/ccny-ros-pkg/imu_tools
cp -r ~/imu_tools/rviz_imu_plugin ~/ros2_common_ws/src/
cd ~/ros2_common_ws/
colcon build --symlink-install --packages-select=rviz_imu_plugin

测试

  • 新终端,启动imu
. ~/ros2_common_ws/install/local_setup.bash
ros2 launch bno055 bno055.launch.py
  • 新终端,启动rviz2
rviz2

  • 界面左下角点Add, 通过by display type 添加rviz_imu_plugin下的imu
  • 话题选择/bno055/imu, fixed frame输入bno055
  • 效果如图

请输入图片描述

  • 最终效果

请输入图片描述

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号


标签: ros2与传感器