Ubuntu 18.04 + ROS Melodic安裝xsens_ros_mti_driver

參考文獻:

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"

最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市芒澜,隨后出現(xiàn)的幾起案子仰剿,更是在濱河造成了極大的恐慌,老刑警劉巖痴晦,帶你破解...
    沈念sama閱讀 221,406評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件南吮,死亡現(xiàn)場離奇詭異,居然都是意外死亡誊酌,警方通過查閱死者的電腦和手機部凑,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,395評論 3 398
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來碧浊,“玉大人砚尽,你說我怎么就攤上這事』源剩” “怎么了必孤?”我有些...
    開封第一講書人閱讀 167,815評論 0 360
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經(jīng)常有香客問我敷搪,道長兴想,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,537評論 1 296
  • 正文 為了忘掉前任赡勘,我火速辦了婚禮嫂便,結果婚禮上,老公的妹妹穿的比我還像新娘闸与。我一直安慰自己毙替,他們只是感情好,可當我...
    茶點故事閱讀 68,536評論 6 397
  • 文/花漫 我一把揭開白布践樱。 她就那樣靜靜地躺著厂画,像睡著了一般。 火紅的嫁衣襯著肌膚如雪拷邢。 梳的紋絲不亂的頭發(fā)上袱院,一...
    開封第一講書人閱讀 52,184評論 1 308
  • 那天,我揣著相機與錄音瞭稼,去河邊找鬼忽洛。 笑死,一個胖子當著我的面吹牛环肘,可吹牛的內(nèi)容都是我干的欲虚。 我是一名探鬼主播,決...
    沈念sama閱讀 40,776評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼悔雹,長吁一口氣:“原來是場噩夢啊……” “哼苍在!你這毒婦竟也來了?” 一聲冷哼從身側響起荠商,我...
    開封第一講書人閱讀 39,668評論 0 276
  • 序言:老撾萬榮一對情侶失蹤寂恬,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后莱没,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體初肉,經(jīng)...
    沈念sama閱讀 46,212評論 1 319
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,299評論 3 340
  • 正文 我和宋清朗相戀三年饰躲,在試婚紗的時候發(fā)現(xiàn)自己被綠了牙咏。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,438評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡嘹裂,死狀恐怖妄壶,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情寄狼,我是刑警寧澤丁寄,帶...
    沈念sama閱讀 36,128評論 5 349
  • 正文 年R本政府宣布氨淌,位于F島的核電站,受9級特大地震影響伊磺,放射性物質發(fā)生泄漏盛正。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,807評論 3 333
  • 文/蒙蒙 一屑埋、第九天 我趴在偏房一處隱蔽的房頂上張望豪筝。 院中可真熱鬧,春花似錦摘能、人聲如沸续崖。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,279評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽严望。三九已至,卻和暖如春莺丑,著一層夾襖步出監(jiān)牢的瞬間著蟹,已是汗流浹背墩蔓。 一陣腳步聲響...
    開封第一講書人閱讀 33,395評論 1 272
  • 我被黑心中介騙來泰國打工梢莽, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人奸披。 一個月前我還...
    沈念sama閱讀 48,827評論 3 376
  • 正文 我出身青樓昏名,卻偏偏與公主長得像,于是被迫代替她去往敵國和親阵面。 傳聞我的和親對象是個殘疾皇子轻局,可洞房花燭夜當晚...
    茶點故事閱讀 45,446評論 2 359

推薦閱讀更多精彩內(nèi)容