ROS多机找不到文件

ROS multiple machine not finding files

当尝试使用启动文件在两台不同的机器上启动 ROS 节点时,远程 PC 找不到我要启动的文件。我还在两台机器上安装了这两个软件包以进行测试。这些文件可以在两台 PC 上启动,但是当我尝试远程启动它们时,找不到它们。

我看了很多其他人在两台机器上使用 ROS,但我似乎找不到解决这个问题的方法。任何 suggestions/help 表示赞赏。下面列出了所有必需的文件。

编辑:我尝试在远程 PC 上启动 turtlesim teleop 节点,这是 ROS 中的本地节点。这没有问题,所以问题出在定制节点上。

主启动文件

<launch>
  <include file="$(find r18dv_tf_publisher)/hosts/hosts.machine" />
  <node machine="tegra_a" pkg="r18dv_tf_publisher" type="tf_broadcaster" name="tf_broadcaster" />
  <node machine="tegra_b" pkg="r18dv_simple_heading_controller" type="r18dv_simple_heading_controller_node" name="heading_controller" output="screen" />

</launch>

hosts.machine

<launch>
  <machine name="tegra_a" address="10.42.0.28" env-loader="/opt/ros/kinetic/env.sh" />
  <machine name="tegra_b" address="10.42.0.29" env-loader="/opt/ros/kinetic/env.sh" />
</launch>

两台机器上的文件结构相同,两个 env.sh 文件位于同一位置。

env.sh 在 tegra_a

#!/usr/bin/env sh
# generated from catkin/cmake/templates/env.sh.in

if [ $# -eq 0 ] ; then
  /bin/echo "Usage: env.sh COMMANDS"
  /bin/echo "Calling env.sh without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually."
  exit 1
fi

# ensure to not use different shell type which was set before
CATKIN_SHELL=sh

# source setup.sh from same directory as this file
_CATKIN_SETUP_DIR=$(cd "`dirname "[=12=]"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh"

export ROS_WS=/home/nvidia/catkin_ws
export ROS_KINETIC=/etc/ros/kinetic
source $ROS_WS/devel/setup.bash
source $ROS_KINETIC/setup.bash
export PATH=$ROS_ROOT/bin:$PATH
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$ROS_WS
export ROS_MASTER_URI=http://10.42.0.28:11311/
export ROS_HOSTNAME=10.42.0.28
exec "$@"

env.sh 在 tegra_b

#!/usr/bin/env sh
# generated from catkin/cmake/templates/env.sh.in

if [ $# -eq 0 ] ; then
  /bin/echo "Usage: env.sh COMMANDS"
  /bin/echo "Calling env.sh without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually."
  exit 1
fi

# ensure to not use different shell type which was set before
CATKIN_SHELL=sh

# source setup.sh from same directory as this file
_CATKIN_SETUP_DIR=$(cd "`dirname "[=13=]"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh"

export ROS_WS=/home/nvidia/catkin_ws
export ROS_KINETIC=/etc/ros/kinetic
source $ROS_WS/devel/setup.bash
source $ROS_KINETIC/setup.bash
export PATH=$ROS_ROOT/bin:$PATH
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$ROS_WS
export ROS_MASTER_URI=http://10.42.0.28:11311/
export ROS_HOSTNAME=10.42.0.29
exec "$@"

启动启动文件时的输出

nvidia@nvidia:/opt/ros/kinetic$ roslaunch r18dv_tf_publisher test_launch.launch 
... logging to /home/nvidia/.ros/log/3dfcc3a4-fba0-11e7-8f39-00044b8da45f/roslaunch-nvidia-8089.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://10.42.0.28:33233/
remote[10.42.0.29-0] starting roslaunch
remote[10.42.0.29-0]: creating ssh connection to 10.42.0.29:22
/usr/lib/python2.7/dist-packages/Crypto/Cipher/blockalgo.py:141: FutureWarning: CTR mode needs counter parameter, not IV
  self._cipher = factory.new(key, *args, **kwargs)
launching remote roslaunch child with command: [env ROS_MASTER_URI=http://10.42.0.28:11311/ /opt/ros/kinetic/env.sh roslaunch -c 10.42.0.29-0 -u http://10.42.0.28:33233/ --run_id 3dfcc3a4-fba0-11e7-8f39-00044b8da45f]
remote[10.42.0.29-0]: ssh connection created

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.12

MACHINES
 * tegra_a
 * tegra_b

NODES
  /
    heading_controller (r18dv_simple_heading_controller/r18dv_simple_heading_controller_node)
    tf_broadcaster (r18dv_tf_publisher/tf_broadcaster)

auto-starting new master
process[master]: started with pid [8104]
ROS_MASTER_URI=http://10.42.0.28:11311/

setting /run_id to 3dfcc3a4-fba0-11e7-8f39-00044b8da45f
process[rosout-1]: started with pid [8117]
started core service [/rosout]
process[tf_broadcaster-2]: started with pid [8128]
[10.42.0.29-0]: launching nodes...
[10.42.0.29-0]: ROS_MASTER_URI=http://10.42.0.28:11311/
[10.42.0.29-0]: ERROR: cannot launch node of type [r18dv_simple_heading_controller/r18dv_simple_heading_controller_node]: can't locate node [r18dv_simple_heading_controller_node] in package [r18dv_simple_heading_controller]
[10.42.0.29-0]: ... done launching nodes

我自己找到了解决方案。我把它贴在 ROS 的答案论坛上:https://answers.ros.org/question/280193/files-not-found-when-launching-from-remote-pc/