Ask Your Question
2

Roslaunch can't find my node

asked 2013-02-08 04:30:50 -0500

Claudio gravatar image

updated 2014-01-28 17:15:10 -0500

ngrennan gravatar image

FUERTE

I have a few machines correctly connected in ROS (core is able to ssh to them and launch nodes).

I'm writing a node which for now resides in my ROS workspace (/home/myuser/ROS_WORKSPACE). I'm able to manually launch the node and it works. However roslaunch can't find it, it shows its search paths are

[LabRob-Panda-01-0]: ERROR: cannot launch node of type [Saetta_Base/base]: Saetta_Base
ROS path [0]=/opt/ros/fuerte/share/ros
ROS path [1]=/opt/ros/fuerte/share
ROS path [2]=/opt/ros/fuerte/stacks

It's obviously missing my workspace path. The user which I use for the ssh connection is the same I use to check things and do stuff on the robots so its .bashrc is ok. I tried copying the node itself in the stacks folder, but I guess some of the code (which I'm slowly porting from the old hardware and application) tries to write on a file and segfaults badly.

So I tried forcing loading the user's own bashrc this way

<machine name="Panda01" address="LabRob-Panda-01" user="panda" default="false" env-loader="/home/panda/.bashrc" timeout="60" />

But this only gets this

launching remote roslaunch child with command: [env ROS_MASTER_URI=http://Sciame-Server:11311/ /home/panda/.bashrc roslaunch -c LabRob-Panda-01-0 -u http://Sciame-Server:36969/ --run_id 4b77a00a-75ed-11e2-b3b8-001d608763ac]
remote[LabRob-Panda-01-0]: ssh connection created
remote[LabRob-Panda-01-0]: env: /home/panda/.bashrc: Permission denied

So I created my own

/home/panda/rosenv.sh

but roslaunch can't find it.

Meanwhile using

env-loader="/opt/ros/fuerte/env.sh"

works correctly.

The solution happears to be the following: create an executable shell script in the user home folder on the remote machine. Something like rosenv.sh

sh /opt/ros/<distrib>/env.sh
export ROS_PACKAGE_PATH+=:/path1:/path2

Make it executable (chmod +x) and have your roslaunch refer to this new file in it's env loader

<machine name="MachineName" address="Address" user="user"  env-loader="/home/user/rosenv.sh" />

But roslaunch can't proceed if I use this script: meaning it freezes waiting for something on that remote machine. Reverting to /opt/ros/fuerte/env.sh allows roslaunch to proceed. So how can I get roslaunch to look in my workspace?

edit retag flag offensive close merge delete

Comments

Does it work after manually sourcing .bashrc after logging in?

dornhege gravatar image dornhege  ( 2013-02-08 04:52:08 -0500 )edit

I don't even have to source it, I just need to login with the same user I'm giving roslaunch, and it works.

This user has, in his home configuration, all the paths to the ros_workspace including the paths to the single projects. Somehow roslaunch doesn't inherit that.

Claudio gravatar image Claudio  ( 2013-02-08 05:57:00 -0500 )edit

Is it installed and built on the remote machine?

joq gravatar image joq  ( 2013-02-09 06:26:18 -0500 )edit

Joq the node is built on the remote machine, it's not "installed" as it is a devel version and moreover the remote machine is ARM so no real install packages are available.

Anyway the ros packages and stacks I downloaded and installed do work correctly (for example the hokuyo laser node).

Claudio gravatar image Claudio  ( 2013-02-09 23:20:22 -0500 )edit
1

Is it maybe just missing the node from the package path? According to http://ros.org/wiki/roslaunch/Architecture .bashrc, etc. are ignored.

dornhege gravatar image dornhege  ( 2013-02-11 05:09:42 -0500 )edit

So it is intentional not to allow workspace nodes to be launched by roslaunch? I'll wait for an insight before flagging yours as the correct answer.

Claudio gravatar image Claudio  ( 2013-02-12 00:26:15 -0500 )edit

I'd say it is not intentional to prevent workspace nodes. It is either an artifact from the way it is run via ssh, additionally requiring you to specify those things or intentionally disabled to make users aware of what setup is run on the remote machine. (You can still run workspace nodes).

dornhege gravatar image dornhege  ( 2013-02-12 01:12:15 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-02-09 08:56:35 -0500

lindzey gravatar image

I had a similar problem a while ago (IIRC, I was using Diamondback or Electric). The issue wound up being that the first line in the remote computer's .bashrc caused it to exit immediately if it wasn't an interactive shell, thus ignoring all the later export commands. Might something similar be going on for you?

edit flag offensive delete link more

Comments

Thanks for the idea, do you know how can I test this?

Claudio gravatar image Claudio  ( 2013-02-09 23:20:00 -0500 )edit
0

answered 2013-06-18 03:27:50 -0500

Philip gravatar image

updated 2013-06-18 03:32:20 -0500

I fiddled around with this issue as well: tried different ways to set up parameters when using ssh (.ssh/environment-file, ...), tried to load my configuration at different places, but to no avail.

My current working solution now looks like this:

  • As before, there is a shell script (named ros_conf.sh) in my ros-workspace (~/ros_workspace) that exports the ROS-variables of interest: ROS_IP, ROS_MASTER, ROS_PACKAGE_PATH, ...
  • In ~/.bashrc, the last two lines execute the ROS specific scripts (so interactive shells are fully usable with ROS):
source /opt/ros/fuerte/setup.bash
source ~/ros_workspace/ros_conf.sh
  • The file opt/ros/fuerte/env.sh executes both scripts:

#!/bin/sh

if [ $# -eq 0 ] ; then
    /bin/echo "Entering environment at /opt/ros/fuerte"
    . /opt/ros/fuerte/setup.sh
    . /home/MY_USERNAME/ros_workspace/ros_conf.sh
    $SHELL
    /bin/echo "Exiting build environment at /opt/ros/fuerte"
else
    . /opt/ros/fuerte/setup.sh
    . /home/MY_USERNAME/ros_workspace/ros_conf.sh
    exec "$@"
fi

Voila! Looks to be working until now :-)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-02-08 04:30:50 -0500

Seen: 4,893 times

Last updated: Jun 18 '13