auto start ROS launch script on boot up

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

auto start ROS launch script on boot up

Kar-Wing Chan
On an Ubuntu 10.04 system, how do I get a launch script to start up and
run (and stays running) when ubuntu powers up?

Thank you.

_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto start ROS launch script on boot up

Cedric Skybotix
Hello,

I don't know if this it THE right way, but I use a custom /etc/init.d
script and I start my roslaunch within a screen session, so I can log in
later and check the status easily. I find that easier than daemonizing
it directly.

HTH

On 10/12/10 13:46, Kar-Wing Chan wrote:

> On an Ubuntu 10.04 system, how do I get a launch script to start up and
> run (and stays running) when ubuntu powers up?
>
> Thank you.
>
> _______________________________________________
> ros-users mailing list
> [hidden email]
> https://code.ros.org/mailman/listinfo/ros-users
>    

--
Dr. Cedric Pradalier
http://www.asl.ethz.ch/people/cedricp

_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto start ROS launch script on boot up

Prasad Dixit
We follow below process. Of course there can be much flexible ways.

Step 1: Write a script which contains ros commands like roslaunch, roscore, etc.The script would
look somewhat like this:
#! /bin/sh
source /opt/ros/boxturtle/setup.sh
roslaunch hokuyo_node hokuyo_test.launch

Note the second line source /opt/ros/boxturtle/setup.sh this is the path of ros bash. We need to
source ros setup in our script before we use any of the ros commands.

Step 2: Make the script executable by using command
sudo chmod +x /path/to/script.sh

Step 3: Go to System -->Preferences --> Startup Application

Step 4: click on add application or add tab, a window would popup. Add name say "rosnome"

Step 5: On the given window in the command tab type
gnome-terminal -x /path/to/script.sh

Step 6: type whatever you want on the comment space or leave blank and click add

Step 7: On the terminal Edit -->profile preferences-->title and command tab select when command
exits hold the terminal open

Step 8: reboot system and your application would auto start on boot every time.

Note: It is not possible or rather a bit difficult job to open multiple terminals from a single script so
it is recommended to use a single ros launch file for the entire robot which would include
everything.

Hope this helps.
- Prasad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto start ROS launch script on boot up

Kar-Wing Chan
In reply to this post by Cedric Skybotix
Hello Cedric,

Thank you for your reply.  Yes, I'd like to have a terminal session
startup automatically and then automatically start a ros launch file
from within it.

I figured out how to start the terminal automatically from a .sh file,
but couldn't figure out how to get that terminal to start the launch
file automatically.  Would you know how?

Thank you,

Kar-Wing

On Tue, 2010-10-12 at 13:48 +0200, Cedric Pradalier wrote:

> Hello,
>
> I don't know if this it THE right way, but I use a custom /etc/init.d
> script and I start my roslaunch within a screen session, so I can log in
> later and check the status easily. I find that easier than daemonizing
> it directly.
>
> HTH
>
> On 10/12/10 13:46, Kar-Wing Chan wrote:
> > On an Ubuntu 10.04 system, how do I get a launch script to start up and
> > run (and stays running) when ubuntu powers up?
> >
> > Thank you.
> >
> > _______________________________________________
> > ros-users mailing list
> > [hidden email]
> > https://code.ros.org/mailman/listinfo/ros-users
> >    
>


_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto start ROS launch script on boot up

Kar-Wing Chan
In reply to this post by Prasad Dixit
Thanks for this Prasad!  I will try it out with my launch file.

Kar-Wing

On Tue, 2010-10-12 at 04:58 -0700, Prasad Dixit wrote:

> We follow below process. Of course there can be much flexible ways.
>
> Step 1: Write a script which contains ros commands like roslaunch, roscore,
> etc.The script would
> look somewhat like this:
> #! /bin/sh
> source /opt/ros/boxturtle/setup.sh
> roslaunch hokuyo_node hokuyo_test.launch
>
> Note the second line source /opt/ros/boxturtle/setup.sh this is the path of
> ros bash. We need to
> source ros setup in our script before we use any of the ros commands.
>
> Step 2: Make the script executable by using command
> sudo chmod +x /path/to/script.sh
>
> Step 3: Go to System -->Preferences --> Startup Application
>
> Step 4: click on add application or add tab, a window would popup. Add name
> say "rosnome"
>
> Step 5: On the given window in the command tab type
> gnome-terminal -x /path/to/script.sh
>
> Step 6: type whatever you want on the comment space or leave blank and click
> add
>
> Step 7: On the terminal Edit -->profile preferences-->title and command tab
> select when command
> exits hold the terminal open
>
> Step 8: reboot system and your application would auto start on boot every
> time.
>
> Note: It is not possible or rather a bit difficult job to open multiple
> terminals from a single script so
> it is recommended to use a single ros launch file for the entire robot which
> would include
> everything.
>
> Hope this helps.
> - Prasad
>


_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto start ROS launch script on boot up

Kar-Wing Chan
In reply to this post by Cedric Skybotix
Hello Cedric,

Please disregard my followup question.  I received an email from another
person that filled in the details of what I needed.

Thank you for your prompt reply and information.

Kar-Wing

On Tue, 2010-10-12 at 13:48 +0200, Cedric Pradalier wrote:

> Hello,
>
> I don't know if this it THE right way, but I use a custom /etc/init.d
> script and I start my roslaunch within a screen session, so I can log in
> later and check the status easily. I find that easier than daemonizing
> it directly.
>
> HTH
>
> On 10/12/10 13:46, Kar-Wing Chan wrote:
> > On an Ubuntu 10.04 system, how do I get a launch script to start up and
> > run (and stays running) when ubuntu powers up?
> >
> > Thank you.
> >
> > _______________________________________________
> > ros-users mailing list
> > [hidden email]
> > https://code.ros.org/mailman/listinfo/ros-users
> >    
>


