CreOS SDK
The CreOS SDK allows you to interact with Avular robots
 
Loading...
Searching...
No Matches
command.hpp
1// Copyright (C) 2024 Avular Holding B.V. - All Rights Reserved
2// You may use this code under the terms of the Avular
3// Software End-User License Agreement.
4//
5// You should have received a copy of the Avular
6// Software End-User License Agreement license with
7// this file, or download it from: avular.com/eula
8//
9/*****************************************************************************
10 * Created on: 2024 July 23
11 * Author: Robbert-Jan de Jager
12 *
13 * Implementation of the command message.
14 ****************************************************************************/
15#pragma once
16
17#include <array>
18#include <creos/robot_clock.hpp>
19#include <nlohmann/json.hpp>
20
21namespace creos_messages {
22
26struct Command {
27 enum class Action {
29 kArm,
30 kDisarm,
31 kTakeOff,
32 kLand,
33 kEmergencyLand,
34 kKillSwitch,
35 kAbortCurrentAction,
36 };
37
41 Action action = Action::kUnknown;
42};
43
44NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Command, action)
45
46
49struct CommandStamped : public Command {
53 creos::RobotClock::time_point timestamp;
54};
55
56NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(CommandStamped, action, timestamp)
57
58} // namespace creos_messages
The messages that are used in the communication between the agent and the client.
Definition accel.hpp:22
@ kUnknown
Unknown error.
Command message containing the command to send to the robot.
Definition command.hpp:26
Action action
Construct action.
Definition command.hpp:41
Command message containing the command to send to the robot, with a timestamp.
Definition command.hpp:49
creos::RobotClock::time_point timestamp
Timestamp of the command.
Definition command.hpp:53