參考文獻:
https://blog.csdn.net/i_robots/article/details/107193385
https://zhuanlan.zhihu.com/p/385671094
更新時間:2021-11-23
聯(lián)系人:support@xsens.com
前提:已經(jīng)安裝好ROS Melodic并且下載了MT Software Suite
MT Software Suite下載地址:https://content.xsens.com/mt-software-suite-download
運行:
sudo ./mtsdk_linux-x64_2021.4.sh
結果:
安裝sharutils:
運行:
sudo apt-get update -y
sudo apt-get install -y sharutils
重新運行:
sudo ./mtsdk_linux-x64_2021.4.sh
結果:
文件瀏覽器中可以看到:
安裝完成后將xsens_mti_driver文件夾移動到catkinworkspace src文件夾中(這個文件夾看你自己的工作空間定義,我的在~/catkin_ws/src/下)。
運行:
cd /usr/local/xsens
cp -r xsens_ros_mti_driver/ ~/catkin_ws/src/
需要進行修改文件夾權限堂油,應該也可以不修改,給others用戶組添加權限r(nóng)w
sudo chmod -R o+rw xsens_ros_mti_driver/
確定成功之后可以進行make命令傻咖,這里使用了目錄棧指令罢维,把目錄換成自己的工作空間就可以了旷余,我的是~/catkin_ws/src/xsens_ros_mti_driver/lib/xspublic
也可以自己手動cd然后make,查看當前目錄椶瓤郏可以使用dirs -v命令薪鹦。
popd就是目錄出棧,pushd就是目錄入棧惯豆,當前目錄==棧頂目錄距芬。
————————————————————————————————————————————————
Cd回到根目錄,然后cd進入 ~/catkin_ws
運行:
cd ~/catkin_ws
pushd src/xsens_ros_mti_driver/lib/xspublic && make && popd
構建驅動包循帐,在自己的ROS工作空間使用命令
catkin_make
然后在新的窗口啟動roscore
roscore
注意進行l(wèi)aunch節(jié)點時需要在工作空間目錄進行source
$ cd ~/catkin_ws/
$ source ./devel/setup.bash
可以運行兩個launch文件框仔,一個用于rviz顯示,一個用于MTI系列產(chǎn)品發(fā)送消息
roslaunch xsens_mti_driver xsens_mti_node.launch
roslaunch xsens_mti_driver display.launch
結果:
根據(jù)說明文檔拄养,此問題出現(xiàn)的原因可能是用戶不在dialout組中离斩,需要添加到組,并且重啟設備:
運行:
ls -l /dev/ttyUSB0
groups
sudo usermod -G dialout -a $USER
newgrp dialout
重啟虛擬機
重新輸入
$ cd ~/catkin_ws/
$ source ./devel/setup.bash
然后:
roslaunch xsens_mti_driver xsens_mti_node.launch
如果沒有數(shù)據(jù)出現(xiàn)瘪匿,請再次確認你在MTManager的傳感器配置中將Orientation欄設為了Quaternion:
設置方法:
在MTManager中:
點擊左上角:device settings
然后在outputconfiguration選項卡跛梗,Orientation(姿態(tài))選擇Quaternion(四元數(shù)),點擊“Apply"應用棋弥,然后關閉MTManager核偿, 重新啟動ROS
附件:
以下文件為xsens_ros_mti_driver文件夾下面的 READ.me文件:
=============== [ Xsens MTi driver for ROS]===========================================
文檔:
You can find the fulldocumentation in "/doc/xsensdeviceapi/doc/html/index.html"under "ROS MTi driver" section.
您可以在“ROS MTi驅動程序”部分下的“<您的MT SDK目錄>/doc/xsensdeviceapi/doc/html/index.html”中找到完整文檔。
Prerequisites先決條件::
? ? - ROS Kinetic orMelodic
? ? - C/C++ Compiler:GCC 5.4.0 or MSVC 14.0
? ? - C++11
Building:
- Copy xsens_ros_mti_driver folder from your MT SDK directory into your catkin workspace 'src' folder.
將xsens_ros_mti_driver文件夾從您的MT SDK目錄復制到您的catkin工作區(qū)“src”文件夾中顽染。
? ? ? ? Make sure the permissions are set to o+rw on your files and directories.
確保您的文件和目錄的權限設置為o+rw漾岳。
- Build xspublic from your catkin workspace:
從您的catkin工作區(qū)構建xspublic:
? ? ? ? $ pushd src/xsens_ros_mti_driver/lib/xspublic && make && popd
- Build Xsens MTi driver package:
構建Xsens MTi驅動程序包:
? ? ? ? $ catkin_make
- Source workspace:
源工作區(qū):
? ? ? ? $ source devel/setup.bash
Running:
- Configure your MTi device tooutput desired data (e.g. for display example -orientationoutput)
配置您的MTi設備以輸出所需的數(shù)據(jù)(例如,顯示示例 –姿態(tài)輸出)
- Launch the Xsens MTi driver from your catkin workspace:
從您的catkin工作區(qū)啟動Xsens MTi驅動程序:
? ? ? ? ? ? $roslaunch xsens_mti_driver xsens_mti_node.launch
? ? ? ? After the device has been detected, you can communicate with it from another process /terminal window.
檢測到設備后粉寞,您可以從另一個進程/終端窗口與其通信尼荆。
? ? ? ? For example:
? ? ? ? ? ? $ rostopic echo /filter/quaternion
? ? ? ? This will result in a continuous stream of data output:
這將產(chǎn)生連續(xù)的數(shù)據(jù)輸出流:
? ? ? ? ? ? ---
? ? ? ? ? ? header:
? ? ? ? ? ? ? seq:1386351
? ? ? ? ? ? ? stamp:
? ? ? ? ? ? ? ? secs:1545223809
? ? ? ? ? ? ? ? nsecs:197252179
? ? ? ? ? ? frame_id: "imu_link"
? ? ? ? ? quaternion:
? ? ? ? ? ? ? x:0.00276306713931
? ? ? ? ? ? ? y:0.00036825647112
? ? ? ? ? ? ? z:-0.89693570137
? ? ? ? ? ? ? w:-0.442152231932
? ? ? ? ? ? ---
- There is also an example that shows a 3D visualization of the device (orientation data should be enabled in the device):
還有一個示例顯示了設備的3D可視化(應在設備中啟用姿態(tài)數(shù)據(jù)):
? ? ? ? ? ? $roslaunch xsens_mti_driver display.launch
Notes:
? ? - ROS timestamps
The data messages from devices are time stamped on arrival in the ROS driver.
來自設備的數(shù)據(jù)消息在到達ROS驅動程序時帶有時間戳。
When collecting data at higher rates, eg 100 Hz, the timesbetween reads can differ from the configured output rate in the device.
當以更高的速率(例如100 Hz)收集數(shù)據(jù)時唧垦,讀取之間的時間可能與設備中配置的輸出速率不同捅儒。
This is caused by possible buffering in the USB/FTDI driver.
這是由USB/FTDI驅動程序中可能存在的緩沖引起的。
? ? ? ? For instance:
? ? ? ? 10 us, 10 us,10 us, 45 ms, 10 us, 10 us, 10 us, 39 ms, 10 us, etc.
? ? ? ? instead of
? ? ? ? 10 ms, 10 ms,10 ms, 10 ms, 10 ms, 10 ms, 10 ms, 10 ms, 10 ms, etc.
? ? ? ? Work-around:for accurate and stable time stamp information, users can make use of thesensor reported time stamp (/imu/time_ref) instead.
解決方法:為了獲得準確和穩(wěn)定的時間戳信息,用戶可以改用傳感器報告的時間戳(/imu/time_ref)巧还。
---------------------------- [ Troubleshooting常見問題]------------------------------------------------------------
問題1:
-The Mti1 (Motion Tracker Development Board) is not recognized.
無法識別Mti1(慣性傳感器開發(fā)板)鞭莽。
? ? ? ? Support for the Development Board is present in recent kernels. (Since June 12, 2015).
? ? ? ? If your kernel does not support the Board, you can add this manually
最近的內(nèi)核中提供了對開發(fā)板的支持。 (自2015年6月12日起)麸祷。
如果你的內(nèi)核不支持Board澎怒,你可以手動添加:
? ? ? ? $ sudo /sbin/modprobe ftdi_sio
? ? ? ? $ echo 2639 0300 | sudo tee /sys/bus/usb-serial/drivers/ftdi_sio/new_id
問題2:
- The device is recognized, but I cannot ever access the device –
-該設備已被識別,但我無法訪問該設備-
? ? ? ? Make sure you are in the correct group (often dialout or uucp) in order to access the device. You can test this with
確保您在正確的組中(通常是dialout或uucp)以便訪問設備摇锋。 你可以用:
? ? ? ? ? ? $ ls -l /dev/ttyUSB0
? ? ? ? ? ? crw-rw----1 root dialout 188, 0 May? 6 16:21/dev/ttyUSB0
? ? ? ? ? ? $ groups
? ? ? ? ? ? dialout audio video usb users plugdev
? ? ? ? If you aren't in the correct group, you can fix this in two ways.
如果您不在正確的組中,可以通過兩種方式解決此問題站超。
? ? ? ? 1. Add yourself to the correct group將自己添加到正確的組
? ? ? ? ? ? You can add yourself to it by using your distributions user management tool, orcall
您可以使用您的發(fā)行版用戶管理工具將自己添加到其中荸恕,或調(diào)用:
? ? ? ? ? ? ? ? $ sudo usermod -G dialout -a $USER
? ? ? ? ? ? Be sure to replace dialout with the actual group name if it is different.After adding yourself to the group, either relogin to your
? ? ? ? ? ? user, or call
如果實際組名不同,請務必將dialout替換為實際組名死相。 將自己添加到組后融求,重新登錄到您的用戶(或重啟設備),或調(diào)用:
? ? ? ? ? ? ? ? $newgrp dialout
to add the current terminal session to the group.
將當前終端會話添加到組中算撮。
? ? ? ? 2. Use udev rules
使用udev規(guī)則
? ? ? ? ? Alternatively, put the following rule into/etc/udev/rules.d/99-custom.rules
或者生宛,將以下規(guī)則放入/etc/udev/rules.d/99-custom.rules
? ? ? ? ? ? ? SUBSYSTEM=="tty", ATTRS{idVendor}=="2639",ACTION=="add", GROUP="$GROUP", MODE="0660"
? ? ? ? ? ? Change $GROUP into your desired group (e.g. adm, plugdev, or usb).
將$GROUP更改為您想要的組(例如adm、plugdev或usb)肮柜。
問題3:
? ? ? ? ? ? ? - The device is inaccessible for a while after plugging it in –
插入設備后一段時間無法訪問
When having problems with the device being busy the first 20 seconds after plugin, purge the modem manager application.
如果在插入后的前20秒內(nèi)遇到設備繁忙的問題陷舅,請清除modem manager應用程序。
問題4:
- RViz doesn't show an MTi model.
RViz不顯示MTi模型审洞。
? ? ? ? It is a known issue with urdfdom in ROS Melodic. A workaround is to unset/modify theLC_NUMERIC environment variable:
這是ROSMelodic中urdfdom的一個已知問題莱睁。 解決方法是取消設置/修改LC_NUMERIC環(huán)境變量:
? ? ? ? $LC_NUMERIC="en_US.UTF-8"