關於ROS多機通訊的總結 1 1

2021-08-10 05:39:51 字數 953 閱讀 5457

以實現master和nico的互聯共享資訊為例

$ifconfig  檢視ip位址
可以看到

master的ip為192.168.1.10

nico的ip為192.168.1.103

這裡的master和nico為兩台機器的hostname

使用$hostname 指令可以檢視其引數,我們在這裡可以不使用ip位址,而是使用hostname.local代替機器的ip位址

通過$gedit ~/.bashrc 指令來設定

master中新增環境變數:

export ros_master_uri=

export ros_ip=master.local

nico中新增環境變數:

export  ros_master_uri=

export ros_ip=nico.local

若沒有這一步則在topic list中可以看到topic ,但是無法獲取其資料

$sudo gedit /etc/hosts
master的hosts檔案中新增   192.168

.1.103

nico

nico的hosts檔案中新增 192.168

.1.10

master

修改完hosts檔案後需要重啟網路

$sudo /etc/init.d/networking restart
在master上操作不方便的情況下,可以使用nico(自己的筆記本)遠端登陸到maser執行一些命令

$ssh [email protected]
登陸後輸入密碼即可進入master的終端進行操控,退出遠端操作按ctrl+z

關於ROS多機通訊的總結 1 0

先貼遠端操作的幾條常用命令,scp複製 scp local file remote username remote ip remote folder scp remote username remote ip remote folder local file 這兩條命令是類似的,解釋第一條,就是從本...

ROS多機通訊

在所有的計算機上,我們使用命令將其他計算機的ip位址加入到hosts中 sudo gedit etc hosts新增後記得ping一下是否能聯通。對於從機,我們需要使用ros master uri對主機位置進行定位,具體命令如下 export ros master uri http host pc ...

ROS多機通訊

假設需要讓電腦biowin和電腦biowin g3實現連線,並以biowin g3為主機 1.讓所有計算機需要通訊處於同一網路 2.將區域網位址繫結到主機名上 如 192.168.1.56 biowin 192.168.1.69 biowin g3ifconfig如果是有線連線的網路檢視eth0下的...