0
$\begingroup$

Rosanswers logo

Hello Everyone,

First of all I am a noob! Thansk for helping a noob. I want to understand why is the ROS architecture is different when I build the ROS on my RaspberryPi3B using the installation steps in here.

I have built Ros_comm wet only version via creating an installation file, which I guess designed to be lighter than desktop version, using the following commands:

$ rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
$ wstool init src kinetic-ros_comm-wet.rosinstall

mkdir -p ~/ros_catkin_ws/external_src
cd ~/ros_catkin_ws/external_src
wget http://sourceforge.net/projects/assimp/files/assimp-3.1/assimp-3.1.1_no_test_models.zip/download -O assimp-3.1.1_no_test_models.zip
unzip assimp-3.1.1_no_test_models.zip
cd assimp-3.1.1
cmake .
make
sudo make install

$ cd ~/ros_catkin_ws
$ rosdep install -y --from-paths src --ignore-src --rosdistro kinetic -r --os=debian:stretch

$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic

$ source /opt/ros/kinetic/setup.bash
$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc

So, after making the installation, other than a build devel and src, I have build_isolated, devel_isolated and external_src folders. I also have a bunch of packages inside src folder. I don't remember that the downloaded packages were installed in the src usually, correct me if I am wrong, I thought only the projects that I work on should be inside the src folder. Anyway, in the below I have added responses from all the folders inside ros workspace in my raspberry when I list them. Why is the architecture different and is there any documentation I can find about how this works and effects?

pi@raspberrypi:~/ros_catkin_ws $ ls

build  build_isolated  devel  devel_isolated  external_src  kinetic-custom_ros.rosinstall  src

pi@raspberrypi:~/ros_catkin_ws/src $ ls

catkin          gencpp   gennodejs           message_runtime        rosbridge_suite  ros_environment  std_msgs
CMakeLists.txt  geneus   genpy               ros                    ros_comm         roslisp
cmake_modules   genlisp  geometry2           rosauth                ros_comm_msgs    rospack
common_msgs     genmsg   message_generation  rosbag_migration_rule  roscpp_core      ros_tutorials

pi@raspberrypi:~/ros_catkin_ws/external_src $ ls

assimp-3.1.1  assimp-3.1.1_no_test_models.zip

pi@raspberrypi:~/ros_catkin_ws/devel $ ls

bin         env.sh  include  local_setup.bash  local_setup.zsh  setup.sh        setup.zsh
cmake.lock  etc     lib      local_setup.sh    setup.bash       _setup_util.py  share

pi@raspberrypi:~/ros_catkin_ws/devel_isolated $ ls

actionlib_msgs   genpy               rosbag_migration_rule  rosconsole            roslisp          rosservice   std_srvs
catkin           geometry_msgs       rosbag_storage         roscpp                roslz4           rostest      stereo_msgs
cmake_modules    message_filters     rosbash                roscpp_serialization  rosmake          rostime      tf2_msgs
cpp_common       message_generation  rosboost_cfg           roscpp_traits         rosmaster        rostopic     topic_tools
diagnostic_msgs  message_runtime     rosbridge_library      roscreate             rosmsg           rosunit      trajectory_msgs
env.sh           mk                  rosbridge_msgs         ros_environment       rosnode          roswtf       visualization_msgs
gencpp           nav_msgs            rosbridge_server       rosgraph              rosout           sensor_msgs  xmlrpcpp
geneus           ros                 rosbridge_suite        rosgraph_msgs         rospack          setup.bash
genlisp          rosapi              rosbuild               roslang               rosparam         setup.sh
genmsg           rosauth             rosclean               roslaunch             rospy            setup.zsh
gennodejs        rosbag              ros_comm               roslib                rospy_tutorials  std_msgs

pi@raspberrypi:~/ros_catkin_ws/build $ ls

atomic_configure   CMakeFiles              CTestTestfile.cmake  genpy               ros                    roscpp_core      test_results
catkin             cmake_install.cmake     gencpp               geometry2           rosauth                ros_environment
catkin_generated   cmake_modules           geneus               gtest               rosbag_migration_rule  roslisp
CATKIN_IGNORE      common_msgs             genlisp              Makefile            rosbridge_suite        rospack
catkin_make.cache  CTestConfiguration.ini  genmsg               message_generation  ros_comm               ros_tutorials
CMakeCache.txt     CTestCustom.cmake       gennodejs            message_runtime     ros_comm_msgs          std_msgs

pi@raspberrypi:~/ros_catkin_ws/build_isolated $ ls

actionlib_msgs              geometry_msgs          rosbash               roscpp_traits    rosmsg           roswtf
catkin                      message_filters        rosboost_cfg          roscreate        rosnode          sensor_msgs
catkin_make_isolated.cache  message_generation     rosbridge_library     ros_environment  rosout           std_msgs
cmake_modules               message_runtime        rosbridge_msgs        rosgraph         rospack          std_srvs
cpp_common                  mk                     rosbridge_server      rosgraph_msgs    rosparam         stereo_msgs
diagnostic_msgs             nav_msgs               rosbridge_suite       roslang          rospy            tf2_msgs
gencpp                      ros                    rosbuild              roslaunch        rospy_tutorials  topic_tools
geneus                      rosapi                 rosclean              roslib           rosservice       trajectory_msgs
genlisp                     rosauth                ros_comm              roslisp          rostest          visualization_msgs
genmsg                      rosbag                 rosconsole            roslz4           rostime          xmlrpcpp
gennodejs                   rosbag_migration_rule  roscpp                rosmake          rostopic
genpy                       rosbag_storage         roscpp_serialization  rosmaster        rosunit

