- People who do not require desktop and web applications.
- Realtime and high performance.
- Finish the entire project quickly and reliably.
- Don't want to care about the differences in APIs.
Platform Peripheral Support List
- The application will never exit unless it reboot or enter into low-power mode.
- All memory is only allocated during initializtion and will never be released.
- The minimum Non-blocking delay is 1us, minimum blocking delay is 1ms.
- All unused functions will not be linked.
System |
Thread | Timer | Semaphore | Mutex | Queue | ASync |
---|---|---|---|---|---|---|
None | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
FreeRTOS | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
ThreadX | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Linux | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Webots(Linux) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
WebAssembly(SingleThread) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Structure |
List | Stack | RBTree | LockFreeQueue | LockFreeList |
---|---|---|---|---|---|
✅ | ✅ | ✅ | ✅ | ✅ |
Middleware |
Event | Message | Ramfs | Terminal | Database | Log |
---|---|---|---|---|---|---|
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Some useful tools for debugging, robotics, and communication.
Kinematics | Forward-Kinematics | Inverse-Kinematics | Coordinate | Pose and Position |
---|---|---|---|---|
✅ | ✅ | ❌ | ✅ |
Dynamics | Inertia | Torque | G-Compensation |
---|---|---|---|
✅ | ❌ | ❌ |
Control | PID | LQR | MPC |
---|---|---|---|
✅ | ❌ | ❌ |
Signal | LP Filter | Kalman Filter | FFT | FunctionGen |
---|---|---|---|---|
❌ | ❌ | ❌ | ❌ |
Math | CycleValue | CRC8/16/32 | Triangle |
---|---|---|---|
✅ | ✅ | ❌ |
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# LibXR
set(LIBXR_SYSTEM FreeRTOS) # None/Linux/FreeRTOS...
set(LIBXR_DRIVER st) # st/Linux/...
add_subdirectory(path_to_libxr)
target_link_libraries(${CMAKE_PROJECT_NAME}
xr
)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
PUBLIC $<TARGET_PROPERTY:xr,INTERFACE_INCLUDE_DIRECTORIES>
)
By default, the host system (Linux, Windows) is automatically detected, and LIBXR_SYSTEM
and LIBXR_DRIVER
are set accordingly. You can also manually specify them via the CMake command line or in an external CMakeLists.txt
, corresponding to the different folders under system and driver.
# Manually specify system and driver
set(LIBXR_SYSTEM Linux)
set(LIBXR_DRIVER Linux)
By default, the library is built as an object target. You can explicitly set the build type in the CMake command line or your own CMakeLists.txt:
# Build as a shared library
set(LIBXR_SHARED_BUILD True)
# Build as a static library
set(LIBXR_STATIC_BUILD True)
This option disables building the Eigen library and will also disable any code depending on Eigen. This is useful for platforms with incomplete C++ standard library support.
set(LIBXR_NO_EIGEN True)
The default scalar type is double
. This option only affects the default value for constructors.
set(LIBXR_DEFAULT_SCALAR float)
Defaults to 128 for bare-metal/RTOS platforms, and 1024 for Linux. This option sets the buffer size for the LibXR::STDIO::Printf
function. Setting this to 0 will disable all log printing.
set(LIBXR_PRINTF_BUFFER_SIZE 256)
Defaults to 64 for bare-metal/RTOS, and 256 for Linux.
set(XR_LOG_MESSAGE_MAX_LEN 256)
Levels 4-0 correspond to DEBUG, INFO, PASS, WARNING, and ERROR, with the default set to 4. This option determines the maximum log level allowed to be published to topics.
set(LIBXR_LOG_LEVEL 4)
Levels 4-0 correspond to DEBUG, INFO, PASS, WARNING, and ERROR, with the default set to 4. This option determines the maximum log level allowed to be printed to STDIO::write_
.
Enable this option to build unit tests on the Linux platform.
set(LIBXR_TEST_BUILD True)