简体   繁体   中英

Gnome terminal doesn't recognise commands when started from startup-applications with .sh file

I am trying to use an.sh script to start a terminal when ubuntu boots. Gnome-terminal successfully starts up but when commands start executing such as (roscore, roslaunch or rosrun) it displays an error as follows: "bash: roslaunch command not found". Is there any way to fix this problem or any other way to start launch files of ROS with a visible terminal at start?

This is how my.sh file looks like

#!/bin/bash

gnome-terminal --geometry=40x40  \
--tab --title="roscore" -e "bash -c \"source ~/.bashrc;roscore;exec bash\"" \
--tab --title="navigation" -e "bash -c  \"sleep 38;roslaunch navigation.launch;exec bash\"" \
--tab --title="robot" -e "bash -c  \"sleep 28;roslaunch robot_config.launch;exec bash\""

Are you sourcing ros setup.bash file (source /opt/ros/$ROS_DISTRO/setup.bash)? If not just add it to ~/.bashrc file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM