add top bar
This commit is contained in:
38
src/robot/robot_runtime.hpp
Normal file
38
src/robot/robot_runtime.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
namespace lm {
|
||||
|
||||
class MissionQueue;
|
||||
|
||||
class RobotRuntime
|
||||
{
|
||||
public:
|
||||
explicit RobotRuntime(std::filesystem::path runtime_path, MissionQueue& mission_queue);
|
||||
|
||||
nlohmann::json status() const;
|
||||
bool start(std::string& err);
|
||||
bool pause(std::string& err);
|
||||
bool resetError(std::string& err);
|
||||
bool setCmdVel(double linear, double angular, std::string& err);
|
||||
bool setJoystick(bool engaged, const std::string& speed, std::string& err);
|
||||
void tick();
|
||||
|
||||
private:
|
||||
std::filesystem::path runtime_path_;
|
||||
MissionQueue& mission_queue_;
|
||||
mutable std::mutex mu_;
|
||||
nlohmann::json state_;
|
||||
|
||||
void load();
|
||||
void saveUnlocked() const;
|
||||
void ensureDefaultsUnlocked();
|
||||
nlohmann::json buildStatusUnlocked() const;
|
||||
};
|
||||
|
||||
} // namespace lm
|
||||
Reference in New Issue
Block a user