rviz远程显示

问题描述:用gampping建图的过程中发现无法在my_computer上用rviz去读取雷达数据与map
问题实质:没有实现my_computer与robot_computer之间的通信(光靠ssh是行不通的)
解决办法:参考链接

README on getting RVIS to work over multiple computers

A common task is to SSH into the robot’s computer and run RVIZ to get the laser output and other visualization. Running RVIZ directly on the remote computer will not work due to the way RVIZ is implemented. The workaround is to run RVIZ locally. To do this we need to set the local computer to locate the remote MASTER NODE in order to display the right information.

Assume:
IP: 192.168.1.0 // remote computer (robot)
IP: 192.168.1.1 // local computer (host)

*** ssh into remote computer ***

  1. ssh -X erratic@192.168.1.0

At the remote terminal:
2. export ROS_MASTER_URI=http://192.168.1.0:11311 //this ensures that we do not use localhost, but the real IP address as master node

  1. export ROS_IP=192.168.1.0 //this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)

  2. roscore

At the local terminal:
5. export ROS_MASTER_URI=http://192.168.1.0:11311 //tells local computer to look for the remote here

  1. export ROS_IP=192.168.1.1 //this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)

  2. rosrun rviz rviz // fires up rviz on local computer. It will attach to the master node of the remote computer

** Note, everytime a new terminal is open on the local/remote computer, we have to call the 2 exports commands. To make this permanent, edit the ~/.bashrc file:
8. sudo gedit ~/.bashrc //add the two export commands at the end of the file.
9. source ~/.bashrc //and restart terminal

强调下,最好gedit ~/.bashrc,不然每个终端都要去输入export会很麻烦

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值