Issues launching ROS on startup
ROS: groovy OS: ubuntu 12.04
What we are trying to do is have roscore start upon boot (have this working now) and then execute a launch file. I am not a linux person, so I feel I am really not approaching this the right way. Currently, this is what I have attempted:
1) roscore is launched via a script in /etc/init.d. This is fine. 2) I want to launch my launch file on boot. Manually, I do it like this: roslaunch rover.launch. It works great. 3) I would like this to start on boot, so I tried the following: inside new script (boot.sh) - note i disabled password prompt for sudo:
sudo su - roboops
/home/roboops/groovycat/scripts/bootRoverLaunch.sh
bootRoverLaunch.sh:
cd /home/roboops/groovycat/
source devel/setup.sh
sleep 5
roslaunch rover.launch > /home/roboops/groovycat/scripts/startup.log
4) I went to "startup applications" and added "bash /home/roboops/groovycat/scripts/boot.sh"
5) Tried rebooting. Roscore starts, and the launch files executes. However, the nodes malfunction and don't work correctly (They work fine when started using the launch file directly in a terminal window. Oddly, it also works fine if I log out and back in once)
More specifically, here is the problem when using the above script to launch:
I am trying to run two nodes:
-joystick node (publishes joy topic) -motor control node (listens to joy topic and outputs commands to motor controllers via serial)
Joystick node starts successfully and If I do rostopic echo joy, I can see the values. Motor control node is listed as running but if I run roswtf it says:
Found 3 error(s).
ERROR Could not contact the following nodes:
* /Drivetrain
ERROR The following nodes should be connected but aren't:
* /Drivetrain->/rosout (/rosout)
ERROR Errors connecting to the following services:
* service [/Drivetrain/get_loggers] appears to be malfunctioning: Unable to communicate with service [/Drivetrain/get_loggers], address [rosrpc://Rover:58631]
* service [/Drivetrain/set_logger_level] appears to be malfunctioning: Unable to communicate with service [/Drivetrain/set_logger_level], address [rosrpc://Rover:58631]
The idea is, I need everything to automatically start on power-up. There will be no input devices/monitor connected to it when it is in use.