Add systemd notify
This commit is contained in:
parent
077937f5c6
commit
7a9c4e9f3a
3 changed files with 11 additions and 1 deletions
|
@ -19,7 +19,7 @@ if (UNIX AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL armv7l)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||||
|
|
||||||
find_package(pigpio REQUIRED)
|
find_package(pigpio REQUIRED)
|
||||||
set(LIBRARIES "pigpio" "spdlog::spdlog")
|
set(LIBRARIES "pigpio" "spdlog::spdlog" "systemd")
|
||||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-psabi")
|
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-psabi")
|
||||||
|
|
||||||
set(IS_RASPI true)
|
set(IS_RASPI true)
|
||||||
|
|
|
@ -11,6 +11,12 @@
|
||||||
#include "include/Encoders.hpp"
|
#include "include/Encoders.hpp"
|
||||||
#include "include/networkUtils.hpp"
|
#include "include/networkUtils.hpp"
|
||||||
|
|
||||||
|
#ifdef IS_RASPI
|
||||||
|
|
||||||
|
#include <systemd/sd-daemon.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
@ -23,6 +29,10 @@ int main(int argc, char *argv[]) {
|
||||||
TCPSocketServer tcpSocketServer;
|
TCPSocketServer tcpSocketServer;
|
||||||
HealthChecker::getInstance();
|
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_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);
|
// ClosedLoopMotorController::getInstance().set_speed(ROBOT_ODOMETRY_CONTROLLER_LEFT_PORT, M_PI_4 * ROBOT_ODOMETRY_CONTROLLER_LEFT_MULT);
|
||||||
// OdometryController::getInstance().enable();
|
// OdometryController::getInstance().enable();
|
||||||
|
|
Binary file not shown.
Reference in a new issue