ROSLaunch not working
I am using ROS Jade on Ubuntu 14.04.
My ROS setup has been working fine, but I recently installed java as required for the openni installation, and installed the openni along with files needed for the kinect camera. Now I have a particular launch file that errors with message of not being able to find the nodes. Here is the output from the launch file:
... logging to /home/billy/.ros/log/17d5e0de-1c3a-11e7-8d67-100ba9588b18/roslaunch-billy-ThinkPad-T420-4123.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://billy-ThinkPad-T420:44143/
SUMMARY
========
PARAMETERS
* /rosdistro: jade
* /rosversion: 1.11.20
* /xv_11_node/message_logging: 0
* /xv_11_node/port: /dev/ttyUSB0
NODES
/
base_link_to_laser_and_imu (robot_setup_tf/tf_broadcaster)
cmd_publisher (cmd_publisher/cmd_publisher)
robot_state_machine (robot_state_machine/robot_state_machine)
serial_port_sender (serial_port_sender/serial_port_sender)
xv_11_node (xv_11_laser_driver/neato_laser_publisher)
ROS_MASTER_URI=http://localhost:11311
core service [/rosout] found
ERROR: cannot launch node of type [xv_11_laser_driver/neato_laser_publisher]: can't locate node [neato_laser_publisher] in package [xv_11_laser_driver]
ERROR: cannot launch node of type [robot_setup_tf/tf_broadcaster]: can't locate node [tf_broadcaster] in package [robot_setup_tf]
ERROR: cannot launch node of type [cmd_publisher/cmd_publisher]: can't locate node [cmd_publisher] in package [cmd_publisher]
ERROR: cannot launch node of type [serial_port_sender/serial_port_sender]: can't locate node [serial_port_sender] in package [serial_port_sender]
ERROR: cannot launch node of type [robot_state_machine/robot_state_machine]: can't locate node [robot_state_machine] in package [robot_state_machine]
No processes to monitor
shutting down processing monitor...
... shutting down processing monitor complete
I have properly sourced devel/setup.bash. I have deleted the entire build and devel folders and remade them using catkin_make.
The packages are found using rospack find
billy@billy-ThinkPad-T420:~/catkin_ws$ rospack find serial_port_sender
/home/billy/catkin_ws/src/serial_port_sender
I have verified the build folder has the files after making.
Each of the nodes called in this launch is complied from source (these are my nodes). The launch file for launching the navigation stack is the same folder as this laucnh file and it works as usual.
I have verified the ROSPACKAGEPATH is correct:
billy@billy-ThinkPad-T420:~/catkin_ws$ echo $ROS_PACKAGE_PATH
/home/billy/catkin_ws:/home/catkin_ws:/opt/ros/jade/share:/opt/ros/jade/stacks
The detailed message from the log file may help you understand but I wasn't able to get anything useful from it:
[roslaunch][INFO] 2017-04-08 02:06:59,005: ... preparing to launch node of type [robot_setup_tf/tf_broadcaster]
[roslaunch][INFO] 2017-04-08 02:06:59,005: create_node_process: package[robot_setup_tf] type[tf_broadcaster] machine[Machine(name[] env_loader[None] address[localhost] ssh_port[22] user[None] assignable[True] timeout[10.0])] master_uri[http://localhost:11311]
[roslaunch][INFO] 2017-04-08 02:06:59,006: process[base_link_to_laser_and_imu-2]: env[{'WINDOWID': '62918866', 'QT_QPA_PLATFORMTHEME': 'appmenu-qt5', 'ROS_DISTRO': 'jade', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/billy', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'UPSTART_EVENTS': 'started starting', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'ROSLISP_PACKAGE_DIRECTORIES': '', 'CPATH': '/opt/ros/jade/include', 'LOGNAME': 'billy', 'USER': 'billy', 'PATH': '/opt/ros/jade/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/java/jre1.8.0_121/bin:/usr/local/java/jdk1.8.0_121/bin', 'XDG_VTNR': '7', 'GNOME_KEYRING_CONTROL': '/run/user/1000/keyring-xeMlTe', 'CMAKE_PREFIX_PATH': '/opt/ros/jade', 'LD_LIBRARY_PATH': '/opt/ros/jade/lib', 'LANG': 'en_US.UTF-8', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session0', 'XAUTHORITY': '/home/billy/.Xauthority', 'LANGUAGE': 'en_US', 'SHLVL': '1', 'MANDATORY_PATH': '/usr/share/gconf/ubuntu.mandatory.path', 'JOB': 'gnome-session', 'ROS_LOG_FILENAME': '/home/billy/.ros/log/17d5e0de-1c3a-11e7-8d67-100ba9588b18/roslaunch-billy-ThinkPad-T420-4123.log', 'UPSTART_INSTANCE': '', 'COMPIZ_CONFIG_PROFILE': 'ubuntu', 'TEXTDOMAIN': 'im-config', 'CLUTTER_IM_MODULE': 'xim', 'XMODIFIERS': '@im=ibus', 'ROS_MASTER_URI': 'http://localhost:11311', 'JAVA_HOME': '/usr/local/java/jdk1.8.0_121', 'HOME': '/home/billy', 'QT4_IM_MODULE': 'xim', 'SELINUX_INIT': 'YES', 'SSH_AUTH_SOCK': '/run/user/1000/keyring-xeMlTe/ssh', 'XDG_RUNTIME_DIR': '/run/user/1000', 'PYTHONPATH': '/opt/ros/jade/lib/python2.7/dist-packages', 'SESSIONTYPE': 'gnome-session', 'VTE_VERSION': '3409', 'ROS_ROOT': '/opt/ros/jade/share/ros', 'GDMSESSION': 'ubuntu', 'IM_CONFIG_PHASE': '1', 'UPSTART_JOB': 'unity-settings-daemon', 'TEXTDOMAINDIR': '/usr/share/locale/', 'XDG_DATA_DIRS': '/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/', 'PKG_CONFIG_PATH': '/opt/ros/jade/lib/pkgconfig', 'ROS_PACKAGE_PATH': '/home/billy/catkin_ws:/home/catkin_ws:/opt/ros/jade/share:/opt/ros/jade/stacks', 'XDG_CURRENT_DESKTOP': 'Unity', 'XDG_SESSION_ID': 'c2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-yoaWaMVbVv', '_': '/opt/ros/jade/bin/roslaunch', 'DEFAULTS_PATH': '/usr/share/gconf/ubuntu.default.path', 'GTK_IM_MODULE': 'ibus', 'DESKTOP_SESSION': 'ubuntu', 'GPG_AGENT_INFO': '/run/user/1000/keyring-xeMlTe/gpg:0:1', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'GNOME_KEYRING_PID': '1623', 'XDG_SEAT': 'seat0', 'OLDPWD': '/home/billy/catkin_ws', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'GDM_LANG': 'en_US', 'GTK_MODULES': 'overlay-scrollbar:unity-gtk-module', 'INSTANCE': 'Unity', 'PWD': '/home/billy/catkin_ws/src', 'QT_IM_MODULE': 'ibus', 'ROS_ETC_DIR': '/opt/ros/jade/etc/ros', 'COLORTERM': 'gnome-terminal', 'DISPLAY': ':0', 'JRE_HOME': '/usr/local/java/jre1.8.0_121', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'UPSTART_SESSION': 'unix:abstract=/com/ubuntu/upstart-session/1000/1627'}]
[roslaunch][ERROR] 2017-04-08 02:06:59,006: can't locate node [tf_broadcaster] in package [robot_setup_tf]
[roslaunch][ERROR] 2017-04-08 02:06:59,006: ERROR: cannot launch node of type [robot_setup_tf/tf_broadcaster]: can't locate node [tf_broadcaster] in package [robot_setup_tf]
And the content of the launch file is here.
<launch>
<node pkg="xv_11_laser_driver" type="neato_laser_publisher" name="xv_11_node" output="screen">
<param name="port" value="/dev/ttyUSB0"/>
<param name="message_logging" value="0"/>
</node>
robot_setup_tf tf_broadcaster
<node pkg="robot_setup_tf" type="tf_broadcaster" name="base_link_to_laser_and_imu" output="screen">
</node>
motor_command_node
<node pkg="cmd_publisher" type="cmd_publisher" name="cmd_publisher" output="screen">
</node>
serial_port_node
<node pkg="serial_port_sender" type="serial_port_sender" name="serial_port_sender" output="screen">
</node>
robot_state_node
<node pkg="robot_state_machine" type="robot_state_machine" name="robot_state_machine" output="screen">
</node>
</launch>
As noted before, this launch file and the other nodes are unchanged from when it was working.
I can see the the executable files in the devel folder as shown:
billy@billy-ThinkPad-T420:~/catkin_ws/devel/lib/robot_state_machine$ ls
robot_state_machine
but rosrun does not work as shown:
billy@billy-ThinkPad-T420:~/catkin_ws$ rosrun robot_state_machine robot_state_machine[rosrun] Couldn't find executable named robot_state_machine below /home/billy/catkin_ws/src/robot_state_machine
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun] /home/billy/catkin_ws/src/robot_state_machine
[rosrun] /home/billy/catkin_ws/src/robot_state_machine/include/robot_state_machine
I see rosrun isn't looking in the devel folder, but don't know enough about ROS to be sure that's an issue.
What am I missing? Thanks in advance for your help.
Asked by billy on 2017-04-08 04:44:33 UTC
Comments
2 things to check: 1. Can you do
roscd serial_port_sender
and other packages? 2. cd toyour_workspace/devel/lib/
, do you see all of your nodes in the corresponding package folder? E.g. serial_port_sender in serial_port_sender folder, tf_broadcaster in robot_setup_tf folder...Asked by DavidN on 2017-04-09 07:55:10 UTC
Also, did you compile with
catkin_make
orcatkin_make install
?Asked by DavidN on 2017-04-09 08:00:47 UTC
Davidn - thanks for your help. Answers: 1 - yes, 2 - yes, 3 - after deleting build and devel folders I ran 'catkin_make' and it didn't work. Then ran 'catkin_make install' and it didn't work. Today, deleting the folders and running 'catkin_make install' did work. Now it's all good! Order important!
Asked by billy on 2017-04-09 15:11:38 UTC
So I spoke too soon. The launch file worked once this morning, but now back to not working, even after deleting the install, build, and devel folders and running caktin_make install. Back to square 1.
Asked by billy on 2017-04-09 20:00:08 UTC
Ok. so in step 2, you could see your nodes in respective packages, right? Can you use rosrun to launch your node? Try to do it one by one to make sure all the nodes are "runnable".
Asked by DavidN on 2017-04-09 20:45:05 UTC
I can see them but cannot use rosrun to launch them. I will update the question with the errors I get attempting rosrun.
Asked by billy on 2017-04-09 20:48:43 UTC
You normally can't use the install and the devel space at the same time. If you have targets that are only being built when you run
catkin_make install
you might want to try sourcing thesetup.bash
script that is in theinstall/
directory instead of thedevel/
directoryAsked by jarvisschultz on 2017-04-10 07:59:37 UTC
Jarvi, I've been trying with both catkin_make and catkin_make install. The response to the launch file and rosrun have been the same except for a single case yesterday where launch worked once after running catkin_make install. Any other ideas will be appreciated.
Asked by billy on 2017-04-10 11:27:25 UTC
Does this ring any bell: http://answers.ros.org/question/123581/rosrun-cannot-find-my-executable/ ?
Asked by DavidN on 2017-04-10 20:59:41 UTC
DavidN - that link is certainly a step in the right direction. Good find! The global CMAKE_PREFIX_PATH doesn't include my workspace anymore. To make things work now, I need to source the setup file in any window I want to call that launch file from.
Asked by billy on 2017-04-11 00:57:33 UTC
That is new. It used to be enough to source in the window I ran catkin_make in, and then I wouldn't have to do it in another window. I looked how to update the variable manually, but getting errors. I need to find the folder that has the base path listed, but not sure where that is. Thanks again!
Asked by billy on 2017-04-11 01:03:08 UTC
I have a second PC with the same setup but it works. CMAKE_PREFIX_PATH contains my workspace immediately after booting. No sourcing required.
Asked by billy on 2017-04-11 01:05:07 UTC
I added the this line to my .bashrc file and it seems to have corrected the issue: "export CMAKE_PREFIX_PATH=/home/billy/catkin_ws/devel:/opt/ros/jade:$CMAKEPREFIX_PATH" Still don't know what caused the issue, or correct way to fix, but it looks OK now. Path correct at boot up. Thanks again Dave.
Asked by billy on 2017-04-11 01:16:59 UTC
For completeness, you should always need to source your workspace's
setup.bash
file in every single terminal. Once sourced,setup.bash
file should have automatically set the CMAKE_PREFIX_PATH to be the correct value for your workspace. Your claim that you used to only source in the compiling..Asked by jarvisschultz on 2017-04-11 13:10:17 UTC
...terminal sounds incorrect. Adding a
source ~/catkin_ws/devel/setup.bash
to your bashrc forces the setup.bash to be "sourced" in every terminal. Unless your setup.bash is somehow not setting the CMAKE_PREFIX_PATH, what you describe actually sounds like the intended behavior.Asked by jarvisschultz on 2017-04-11 13:12:55 UTC
Jarvis - My .bashrc file had been exporting the ROS_PACKAGE_PATH but not the CMAKE_PREFIX_PATH. It was not necessary for me to source in every window until last week after installing java and rebuilding. Until last week, the CMAKE path included my ROS workspace at boot up. But something changed.
Asked by billy on 2017-04-11 13:29:05 UTC
But I like the idea to just include the entire setup file in the .bashrc file. I'll add that. Of course I think there will be issues if I ever boot the machine after deleting the devel folder. Thanks for advice.
Asked by billy on 2017-04-11 13:30:43 UTC
The bashrc is not run when you boot the machine, it is run when you open a terminal. You should not be directly exporting the ROS_PACKAGE_PATH or most other ROS env vars directly if you are using catkin. You should be using the setup.bash files.
Asked by jarvisschultz on 2017-04-11 17:39:39 UTC
Jarvis - Understood. Clearly I don't have a lot of Linux experience. Thanks for your help.
Asked by billy on 2017-04-11 21:54:20 UTC