55 points · by kscottz · 3y ago · 73 comments
Calling out a couple changes I'm excited about that we (Foxglove) helped contribute to:
- MCAP is now the default logging format in Rosbag2[0]. This is a much more performant and configurable format than the previous default (SQLite-based). SQLite is still a fully supported alternative.
- Message type definitions (schemas) can now be exchanged at runtime[1]. This means that tools such as rosbag2, or visualization tools such as Foxglove Studio[2] can now communicate with a ROS system over the network without needing a copy of the source code or complete ROS workspace.
[0] https://github.com/ros2/rosbag2/pull/1160
It'd be like if you designed a video game so that the physics engine (motion planning) happened in one process, while rendering (perception) happened in another process and the world state needed to be exchanged via pubsub. Why do we keep doing this to ourselves?
- a large amount of data can be transferred asynchronously. Pub/Sub is a great pattern to achieve that; the cases when you need a synchronous interface are the minority.
- a robotic software has MANY components, you need an approach that incentivize decoupling and lousily-coupled interfaces.
- this lousily-coupled architecture has been a catalyst for innovation and cooperation, because it makes it easier for people to share their code as "building blocks" of a larger system.
Is there a considerable overhead? Sure! But it is much more complicated to write thread-safe code in a huge, monolithic application.
Loose coupling is good if you mainly use open-source packages and modify one component for your research paper. I'm not sure it's a net positive when building most components yourself.
A big multithreaded program can still use queues instead of locks to share data between threads.
Everyone's working on their own ROS nodes in isolation....with no thought to eventual integration testing? It doesn't seem like that is a fundamental shortcoming specific to ROS.
ROS provides a plug-in backplane that allows you to innovate in one area while leveraging existing components for parts that are not your differentiator.
Just make a multi-threaded app, and call functions. If you need to distribute over multiple CPUs, then go ahead and do some IPC. But pub/sub is NOT an architecture. Its a soup of tightly coupled fragments of functionality. It falls apart very quickly in the real world.
"Just" a multi-threaded app and calling functions isn't really a good replacement. For something really basic, sure, but the modularity that ROS introduces, and the core principle of having serialisable recordable messages delivers a lot of value once you start building large systems - particularly those that can span multiple physical machines. But pub-sub is _too_ general as a concurrency model, if ROS had adopted something more constrained that was provably deterministic and was amenable to real time analysis then a lot of its concerns would go away.
I'd be interested, though, in your suggestions on what a real architecture for robotics looks like in your mind? I still remember the time before ROS, 20 years ago, when each robotics team had to designate a sub-team just for building and maintaining the middleware. That was a waste of time and effort. But you seem to suggest that we go back to that? ROS might not be perfect but it's so much better than anything else that exists. It's also open source and we can all work together to make it better rather than reinventing the wheel each time.
The hard parts were never in the middleware (ROS), but stuff like perception, world modelling, decision making. ROS gives you an ecosystem of decent options to choose from. And improve on if you need to at all.
The standardized interfaces and IPC make it very easy to plug, at runtime, eg. a different localization algorithm into the system.
Heh, yes. At some RoboCup@Home competition (IIRC, Mexico City in 2012 so a while back), a team came in super confident, saying everything worked and they were going to win. Most of it worked ok in the lab, and well in the simulator too, they said. Didn't make it to the 2nd stage I think. And RoboCup is still not exactly 'the wild' for robots.
while(true) { read sensors update world model decide what to do act }
You should only deviate from this when you have a specific reason (concurrency, libraries, IPC, etc). You can attach a debugger. You can deterministically play sensor data through and get great reproducibility for end-to-end testing. Starting with a distributed system is a handicap 80% of the time.
I've seen various half-assed versions or something akin to ROS (IPC to have process isolation and distributed, with some processes running on a RTOS) seen built over the years. All of which sucked in different ways. Especially a tool like RViz is always missing. And in many many robotics video I see (of a moderately complex robot), there's ROS's RViz on some screen.
I would love the future robotics development stack to be more modular, so that (for example) future middleware solutions don't need to also bundle their own visualization software. This was direct inspiration for creating Foxglove Studio[0] for visualization and MCAP[1] for logging - both work great with ROS, or equally well without it.
The machine was not a 'robot' per se, but there was many sensors, decision making, actuation, so kinda like a robot.
For debugging the images and calibration transforms, we needed to write custom stuff. The whole thing was akin to ROS, with a couple days it could have been made to work with it. But alas
It does have some real further mindshare. I noticed GM/Eclipse Foundation's new uProtocol has support for it. https://hn.algolia.com/?query=Uprotocol&sort=byDate&type=sto...
From my understanding ROS2 chose it because it had decent mindshare in automotive and some other industrial fields.
The core data serialization isn’t too terrible. I’ve been working toward writing an embedded version in Nim. The spec is simpler than it seems.
The biggest downside to ROS2 is the multiple layers of abstraction combined with a bespoke meta-build system. To be fair, it’s still simpler than diving into the grpc c++ library IMHO.
I think the wire format is fixed, but it’s pretty simple. The serialization layer (CDR) is swappable, but mostly all the same, though one of the most popular implementations uses a slightly non-standard FastCDR. Though from my testing it produces the same bytes and the CDR spec was updated. Maybe they match now.
I wish there was a better implementers guide. DDS might be a decent alternative to MQTT for more generic embedded if so.
(2) Then try to build something based on turtlebot or similar platform. Start with just something you can make roam around your house and do stuff.
(3) If you can afford to budget something like $5k+ to it overall, it will be a lot easier. I have seen people try to do everything on a shoestring and it makes things a lot harder. The reason is hardware is hard, and you can move a lot faster if you can just throw things at it. E.g. instead of getting 1 Rasberry Pi or Jetson, get 2-3. Get extra cameras, get 2 extra bases.
A buddy and I got a fully working robot roaming around the house doing basic stuff (chasing dogs, etc) in about 3 months, but we both would just show up with new parts. Having a 3d printer is helpful to make things looking good, but not necessary.
Well it sounds like you’re a bit beyond being a just hobbyist if you’re pursuing formal education. Sorry if this is just me being ignorant , but does your masters programs have any career resources you could look into?
We first tried with a raspberry pi based autopilot, it crashed and we rebuilt it again and again until we realized the GPS was broken.
Example code from the project for inspiration: https://github.com/bachelor-2020