Robotics StackExchange | Archived questions

ROS Noetic : roscore not found after sourcing the setup.bash, even no broken packages

I have dual booted my laptop with Ubuntu 20.04 along with Windows 10. Then I have tried ROS Noetic installation and followed each & every step correctly in the guide. But roscore & other commands are not working!

Followed official site: http://wiki.ros.org/noetic/Installation/Ubuntu

Steps followed so far after installation:

  1. Open a new terminal
  2. Source the setup.bash for noetic --> source /opt/ros/noetic/setup.bash

  3. ran roscore to test the installation

    roscore

    Command 'roscore' not found, but can be installed with:

    sudo apt install python3-roslaunch

  4. Even tried to install roscore for noetic & it completes the installation without an error.

    sudo apt install --reinstall ros-noetic-roslaunch

  5. sourced the setup & tried again --> still not working with same roscore not found issue.

  6. Checked Installation files --> It is available too.

    ls /opt/ros/noetic/

    bin include localsetup.sh setup.sh share env.sh lib localsetup.zsh setuputil.py etc local_setup.bash setup.bash setup.zsh

    ls /opt/ros/noetic/share/

    actionlib rosclean actionlibmsgs roscomm actionlibtutorials rosconsole angles rosconsolebridge bond roscore bondcore roscpp bondcpp roscppcore bondpy roscppserialization cameracalibration roscpptraits cameracalibrationparsers roscpptutorials camerainfomanager roscreate catkin rosenvironment classloader roseus cmakemodules rosgraph common-lisp rosgraphmsgs commonmsgs roslang commontutorials roslaunch compresseddepthimagetransport roslib compressedimagetransport roslint controllerinterface roslisp controllermanager roslz4 controllermanagermsgs rosmake controlmsgs rosmaster controltoolbox rosmsg cppcommon rosnode cvbridge rosout depthimageproc rospack desktop rosparam desktopfull rospy diagnosticaggregator rospytutorials diagnosticanalysis rosservice diagnosticcommondiagnostics rostest diagnosticmsgs rostime diagnostics rostopic diagnosticupdater rostutorials diffdrivecontroller rosunit dynamicreconfigure roswtf eigenconversions rqtaction executivesmach rqtbag filters rqtbagplugins forwardcommandcontroller rqtcommonplugins gazebodev rqtconsole gazebomsgs rqtdep gazeboplugins rqtgraph gazeboros rqtgui gazeboroscontrol rqtguicpp gazeborospkgs rqtguipy gencpp rqtimageview geneus rqtlaunch genlisp rqtloggerlevel genmsg rqtmoveit gennodejs rqtmsg genpy rqtnavview geometry rqtplot geometrymsgs rqtposeview geometrytutorials rqtpublisher gldependency rqtpycommon hardwareinterface rqtpyconsole imagecommon rqtreconfigure imagegeometry rqtrobotdashboard imagepipeline rqtrobotmonitor imageproc rqtrobotplugins imagepublisher rqtrobotsteering imagerotate rqtruntimemonitor imagetransport rqtrviz imagetransportplugins rqtservicecaller imageview rqtshell interactivemarkers rqtsrv interactivemarkertutorials rqttftree jointlimitsinterface rqttop jointstatecontroller rqttopic jointstatepublisher rqtweb jointstatepublishergui rviz kdlconversions rvizplugintutorials kdlparser rvizpythontutorial laserassembler selftest laserfilters sensormsgs lasergeometry shapemsgs laserpipeline simulators librviztutorial smach mapmsgs smachmsgs mediaexport smachros messagefilters smclib messagegeneration stage messageruntime stageros mk stdmsgs navmsgs stdsrvs nodelet stereoimageproc nodeletcore stereomsgs nodelettopictools tf nodelettutorialmath tf2 pclconversions tf2eigen pclmsgs tf2geometrymsgs pclros tf2kdl perception tf2msgs perceptionpcl tf2py pluginlib tf2ros pluginlibtutorials tfconversions polledcamera theoraimagetransport positioncontrollers topictools pythonqtbinding trajectorymsgs qtdotgraph transmissioninterface qtgui turtleactionlib qtguicpp turtlesim qtguipycommon turtletf qwtdependency turtletf2 realtimetools urdf resourceretriever urdfparserplugin robot urdfsimtutorial robotstatepublisher urdftutorial ros visionopencv rosbag visualizationmarkertutorials rosbagmigrationrule visualizationmsgs rosbagstorage visualizationtutorials rosbase viz rosbash webkitdependency rosboostcfg xacro rosbuild xmlrpcpp

  7. Also I cannot see any ROS related env variables added after sourcing the setup.bash

    source /opt/ros/noetic/setup.bash

    printenv | grep ROS --> return nothing

  8. Even checked fro broken packages --> dpkg -l | grep ^..r --> returns nothing( from https://askubuntu.com/questions/772653/how-to-list-broken-packages-in-console)

I dont know what is the issue here. Please help me to figure it out.

Asked by bavantha11 on 2021-06-12 02:57:04 UTC

Comments

Is your linux account running the bash shell? One way to check is the ps command. In my terminal the output looks like this:

$ ps
12413 pts/7    00:00:00 ps
31368 pts/7    00:00:00 bash

Asked by Mike Scheutzow on 2021-06-20 11:00:12 UTC

Yes, It is running the bash shell.

*$ ps
PID      TTY          TIME CMD
16244 pts/0    00:00:00  bash
16429 pts/0    00:00:00  ps*

Asked by bavantha11 on 2021-07-19 04:29:33 UTC

At the command line, please show us the output of: env | grep ROS

Asked by Mike Scheutzow on 2021-07-19 09:31:32 UTC

Please help I am facing the same issue and when I enter env | grep ROS on terminal it returns nothing.

Asked by Oneeyedeagle019 on 2021-07-25 14:48:58 UTC

Thank you @Mike Scheutzow for being helpful.

Use following in your ~/.bashrc and restart a new terminal. Then I was able to use roscore. Sourcing it on the same terminal is not working. Same applied for ROS2 foxy in my case.

source /opt/ros/noetic/setup.bash

Asked by bavantha11 on 2021-08-27 11:43:20 UTC

Answers

Here is my bashrc file for Noetic:

ROS:

source /opt/ros/noetic/setup.bash

source /opt/ros/noetic/setup.zsh

workspace:

source ~/catkin_ws/devel/setup.bash

master and host:

export ROS_MASTER_URI=http://localhost:11311

export ROS_HOSTNAME=localhost

Asked by Youssef_Lah on 2021-06-15 15:24:34 UTC

Comments

Why are you sourcing setup.zsh ?

Asked by Mike Scheutzow on 2021-07-19 09:29:38 UTC

Hi, I had a similar problem one fix is sourcing it in every single terminal you are running roscore, or rosrun on. But that's a temporary fix which will be a pain hope somebody answers how to source it automatically when your terminal starts, because editing .bashrc file isn't working for me either.

Asked by Oneeyedeagle019 on 2021-07-25 14:59:02 UTC

Comments