Two computers, respectively, are P11 and p12, and the environment is Ubuntu16.04,launch code as follows
<launch>
<machine name= "P12" address= "P12" env-loader= "/home/nvidia/setup.sh" user= "nvidia"/>
<machine name= "P11" address= "P11" env-loader= "/home/nvidia/setup.sh" user= "nvidia,/> <node machine=
" P12 "Name=" Test_node "pkg=" projection "type=" Test_node "output=" screen ">
</node>
</launch>
On P12, the/home/nvidia/setup.sh:
#!/usr/bin/env bash
#export p11=192.168.10.37
#export p12=192.168.10.54
#export fangli0=192.168.10.42
Export ROS_IP=P12
export ros_master_uri=p11:11311
export roslaunch_ssh_unknown=1 export
ld_ Library_path=${ld_library_path}:/usr/lib
Export Pkg_config_path=${pkg_config_path}:/usr/local/lib/pkgconfig /
export ros_master_uri=http://p11:11311
#export ros_ip=192.168.10.54
export ROS_HOSTNAME=P12
# For Lanemarking_liuli
Export Ld_library_path=/home/nvidia/liuchao/local/lib:${ld_library_path}
#./home /nvidia/setup.sh
SOURCE/HOME/NVIDIA/.BASHRC
source/opt/ros/kinetic/setup.bash
source/home/ Nvidia/fangli/perception/code/perception_ros/devel/setup.bash
Exec "$@"
Attention please:
ROS has a flaw (feature?) in this it uses a library to so ssh, rather than the usual SSH client. This library does not support the default key algorithm used by the typical SSH client. This means so even though can SSH to the remote machine, ROS cannot, because the key algorithm isn ' t supported.
The fix is to-remove the stored key in ~/.ssh/known_hosts, then ssh again to the remote machine, specifying The-ohostkeya lgorithms= ' ssh-rsa ' command-line option to force the use of the ' the ' RSA algorithm. Once This is the "ROS can connect to" remote machine.
Http://answers.ros.org/question/244060/roslaunch-ssh-known_host-errors-cannot-launch-remote-nodes/?answer= 244064#post-id-244064