Robot Operating System – A flexible framework for writing robot software
ros.org
ros.org
Furthermore they use their own build system (catkin, WHY?), define their own IDL (WHY?), use their own dependency system (rosdep, WHY?) and even mess with your Bash environment.
I appreciate their effort and it is really hard to make a system that interfaces with all kinds of different robots and hardware, but I don't understand why they don't exploit existing high-quality solutions for the "not-robot-related" parts of their system. At the moment I don't think I would like to have ROS run a potential self-driving car.
Otherwise, I have been personally using ROS for building robots for the French (and European) robot championship (see https://twitter.com/AIGRIS_Birds). It works pretty well, it is convenient, easy to learn and provide some nice tooling (bagging for replaying messages, simulation with Gazebo...).
It is the de facto standard for robotics middleware for scientific projects. It not widely used by industrials because of some shortcomings even if initiatives like ROS Industrial and ROS 2 will likely improve things.
catkin is built on top of CMake, so that's no excuse.
CMake has its drawbacks, fair enough, but 10 years ago it was pretty much already the de facto standard build system for C++. What would have used instead of CMake ?
- Make and autotools (Haha) ?
- scons ?
- completely custom build system ?
- something else ?
The most painful I had to deal with was my teammates who, instead of creating a brand new package, would simply copy and paste and existing one without fixing the dependencies, resulting in a build that fails if the workspace was cleared.s/robot/software
Why even have the concept of a `workspace`? I don't think it solves any problem.
Most bigger software projects are built on-top of other software, but most deal with it without having to implement their own build system. I know that CMake is established software, but despite its own horrendous scripting language I find it mostly useful if you want to build cross-platform native software - if you're going to run on Linux anyway, I think there is no point for this indirection.
> - Make and autotools (Haha) ?
You might laugh about these tools, but they build most of your userspace if you're on Linux. And yes they even work on distributions other than Ubuntu.
I agree. When I ask these questions (we use ROS at our company) the answers usually sound like the following:
1. Catkin: No other solution for multi-project CMake. Apparently development often spans multiple projects / repositories for a single integrated "feature" on the robot.
2. IDL: Because they have their own middleware. I think this goes away in ROS 2.0 as they move to DDS.
3. Rosdep: Because they want to run on multiple distributions even though it seems Ubuntu is the only truly supported distro. Rosdep is just a thin layer over the local package manager, pip, and whatever else they have glued in.
4. Environment: They provide the concept of "workspaces" to enable checking out source for a small subset of packages to work on and override whatever is installed on the base system.
I live in the embedded / hardware world but my colleagues working on the higher level software tend think all of the above is necessary for dealing with the hundreds of packages and dependency hell that come with the "modular" robot software approach.
That said, the popular packages in the ecosystem for simulation, planning, robot modeling, etc seem powerful. Community developed ROS "drivers" (middleware integration) are also useful so you don't reinvent the wheel for off the shelf hardware integration.
> I live in the embedded / hardware world but my colleagues working on the higher level software tend think all of the above is necessary for dealing with the hundreds of packages and dependency hell that come with the "modular" robot software approach.
But it's not a huge step to push your packages to debian, and after that rosdep feels totally unnecessary.
> That said, the popular packages in the ecosystem for simulation, planning, robot modeling, etc seem powerful. Community developed ROS "drivers" (middleware integration) are also useful so you don't reinvent the wheel for off the shelf hardware integration.
I agree 100%.
The initial build system "rosbuild" was arguably a main reason ROS1 became successful, because it started making individual robotics packages developed in diverse academic environments reusable by other users (before, each lab had their own half-broken way of building/packaging software).
The buildsystem in it's limited way also had a very low learning curve for junior developers (though not for people trying to package binaries).
ROS1 was initially distributed as source packages, and that combined with a unified buildsystem led to a very low barrier for contributions. By installing ROS all users already had an environment set up in which they could easily modify sources packages from other packages created by people in other organizations, run with modifications and submit patches.
Compare that to installing a library as a binary, suspecting a bug, and then starting to find out where to get the sources, how to build the sources, how to locally build against those sources, etc.
The downside of this was of course packaging binaries was hell. But the bottom line was that this combination (making binary packaging and distribution very hard, while making dirty source builds very easy), was the winning ticket to create a vibrant open-source community with high cohesion and lots of contributions in academia.
ROS is a packaging system for academic robotics software with a message passing layer. It was created by hammering a huge collection of existing software into talking a common protocol. The ROS people also made the distribution buildable as a whole (more or less; it's notorious for breaking due to version pinning problems.) Just having some kind of standard was a big win. It beats downloading multiple pieces of academic software and trying to bash it into cooperating.
I've used ROS and contributed to ROS in a minor way, but I don't like it.
Having said that, it did great things to bring together the community and kill the fragmented landscape of robotics. (Does anyone remember the 2000s-2010s and all the custom, proprietary robot abstraction layers that were built up? Awful.). Clearpath and a number of small vendors partnered well with ROS, pushing the BS off the stage.
But it hasn't aged well ...
The messaging and logging is the only useful component (for me / my teams). The codebases / nodes are abysmally intertwined, over cohesive, and lack a nice unixy modular architecture that I'd expect with something built on top of a message passing layer. The central point of failure is often a very real point of failure in spotty networking environments (dropping from wifi can kill your whole stack, even if all messages are local machine only)
DDS is nice, but everyone serious is pretty much already using it (mil / aero), esp because of shared memory transport. So it's great that they were dragged forward ... but it doesn't quite feel like the big leap that ROS 1.0 was.
I find this sentiment among most researchers and industry people I've talked to at IROS and ICRA. I always make a point to ask what they like about ROS when I find out they're using it and probably 95% of the time the top 2 answers are the message transport layer and rviz (the visualization tool). tf (the frame of reference graph) is sometimes in the top 2, but it's also been a complete pain for me (and others, so much that there are 2 competing versions: tf and tf2) and would be in my bottom 2 features. The rest of it I find most people say they could do without.
On the robots I worked with, I never missed any of those features, to be honest. Largest project of those is a research home service robot, quite different from a self-driving car in terms of reliability requirements. The real-time stuff for motor control there is handled by EtherCAT.
That makes it even worse. So it's crap on top of crap. CMake is mostly used to build cross-platform software, but I don't think anybody uses ROS on a system other than Linux, so why not just use established tools like simple `make`?
I've seen several times that companies write their message passing stuff on top of ZeroMQ, mttq and what-have-you, while they could have spent all that time doing something novel as well. At the cost of using less than perfect tools made by someone else that a lot of people are also using.
[in any folder out of source]
mkdir build
cd build
cmake [source folder]
make
source devel/setup.bash
roslaunch your_fancy_package demonstrator_nodelet_or_whatever.launch
That works, but you can't mix it with catkin_make or other build tools (rosbuild). I.e. you can't just invoke catkin_make there, this won't work afaik.The source folder must contain a main CMakeLists.txt symlink which points to `/opt/ros/[distribution e.g. kinetic]/share/catkin/cmake/toplevel.cmake`. This symlink will be created when calling "catkin_init_workspace". You can also just put a copy of that file there to commit it in git. I do this and even modify it to include my own cmake modules and debugging stuff.
You can now layout your folders any way you want. That means the packages don't need to all be in the same folder, but can be grouped as necessary.
Example project layout:
project
├── cmake
| └── FindSomePackage.cmake
├── doc
| └── index.md
├── project_msgs
| ├── msg
| | ├── Foo.msg
| | └── Bar.msg
| ├── CMakeLists.txt
| └── package.xml
├── project_utils
| ├── include
| | └── project_utils
| | └── foo.h
| ├── launch
| | └── ...
| ├── scripts
| | └── do_stuff.py
| ├── src
| | └── foo.cpp
| ├── CMakeLists.txt
| └── package.xml
├── components
| ├── heisenberg_compensator
| | ├── include
| | | └── ...
| | ├── src
| | | └── ...
| | ├── CMakeLists.txt
| | └── package.xml
| ├── warp_controller
| | ├── include
| | | └── ...
| | ├── src
| | | └── ...
| | ├── CMakeLists.txt
| | └── package.xml
| ├── ...
|
├── .gitignore
├── readme.md
└── CMakeLists.txt -> /opt/ros/[distribution e.g. kinetic]/share/catkin/cmake/toplevel.cmake
should contain set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
You can put software components/packages in folders that are structured similar to project_utils / project_msg on any sublevel, I don't know what happens when you directly nest them though.. I wouldn't do that.https://github.com/gerkey/ros1_external_use
But if you're looking for good documentation and tutorials, then yes catkin is basically required, but I don't think that's unreasonable.
Regarding catkin, I actually think it's an OK solution with some nice features. It's mostly a set of CMake macros that work with a certain conventional structure for packages. If you look at some other (newer) C++ package managers out there, like Hunter or FIPS, it's essentially the same idea. And catkin also supports Python code [1]. It's far from ideal, but it's a hard problem. Like many things in ROS, it's a "worse-is-better" kind of solution.
[1] Not as well as it could, re:pip integration and such; ROS2 supposedly has a better solution.
In my opinion this is no excuse. 10 years ago was 2008 and we had rock solid solutions to these problems - I don't think it was necessary to build custom solutions (and AFAIK catkin is already the successor of rosmake).
But rereading my top-level comment it does seem a little bit harsh, so I want to apologize and hopefully do not discourage ROS developers and the community. ROS is still useful and at least there is an organized effort to make an open-source robot software abstraction layer.
Remark that the robot community (especially in an industrial setting) is plagued with closed-source proprietary software that is even worse, so despite its flaws it's a step in the right direction.
That is supported by most build systems, plain old make can do it, CMake can do it, scons can do it, the list goes on and it is actually not something special in software development. It's not like we were unable to build software consisting of multiple "packages" before catkin or bazel.
I'm not saying that these existing solutions are perfect and the problem in general (dependency hell) is pretty hard to tackle. It's just that I don't see how catkin and the workspace concept help here.
Btw. did you know that catkin_make, successor of rosmake, is already old-school?
It's now "catkin build" - oh no wait, that's again uncool if you go with ROS2, there we have our meta-meta-build system "ament".
#edit: I kid you not, it's now apparently "colcon".
See e.g. the discussion https://discourse.ros.org/t/colcon-amend-tools/4685 and rationalization http://design.ros2.org/articles/build_tool.html.
Workspaces are actually super useful. They're a similar idea to virtualenv and conda environments. If you don't find those useful I don't know what to tell you.
Since ROS2 is essentially a fresh restart I'm not surprised there's some churn. I think most people expect it to be fairly unstable for a while.
I've been working with ROS since nearly the beginning (as well as other middleware solutions) and I definitely see a lot of its flaws, but understand the rationale for a lot of the decisions. It's like C or C++, a 'worse-is-better' solution that's overall pretty decent, specially considering it's open source.
I can appreciate that if you're writing C++ with some Python, this is probably useful. My experience with it was a project that was entirely written in Python, and suddenly having a complex, unfamiliar build system to deal with definitely felt like unnecessary complexity.
As you say, it's a hard problem. You could imagine an easier option for pure Python code, but that just moves the hurdle to the first time you want to compile something in C++.
A few years ago I tried to run a project based on ROS and gave up in the end due to compatibility problems (I was installing ros packages on top of an existing Ubuntu and it caused all kinds of problems). Now that I'm using their pre-built docker image and took the time to read the tutorials, I'm finding it more reliable and much nicer.
The tutorials are very clear and all the steps have "just worked" for me, although the individual packages don't always seem very well documented.
catkin doesn't seem like a heavyweight build system - more like an opinionated layout combined with some cmake macros and some scripts, built on top of cmake. I can see how this would be useful for myself as well as real roboticists to develop multiple packages in parallel without having to poke through complex and disparate build systems. A robotics student would want to dive into C++ or Python as fast as possible as opposed to figuring out the build system, and I think catkin serves this purpose.
Also, it's common for inexperienced linux/mac users to get confused between multiple installations - when they have to compile things from source, i.e. opencv. I wonder if the ros command line tools are partly designed to help students overcome that obstacle, i.e. the pattern roscommand packagename rosoptions.
I'd also argue against the added complexity of avoiding single points of failure during early stage robot development. Having to think about distributed systems and SRE would be a huge distraction from the already complex task of designing a robot and its software. I also very much hope that ROS isn't currently being used in self-driving cars without a lot of safety systems including hardware ones.
https://capablerobot.com/blog/2018/2018-05-09-wheel-reinvent...
There are a whole host of performant, lightweight, and open source tools for distributed-tracking, pub/sub, logging, serialization, service discovery, KV stores, visualization, etc. Right now it seems the robot world (including me) ignores this fact and continues to reinvent wheels (poorly).
I'm curious for feedback on this idea and will be publishing updates as I experiment with this idea. I'll likely be starting with timing & latency experiments between ROS, ROS2, and other cloud-native pub/sub brokers.
But it definitely has its limits, especially as applications mature, and the ecosystem can feel siloed from the technology landscape evolving so quickly in, for example, backend distributed systems. Knowledge transfer between the robotics community and the software engineering happening in distributed systems, databases, gaming, web development, etc. is a huge untapped opportunity. Hit me up if you want to talk more about this!
[1] e.g. http://wiki.ros.org/sensor_msgs
I built:
1) Virtual camera: The robot was equipped with 6 fixed cameras. You can position virtual camera anywhere in the coordinate space and it constructs it's image with the information from the real cameras.
2) System for semi-automatic external calibration of cameras from LIDAR sensor. External calibration is the process of estimating the position and orientation of the camera. This system was not as precise as calibration using calibration patterns in lab, but it was useful when the robot was in the wild and you wanted to adjust the camera or strap a new camera on it quickly. However, to be frank I am not sure ft the system was ever actually used that way. I left the lab after finishing my thesis.
The ROS ecosystem is reasonably simple to understand and definitely makes things much easier. Apart from having some issues with compatibility between versions and incomplete functionality I remember it as quite a nice platform. On the other hand I have not tried any of it's competitors if there are any.
can I read your thesis, or (dare i ask) source code?
I will try some hasty writeup ;)
1) Create a virtual image plane (or cylinder/sphere for panoramic camera) in the 3D space. For this you need to specify the virtual camera's position, orientation, focal length and FOV.
2) Define pixels on the image plane. You need to specify the image resolution and just create grid on the the image plane. Each pixel corresponds to a 3D point in the world coordinate system.
3) To get a color of each pixel you project it's corresponding 3D point to all real cameras. Usually only some of the cameras see the point. Each camera that sees the point gives you a color according to the color of the pixel in it's image. You have to perform blending of these colors. What worked well in our case was to give more weight to cameras where the point projected close to the center of their image.
As you can see, there will definitely be some artifacts, usually more the farther away the virtual camera is from the real cameras. However, it worked to my surprise quite well. It was even possible to look at the robot from 3rd person even though all of the real cameras were on it.
Also it is crucial to have well calibrated cameras. Apart from their projection matrices you also need to consider their radial and tangential distortion which was very significant with our camera models.
https://www.wikiwand.com/en/Pinhole_camera_model
My startup is using it to power an autonomous customer service robot. ROS modules handle things like pose calculations, trajectory planning, collision avoidance, and basically all other interaction between software and hardware. From my perspective as a developer on the user-facing software, it's basically a simple event bus and RPC framework that has a load of prebuilt datatypes and modules for handling common robotics tasks.
Caveats – a lot of modules seem to follow pretty sketchy coding practices compared to what I'm used to in other industries. It seems to be a bit of a paragon of bad design. There also seems to be a lot of version confusion – lots of packages seem to support different subsets of versions, with most of the community possibly on older releases. There's an ongoing ROS 2.0 effort that I think uses MQTT as the transport. But I'm not a ROS expert, so take the above with a grain of salt!
One thing with ROS is that reimplementing it is not particularly difficult: I have, for various reasons and projects (in some cases before ROS was available) implemented basically all the core components of it (to similar levels of completeness and reliability). So the cost of doing it yourself is actually not all that high (and I think people overestimate it).
27 people are listed on their staff page.
Wall cleaning robot (still testing): https://www.youtube.com/watch?v=4dMjt_Pj4og
There are some nice projects on https://discourse.ros.org/c/ros-projects, I really like Kyler Laird's Tractobots: https://www.youtube.com/watch?v=oPI7f5kQRKo
It facilitates work by not having to rewrite a bunch of code every time. Also, most robotic related libraries like OMP, or TF are supported.
At my current job we don't use ROS but being able to look at the ROS drivers of commercial arms is a big help in making our own drivers.
https://scholar.google.com/citations?user=fMDLYCUAAAAJ&hl=en...
Use the 'cited by' link to see thousands of robot projects that use ROS:
https://scholar.google.com/scholar?oi=bibs&hl=en&cites=14376...
(I'm not affiliated with Open Robotics)
I also used it as an intern at a robotics company to use a microsoft kinect as a depth sensor for helping the robot perceive space in three dimensions.
(Please forgive the newbie question. I’m totally completely ignorant about robotics operating systems but interested to learn.)
ROS has a BSD license, so it is even possible that BrainOS is actually using some ROS package or resources. After a quick look, most SW positions at BrainOS mentions than having a prior experience with ROS is a plus.
For simple robots, you can get away with a simple script. But say, you want to attach more sensors, add some visualization, some logging, etc. Pretty soon you'll find yourself writing multithreaded (not great in Python) and/or multiprocess code, some kind of simple GUI to visualize data, some logging code, some way to manage parameters... and before you know it you'll find yourself writing your own little version of ROS (or more generally, robotic middleware). And without the huge ecosystem of ROS packages that might solve all sort of problems for you.
Don't even think about implementing functional safety on your own without a few years of practical safety experience. Even if you get your hands on all the required hardware parts, you will need to spend a lot of time on making sure you tick all the boxes in relevant standards and convincing notified bodies you did your homework. Don't try to do this on your own, hire an experienced professional right from the start of any project which might touch on functional safety.
The system design itself is examined as well as how it is implemented. The examiners will want to see proof that your system fails in predictable and deterministic ways suitable for their usage.
Also systems dealing with the motion-control typically require hard-real-time response so you would not be running this on your average Linux system either.
You need to be prepared to have your code and system design examined in great depth, a very long and expensive process generally.
Word of advice: You need to have a 100% waterproof concept, otherwise your product will _not_ make it to market. Don't try to guess your way around the safety system, it will cost you dear later on.
Get an engineering safety consultant to have a look.
Just stop. Use boring versioning numbers. Your developers and users will thank you.