ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Why is the ROSberryPi Architecture Different?

asked 2019-07-15 05:12:33 -0500

mmp52 gravatar image

updated 2019-07-15 06:23:39 -0500

gvdhoorn gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-07-15 06:35:18 -0500

gvdhoorn gravatar image

updated 2019-07-15 06:41:20 -0500

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.

edit flag offensive delete link more

Comments

1

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.

gvdhoorn gravatar image gvdhoorn  ( 2019-07-15 06:44:25 -0500 )edit

Thank you for this clear answer,

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

mmp52 gravatar image mmp52  ( 2019-07-15 07:23:51 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2019-07-15 07:26:27 -0500 )edit

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

mmp52 gravatar image mmp52  ( 2019-07-15 07:28:01 -0500 )edit

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

mmp52 gravatar image mmp52  ( 2019-07-15 07:30:25 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2019-07-15 07:34:02 -0500 )edit

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

mmp52 gravatar image mmp52  ( 2019-07-15 07:43:31 -0500 )edit
1

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.

gvdhoorn gravatar image gvdhoorn  ( 2019-07-15 07:47:57 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-07-15 05:12:33 -0500

Seen: 438 times

Last updated: Jul 15 '19