Ask Your Question

Revision history [back]

Here are the steps:

  1. Make a new script file lets take startup.sh.
  2. Before calling the roscore and roslaunch in startup file, the ros environment should be sourced, so source the environment by addiing source /opt/ros/<distro>/setup.sh or . /opt/ros/<distro>/setup.sh
  3. Now you can add the ros command in the startup file like roscore or roslaunch. if directly roscore or rolaunch does not work launch this command from the ros/<distro>bin by adding the line /opt/ros/<distro>/bin/roscore

Note: make sure while creating the new file you add #!/bin/sh in the first line.

Here are the steps:

  1. Make a new script file lets take startup.sh.
  2. Before calling the roscore and roslaunch in startup file, the ros environment should be sourced, so source the environment by addiing source /opt/ros/<distro>/setup.sh or . /opt/ros/<distro>/setup.sh
  3. Now you can add the ros command in the startup file like roscore or roslaunch. if directly roscore or rolaunch does not work launch this command from the ros/<distro>bin by adding the line /opt/ros/<distro>/bin/roscore.
  4. Give executable permission to file sudo chmod 755 /etc/init.d/startup.sh

Note: make sure while creating the new file you add #!/bin/sh in the first line.