ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

[Solved]Can not launch a remote node from launch file

asked 2017-03-30 08:47:37 -0500

HeZlah gravatar image

updated 2017-04-04 09:31:47 -0500

EDIT: SOLVED

In .bashrc I had

export ROS_IP=`hostname -I`

which apparently puts a space after the IP. So that caused the IP and port to be split into two.


Hi all,

I am having troubles launching a remote node from a launch file. I have a raspberry pi based mobile robot, which runs a node responsible for setting velocities and publishing encoder odometer (wheel_motor_controller_node).

I would like to start this node from a launch file on my Ubuntu 16.04 machine. The launch file looks like this:

<launch>

<machine name="rosPi" address="192.168.1.32" env-loader="~/ch-bot_ws/devel/env.sh" user="pi" />

<param name="ch_bot_model" command="xacro '$(find ch_bot_description)/urdf/ch_bot.xacro'" />

<node machine="rosPi" pkg="ch_bot" name="wheel_motor_controller_node" type="wheel_motor_controller_node" />

</launch>

However I get a weird error, as if it is trying to pass the ssh port in as a launch file or something:

roslaunch ch_bot_description launch.launch
... logging to /home/hez/.ros/log/e4cd3d32-12ce-11e7-bad8-b827eb948adf/roslaunch-hez-VirtualBox-18713.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.

xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
started roslaunch server http://192.168.1.5 :39884/
remote[192.168.1.32-0] starting roslaunch
remote[192.168.1.32-0]: creating ssh connection to 192.168.1.32:22, user[pi]
/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://192.168.1.32:11311 ~/ch-bot_ws/devel/env.sh roslaunch -c 192.168.1.32-0 -u http://192.168.1.5 :39884/ --run_id e4cd3d32-12ce-11e7-bad8-b827eb948adf]
remote[192.168.1.32-0]: ssh connection created
remote[192.168.1.32-0]: [:39884/] is not a launch file name
The traceback for the exception was written to the log file

[192.168.1.32-0] killing on exit
remote roslaunch failed to launch: rosPi
The traceback for the exception was written to the log file

My env.sh looks like this:

#!/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. Inste$
  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 "$0"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh"
#. ~/ch-bot_ws/devel/setup.sh
exec "$@"

Note I tried replacing the entire env.sh with the commented line before the exec, just to make sure it was running the correct setup.

I think I have done something wrong in the launch file.. But I have no idea what. It seems to look like all of the examples and tutorials I have seen - albeit minimal.

Any help would be greatly ... (more)

edit retag flag offensive close merge delete

Comments

which apparently puts a space after the IP

I'm slightly confused, isn't that exactly what I wrote below?

gvdhoorn gravatar image gvdhoorn  ( 2017-04-04 10:33:10 -0500 )edit

Yes, it is exactly what you wrote and you lead me to my solution. Thank you! I solved it at the last minute before I went off on business and wrote the [solved] update to my post on mobile-- It was being a pain and would not let my mark your post as the correct answer. That is fixed now. Thanks!

HeZlah gravatar image HeZlah  ( 2017-04-05 07:36:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-03-30 10:44:22 -0500

gvdhoorn gravatar image
started roslaunch server http://192.168.1.5 :39884/

How did you set your ROS_IP? There is most likely a space between the 5 and :39884. As this is then used to form the command passed to SSH, we get

env ROS_MASTER_URI=http://192.168.1.32:11311 ~/ch-bot_ws/devel/env.sh roslaunch -c 192.168.1.32-0 -u http://192.168.1.5 :39884/ [..]

notice the space here again. The :39884/ is then interpreted as the launch file positional argument to roslaunch (as it's no longer part of the -u argument).

Also: env-loader="~/ch-bot_ws/devel/env.sh": it's recommended to use absolute paths only for env-loader scripts, as ~ would resolve to the home dir of the remote user, which requires you to mirror the exact same folder layout on your remote system. If you use absolute paths, the script could be anywhere.

edit flag offensive delete link more

Comments

This is absolutely correct, solution is edited into original post. And yes I would usually use (and am now) absolute paths. That path was just an artifact of my frustrated debugging.

Thanks for your help!

HeZlah gravatar image HeZlah  ( 2017-04-05 07:39:12 -0500 )edit

Question Tools

Stats

Asked: 2017-03-30 08:47:37 -0500

Seen: 1,047 times

Last updated: Apr 04 '17