MiniROS is a standalone ROS distribution with minimum external requirements.
Contents:
- All serialization code from roscpp.
- All client code from roscpp.
- rosbag_storage library for interaction with rosbag files from C++.
- rostime. It is still not tested.
- include/generated contains generated code for std_msgs and common_msg
This project has reduced number of external dependencies and can be built using any c++14 compiler.
It also can work without catkin, but you still need catkin and gencxx to generate headers for new message types.
# We need to initialize git submodules to bzip2 and lz4
git submodule update --init
# Regular cmake build.
mkdir build
cd build
cmake ..
make
It generates libminiroscpp.so
library, that contains all the code inside.
You can force miniros use system version of bzip by setting CMake option MINIROS_USE_SYSTEM_BZIP2=ON
. MINIROS_USE_SYSTEM_LZ4
does the same for lz4.
TODO: test install scripts
You can build miniros alongside with your project sources. The project can have the following structure:
some_project
|- thirdparty
| \ miniroscpp
| ...
\- CMakeLists.txt
Somewhere in a root CMakeLists.txt:
# Adding miniros to the project.
add_subdirectory(thirdparty/miniroscpp)
Adding miniros to a target:
add_executable(some_executable main.cpp)
# Linking miniros using a direct name.
# All necessary includes will be added to target `some_executable` automatically
target_link_libraries(some_executable miniros::roscxx miniros::bag_storage)
# Adding paths to pregenerated headers.
target_include_directories(some_executable PRIVATE ${MINIROS_INCLUDE_GENERATED_DIRS})
- ROSBag C++ client is complete. It is an independent library. No boost or big external libraries are required.
- Ported ROS C++ client code to use only c++17.
- Ported rosbag play and record utilities.
- Added some tests from original ros_comm package. Though they do not work without some external rosmaster.
Missing things:
- This is not a complete ROS distribution. You still need regular ROS tools, like roslaunch, rostopic or rosmaster somewhere else. This is just a portable C++ client, which helps connecting ROS system from the projects, where using regular ROS is not the best idea.
- ROS logging is probably broken right now.
- Full testing from ros_comm is also missing.
Since miniros is experimental distribution, I am free to improve core API. These are possible directions:
- Rework global initialization: ros::init should return some sort of a context.
All global variables should be moved to this context.
NodeHandle
should use either this context, or parent node in its constructor. This alows implementing nodelet approach without using separate API. - Ticket-based API for ros services: resolve issues with crashing server.
- Reduce compilation time by moving some exposed class fields to "Impl" section.
- Test everything on android.
- Test everything on windows.
Current codebase is an adaptation of the following ROS packages:
** roscpp_core ** (http://wiki.ros.org/roscpp_core)
- cpp_common
- roscpp_traits - all headers have gone to include/miniros/...
- roscpp_serialization - all code moved to include/miniros and src accordingly.
- rostime - all code moved to include/miniros and src accordingly.
** ros_comm** (http://wiki.ros.org/ros_comm)
- roslz4 - used by rosbag. Moved to src/roslz4.
- tools/rosbag_storage - core rosbag library. It was renamed to minibag and merged.
** console_bridge** (http://wiki.ros.org/console_bridge)
** topic_tools**
- ShapeShifter - it was ported here for rosbag app.
I use experimental version of bzip2 from https://gitlab.com/federicomenaquintero/bzip2. It has handy CMake support.
I am using official lz4
This code is licenced under BSD-3 license. Original code was licenced under BSD-3 license as well.