_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto start ROS launch script on boot up

Kar-Wing Chan
In reply to this post by Prasad Dixit
Hi Prasad,

I followed your instructions exactly and it worked!  Thank you for the
information and the step-by-step instructions.

I think this should be added to the set of beginner tutorials.

Kar-Wing

On Tue, 2010-10-12 at 04:58 -0700, Prasad Dixit wrote:

> We follow below process. Of course there can be much flexible ways.
>
> Step 1: Write a script which contains ros commands like roslaunch, roscore,
> etc.The script would
> look somewhat like this:
> #! /bin/sh
> source /opt/ros/boxturtle/setup.sh
> roslaunch hokuyo_node hokuyo_test.launch
>
> Note the second line source /opt/ros/boxturtle/setup.sh this is the path of
> ros bash. We need to
> source ros setup in our script before we use any of the ros commands.
>
> Step 2: Make the script executable by using command
> sudo chmod +x /path/to/script.sh
>
> Step 3: Go to System -->Preferences --> Startup Application
>
> Step 4: click on add application or add tab, a window would popup. Add name
> say "rosnome"
>
> Step 5: On the given window in the command tab type
> gnome-terminal -x /path/to/script.sh
>
> Step 6: type whatever you want on the comment space or leave blank and click
> add
>
> Step 7: On the terminal Edit -->profile preferences-->title and command tab
> select when command
> exits hold the terminal open
>
> Step 8: reboot system and your application would auto start on boot every
> time.
>
> Note: It is not possible or rather a bit difficult job to open multiple
> terminals from a single script so
> it is recommended to use a single ros launch file for the entire robot which
> would include
> everything.
>
> Hope this helps.
> - Prasad
>


_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto start ROS launch script on boot up

Cedric Skybotix
In reply to this post by Kar-Wing Chan
Hi all,

I forgot to mention that my answer was for setting up a headless system,
on an embedded platform not running a X session/gnome session.

A different requirement altogether...

On 10/12/10 13:59, Kar-Wing Chan wrote:

> Hello Cedric,
>
> Thank you for your reply.  Yes, I'd like to have a terminal session
> startup automatically and then automatically start a ros launch file
> from within it.
>
> I figured out how to start the terminal automatically from a .sh file,
> but couldn't figure out how to get that terminal to start the launch
> file automatically.  Would you know how?
>
> Thank you,
>
> Kar-Wing
>
> On Tue, 2010-10-12 at 13:48 +0200, Cedric Pradalier wrote:
>    
>> Hello,
>>
>> I don't know if this it THE right way, but I use a custom /etc/init.d
>> script and I start my roslaunch within a screen session, so I can log in
>> later and check the status easily. I find that easier than daemonizing
>> it directly.
>>
>> HTH
>>
>> On 10/12/10 13:46, Kar-Wing Chan wrote:
>>      
>>> On an Ubuntu 10.04 system, how do I get a launch script to start up and
>>> run (and stays running) when ubuntu powers up?
>>>
>>> Thank you.
>>>
>>> _______________________________________________
>>> ros-users mailing list
>>> [hidden email]
>>> https://code.ros.org/mailman/listinfo/ros-users
>>>
>>>        
>>      
>
> _______________________________________________
> ros-users mailing list
> [hidden email]
> https://code.ros.org/mailman/listinfo/ros-users
>    

--
Dr. Cedric Pradalier
http://www.asl.ethz.ch/people/cedricp

_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto start ROS launch script on boot up

Blaise Gassend
In reply to this post by Cedric Skybotix
I usually have the /etc/init.d script only prepare the ros environment
and then rosrun a script in the ros tree, which is the real init.d
script. That way the /etc/init.d script should never have to change,
and the effective init.d script (the one in the ros tree) gets
versioned along with the ROS packages. This extra level of indirection
makes package management a lot easier in my experience, especially
when multiple people are playing with different versions of the
packages.

On Tue, Oct 12, 2010 at 4:48 AM, Cedric Pradalier
<[hidden email]> wrote:

> Hello,
>
> I don't know if this it THE right way, but I use a custom /etc/init.d
> script and I start my roslaunch within a screen session, so I can log in
> later and check the status easily. I find that easier than daemonizing
> it directly.
>
> HTH
>
> On 10/12/10 13:46, Kar-Wing Chan wrote:
>> On an Ubuntu 10.04 system, how do I get a launch script to start up and
>> run (and stays running) when ubuntu powers up?
>>
>> Thank you.
>>
>> _______________________________________________
>> ros-users mailing list
>> [hidden email]
>> https://code.ros.org/mailman/listinfo/ros-users
>>
>
> --
> Dr. Cedric Pradalier
> http://www.asl.ethz.ch/people/cedricp
>
> _______________________________________________
> ros-users mailing list
> [hidden email]
> https://code.ros.org/mailman/listinfo/ros-users
>
_______________________________________________
ros-users mailing list
[hidden email]
https://code.ros.org/mailman/listinfo/ros-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto start ROS launch script on boot up

usman.arif
In reply to this post by Prasad Dixit
I have tried it but there is one problem:
 I have written a shell command file "start.sh" and it contains "roslaunch pkg_name file.launch"
When i try to execute this shell file in terminal, it runs successfully.
But when it runs automatically on start up, as you have written, the terminal shows "source not found", "roslaunch not found" . Can you help me correct it.
Loading...