ros-roslaunch启动多台机器ros节点

两台电脑,分别为p11和p12,环境均为ubuntu16.04,launch代码如下

<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 that 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 that even though you 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 -oHostKeyAlgorithms=’ssh-rsa’ command-line option to force the use of the the RSA algorithm. Once this is done ROS can connect to the remote machine.
http://answers.ros.org/question/244060/roslaunch-ssh-known_host-errors-cannot-launch-remote-nodes/?answer=244064#post-id-244064

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值