Add systemd notify

This commit is contained in:
Konstantin Lampalzer 2022-10-05 23:43:37 +02:00
parent 077937f5c6
commit 7a9c4e9f3a
3 changed files with 11 additions and 1 deletions

View file

@ -19,7 +19,7 @@ if (UNIX AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL armv7l)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
find_package(pigpio REQUIRED)
set(LIBRARIES "pigpio" "spdlog::spdlog")
set(LIBRARIES "pigpio" "spdlog::spdlog" "systemd")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-psabi")
set(IS_RASPI true)

View file

@ -11,6 +11,12 @@
#include "include/Encoders.hpp"
#include "include/networkUtils.hpp"
#ifdef IS_RASPI
#include <systemd/sd-daemon.h>
#endif
using namespace std;
int main(int argc, char *argv[]) {
@ -23,6 +29,10 @@ int main(int argc, char *argv[]) {
TCPSocketServer tcpSocketServer;
HealthChecker::getInstance();
#ifdef IS_RASPI
sd_notify(0, "READY=1");
#endif
// ClosedLoopMotorController::getInstance().set_speed(ROBOT_ODOMETRY_CONTROLLER_RIGHT_PORT, M_PI * ROBOT_ODOMETRY_CONTROLLER_RIGHT_MULT);
// ClosedLoopMotorController::getInstance().set_speed(ROBOT_ODOMETRY_CONTROLLER_LEFT_PORT, M_PI_4 * ROBOT_ODOMETRY_CONTROLLER_LEFT_MULT);
// OdometryController::getInstance().enable();

Binary file not shown.