This repository contains the source code for the Horus SDK, which provides access to Horus services.
The SDK is available in two languages:
- C++14, with (planned) Autosar compliance.
- Python 3.8.
Building the SDK requires the following dependencies to be installed:
clang
>=10 orgcc
>=9.4- Development happens with
clang
>=18 as it provides more checks.
- Development happens with
cmake
>=3.20
The source code of the C++ SDK lives in cpp
, and is built using CMake. Clients
should primarily use the horus::Sdk
class defined in cpp/horus/sdk.h
-
Add a CMake dependency to Horus. For instance, the code below uses
FetchContent
to import the Horus project from GitHub:include(FetchContent) FetchContent_Declare(horus GIT_REPOSITORY https://github.com/seoulrobotics/horus-sdk.git GIT_TAG ... SOURCE_SUBDIR cpp ) FetchContent_MakeAvailable(horus)
The
horus::sdk
target can then be used:target_link_libraries(${target} horus::sdk)
-
Include
horus/sdk.h
to use thehorus::Sdk
class:#include "horus/sdk.h" horus::Sdk sdk;
For usage documentation, see documentation comments on the
horus::Sdk
class and all the classes it refers to.
Examples for using the SDK exist in cpp/examples
.
Note
The SDK is implemented using a library called horus::core
, which defines all
the RPC, concurrency, and Protobuf helpers used by the SDK. Unlike
horus::sdk
, this library makes no compatibility guarantees, and its API may
change at any time.
Generally, APIs defined in horus/sdk.h
and horus/sdk/*.h
, as well as APIs
indirectly exposed by these headers (e.g. pb::Log
in
horus::sdk::LogSubscriptionRequest
) are stable. All other APIs (including
external dependencies) are considered implementation details, and may change
without notice.
The source code of the Python SDK lives in py
, and uses asyncio
. See
py/README.md
for more information.
import asyncio
import horus
async def print_logs():
sdk = horus.Sdk()
async with sdk.subscribe_to_logs(on_log_message=print):
...
See py/examples/print_logs.py
for an example.