LPMS-CU2 IMU在 Nvidia Xavier安装配置
发布日期:2021-10-03 22:59:20 浏览次数:30 分类:技术文章

本文共 3198 字,大约阅读时间需要 10 分钟。

LPMS-CU2 是一种小型惯性测量单元(IMU)/姿态航向参考系统(AHRS)。在ROS中使用此款IMU时,需要进行相关的安装和配置, 具体可以参考

 

1 依赖

  1. 编译此ROS包需要G++ version>= 7.0, cmake version >= 3.10. 如果编译器低于此版本,则需要升级到最新版本,并运行如下命令:

catkin_make -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7

 

2)使用USB接口时,需要用户有访问/dev/ttyUSB 设备的权限,把用户加到dialout组就可以:

sudo adduser <username> dialout

 

2 编译安装

mkdir -p catskin_ws/src

cd catskin_ws/src

 

git clone --recurse-submodules https://bitbucket.org/lpresearch/openzenros.git

 

# get your ROS environment going

source /opt/ros/melodic/setup.bash

cd ..

catkin_make

source ./devel/setup.bash

 

3 配置和运行

参见

 

简单的,可以使用如下命令启动:

rosrun openzen_sensor openzen_sensor_node _sensor_name:="LPMSCU2000573"

 

如何确定_sensor_name呢?

在电脑上插入IMU的USB口后,运行命令dmesg,可以看到如下输出:

[ 1994.060806] usb 1-2.3: new full-speed USB device number 7 using tegra-xusb

[ 1994.112317] usb 1-2.3: New USB device found, idVendor=10c4, idProduct=ea61

[ 1994.112330] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[ 1994.112337] usb 1-2.3: Product: CP2102 USB to UART Bridge Controller

[ 1994.112343] usb 1-2.3: Manufacturer: Silicon Labs

[ 1994.112348] usb 1-2.3: SerialNumber: LPMSCU2001018

[ 1994.121625] cp210x 1-2.3:1.0: cp210x converter detected

[ 1994.123370] usb 1-2.3: cp210x converter now attached to ttyUSB2

其中的SerialNumber: LPMSCU2001018就是sensor name。

 

3.1配置参数

~sensor_name (string, default: null)

By default, the library will connect to the first available sensor. If you want to connect to a specific sensor, you can use the serial name of the sensor as sensor_name parameter as follow:

 

$ rosrun openzen_sensor openzen_sensor_node _sensor_name:=”LPMSCU2000573”

 

~sensor_interface (string, default: LinuxDevice)

Name of IO system for initiating sensor connection. Use “LinuxDevice” for usb connection in Linux. For more details, please check the documentation in the section IO Systems.

 

~baudrate (integer, default: 0)

Baudrate in bits per seconds used to connect to the sensor. If the baudrate is left at 0, OpenZen will automatically pick the default baudrate for the respective sensor model.

 

~frame_id (string, default: imu)

The frame in which imu readings will be returned

3.2 发布的topic

/imu/data (sensor_msgs/Imu)

Inertial data from the IMU. Includes calibrated acceleration, calibrated angular rates and orientation. The orientation is always unit quaternion.

 

/imu/mag (sensor_msgs/MagneticField)

Magnetometer reading from the sensor.

 

/imu/is_autocalibration_active (std_msgs/Bool)

Latched topic indicating if the gyro autocalibration feature is active

3.3 launch 文件

创建文件:openzen_cu2.launch 

<launch>

    <!-- cu2 Sensor node -->

    <node name="zen_node" pkg="openzen_sensor" type="openzen_sensor_node" output="screen" respawn="true">

        <param name="sensor_name"         type="string"  value="LPMSCU2001018"/>  

        <param name="sensor_interface"    type="string"  value="LinuxDevice"/>

        <param name="frame_id"            type="string"  value="imu_base"/>

        <param name="baudrate"            value="0"/>

        <remap from="imu/data" to="imu"/>

    </node>

    <node pkg="tf" type="static_transform_publisher" name="imu_broadcaster" args="0 0 0 0 0 0 base_footprint imu_base 100" respawn="true" />    

</launch>

 

因为openzen默认发布的topic/imu/data, 我们需要的是/imu, 所以这里使用remaptopic的名字做一个映射。

Linux下,"sensor_interface"的值为"LinuxDevice"

转载地址:https://blog.csdn.net/lclfans1983/article/details/107256025 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Cartographer ROS上的编译安装和配置
下一篇:Nvidia Xavier(ARM64)上安装openresty

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年04月23日 02时43分41秒