Originally posted by mmp52 on ROS Answers with karma: 80 on 2019-07-15

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Why is the architecture different and is there any documentation I can find about how this works and effects?

If by "architecture" you mean the file & directory layout then I believe that is easily explained.

I don't remember that the downloaded packages were installed in the src usually, correct me if I am wrong, I thought only the projects that I work on should be inside the src folder.

You are building everything from sources. To be able to build ROS from source, you need to create a Catkin workspace, download the base ROS packages into the src space of that workspace and finally you build that workspace using Catkin.

You created the workspace with mkdir ~/ros_catkin_ws.

wstool init src kinetic-ros_comm-wet.rosinstall downloaded all the base packages for you, as listed in kinetic-ros_comm-wet.rosinstall.

To build your workspace, you used catkin_make_isolated. That is a special version of Catkin that is capable of building workspaces with non-ROS packages, as is required when building the base ROS packages. catkin_make_isolated creates those *_isolated folders in your workspace (ie: build_isolated, devel_isolated and install_isolated).

You also appear to have build and devel folders. I don't think you'd normally have those, so it could be that you've ran regular catkin_make at some earlier point and these were left behind. They're not needed and not used any more.

In fact, none of the directories in ~/ros_catkin_ws are used, as you ran catkin_make_isolated with --install --install-space /opt/ros/kinetic, which places all the binaries and other installable artefacts in /opt/ros/kinetic.

I thought only the projects that I work on should be inside the src folder

that is indeed the recommended setup and workflow and you can and should still do that.

I believe your confusion comes from the fact that you're assuming there can only be a single workspace. That is not the case. Using workspace overlaying you can build one workspace on-top of another.

When installing ROS using apt, the install space in /opt/ros is normally the one that is the base workspace. When building things from source (as you have done), the install (or devel) space of the workspace in which you built the base ROS packages becomes the base workspace.

In both cases your own workspace (where you'd "work on your projects") would be the workspace that extends the base workspace.

Now that you've installed the base ROS packages, you can create a new workspace that would contain just your own packages.

If you ever need to install additional base ROS packages into /opt/ros/kinetic, you'd have to follow a slightly different workflow that is shown at the end of the installation instructions in the Maintaining a Source Checkout section.


Originally posted by gvdhoorn with karma: 86574 on 2019-07-15

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2019-07-15:
Note that this is not specific to RPis at all: any workspace built using catkin_make_isolated will have those *_isolated folders, and any workspace in which you built ROS from sources will have those packages in the src space.

Comment by mmp52 on 2019-07-15:
Thank you for this clear answer,

What about src & external src folders, is one of them also unnecessary?

Comment by gvdhoorn on 2019-07-15:
You created those yourself, as part of Step 3.

Nothing in src is needed after you've installed it.

Unless you want to keep the sources around for some reason.

Comment by mmp52 on 2019-07-15:
okay, but why this workspace overlaying method is suggested for building ROS in the Raspberry Pi?

Comment by mmp52 on 2019-07-15:
Also, in the ws overlaying tutorial, it is saying that: Overlaying refers to building and using a ROS package from source on top of an existing version of that same package. In this way your new or modified version of the package "overlays" the installed one. I am doing this before installing any other ROS when I follow the installation guide, this tickles my mind

Comment by gvdhoorn on 2019-07-15:\

okay, but why this workspace overlaying method is suggested for building ROS in the Raspberry Pi?

it's not.

I'm just explaining the underlying mechanism.

On any system where ROS gets built from source, the initial workspace is used to build the base packages. Those get installed and then a new workspace is created, containing just the pkgs that the user wants to work on (ie: his "projects").

That workflow just happens to be based on workspace overlaying.

Comment by mmp52 on 2019-07-15:
okay, Should I catkin make in an isolated way when I want to create a new package in this workspace? it is still not clear to me

Comment by gvdhoorn on 2019-07-15:\

Should I catkin make in an isolated way when I want to create a new package in this workspace?

No,

If you're building regular ROS packages you can just use regular catkin_make.

I believe I explained why / when catkin_make_isolated was needed:

That is a special version of Catkin that is capable of building workspaces with non-ROS packages, as is required when building the base ROS packages.

Comment by mmp52 on 2019-07-15:
so when I want to create my own project, should I create a complete new ws in my home directory or should I just create the workspace directory inside ros_catkin_ws, sorry I am having hard time grasping the linkage and reasoning behind this procedure and I just want to understand them.

Comment by gvdhoorn on 2019-07-15:
After having followed the base installation instructions, you can forget about the ros_catkin_ws you created earlier (remove it, completely).

Now treat your ROS installation in /opt/ros/kinetic as a regular ROS installation and create a new workspace for your own work.

One caveat though: if you ever want to install a new "base" package, you'll have to follow the workflow described in Maintaining a Source Checkout (for which you'd not use your "own projects" workspace).

Comment by mmp52 on 2019-07-15:
Thanks again,

One last question about this, what is the difference between regular installation of ROS and installing from the source, what are the differences and what is happening in both of them, is there a document on it?

Comment by mmp52 on 2019-07-15:
Also, once used this method for building ROS , can't I use sudo apt-get install ros--ros- anymore?

Comment by gvdhoorn on 2019-07-15:\

Also, once used this method for building ROS , can't I use sudo apt-get install ros--ros- anymore?

indeed, you cannot use apt to install ROS packages if you've built it from sources.

The two approaches don't mix.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.