SOLA
Loading...
Searching...
No Matches
amr_description_scenario.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_CPPS_MANAGER_AMR_DESCRIPTION_SCENARIO_H_
18#define DAISI_CPPS_MANAGER_AMR_DESCRIPTION_SCENARIO_H_
19
20#include "cpps/amr/amr_description.h"
21#include "manager/scenariofile_component.h"
22
23namespace daisi::cpps {
24
26 double max_velocity;
27 double min_velocity;
28 double max_acceleration;
29 double max_deceleration;
30
31 void parse(const YAML::Node &node) {
32 SERIALIZE_VAR(max_velocity);
33 SERIALIZE_VAR(min_velocity);
34 SERIALIZE_VAR(max_acceleration);
35 SERIALIZE_VAR(max_deceleration);
36 }
37
38 AmrKinematics getAmrKinematics() const {
39 return {max_velocity, min_velocity, max_acceleration, max_deceleration};
40 }
41};
42
44 double load_time;
45 double unload_time;
46 std::string load_carrier;
47 float max_payload;
48
49 void parse(const YAML::Node &node) {
50 SERIALIZE_VAR(load_time);
51 SERIALIZE_VAR(unload_time);
52 SERIALIZE_VAR(load_carrier);
53 SERIALIZE_VAR(max_payload);
54 }
55
56 AmrLoadHandlingUnit getLoadHandlingUnit() const {
57 return {load_time, unload_time,
58 amr::AmrStaticAbility(amr::LoadCarrier(load_carrier), max_payload)};
59 }
60};
61
63 std::string device_type;
64 std::string manufacturer;
65 std::string model_name;
66 std::string friendly_name;
67 uint32_t model_number;
68
69 void parse(const YAML::Node &node) {
70 SERIALIZE_VAR(device_type);
71 SERIALIZE_VAR(manufacturer);
72 SERIALIZE_VAR(model_name);
73 SERIALIZE_VAR(friendly_name);
74 SERIALIZE_VAR(model_number);
75 }
76
77 AmrProperties getAmrProperties() const {
78 return {manufacturer,
79 model_name,
80 model_number,
81 device_type,
82 friendly_name,
83 {FunctionalityType::kLoad, FunctionalityType::kMoveTo, FunctionalityType::kUnload,
84 FunctionalityType::kNavigate}};
85 }
86};
87
89 AmrKinematicsScenario kinematics;
90 AmrLoadHandlingScenario load_handling;
91 AmrPropertiesScenario properties;
92
93 void parse(const YAML::Node &node) {
94 SERIALIZE_VAR(kinematics);
95 SERIALIZE_VAR(load_handling);
96 SERIALIZE_VAR(properties);
97 }
98
99 AmrDescription getAmrDescription() const {
100 AmrPhysicalProperties physical_props; // TODO define in future?
101 return {1, kinematics.getAmrKinematics(), properties.getAmrProperties(), physical_props,
102 load_handling.getLoadHandlingUnit()};
103 }
104};
105
106} // namespace daisi::cpps
107
108#endif
Definition amr_description.h:27
Definition amr_kinematics.h:23
Definition amr_load_handling_unit.h:26
Definition amr_physical_properties.h:25
Definition amr_properties.h:28
Definition amr_static_ability.h:32
Definition amr_load_carrier.h:29
Definition amr_description_scenario.h:88
Definition amr_description_scenario.h:25
Definition amr_description_scenario.h:43
Definition amr_description_scenario.h:62