In either case, VNC or forwarding X is probably not the best way to work with rviz remotely. A much better plan would be to follow the directions on NetworkSetup to get your computer connected to the robot's rosmaster (setting the ROS_MASTER_URI and ROS_IP for both machines is what I do instead of setting up DNS). This way, you can run rviz locally on your computer, only sending ROS data across the network instead of forwarding X or VNC, both of which I found to be quite slow when working with a 3D application like rviz.
可以多机器ros,rviz运行在本地!!
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.
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
3. export ROS_IP=192.168.1.0 //this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)
4. roscore
At the local terminal:
1. export ROS_MASTER_URI=http://192.168.1.0:11311 //tells local computer to look for the remote here
2. export ROS_IP=192.168.1.1 //this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)
3. rosrun rviz rviz // fires up rviz on local computer. It will attach to the master node of the remote computer
** to check, open a remote terminal **
1. rxgraph
** 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:
1. sudo gedit ~/.bashrc //add the two export commands at the end of the file.
2. source ~/.bashrc //and restart terminal