VSM C++ SDK
Vehicle Specific Modules SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
takeoff_action.h
Go to the documentation of this file.
1 // Copyright (c) 2018, Smart Projects Holdings Ltd
2 // All rights reserved.
3 // See LICENSE file for license details.
4 
8 #ifndef _UGCS_VSM_TAKEOFF_ACTION_H_
9 #define _UGCS_VSM_TAKEOFF_ACTION_H_
10 
11 #include <ugcs/vsm/action.h>
12 #include <ugcs/vsm/optional.h>
13 
14 namespace ugcs {
15 namespace vsm {
16 
18 class Takeoff_action: public Action {
20 
21 public:
24  double climb_rate, double acceptance_radius) :
25  Action(Type::TAKEOFF),
26  position(position),
27  heading(heading),
28  elevation(elevation),
29  climb_rate(climb_rate),
31 
36  Action(Type::TAKEOFF),
37  position(Geodetic_tuple(0, 0, 0))
38  {
39  double lat = 0, lon = 0, alt = 0;
40  auto pi = p.find("latitude");
41  if (pi != p.end()) {
42  pi->second->Get_value(lat);
43  }
44  pi = p.find("longitude");
45  if (pi != p.end()) {
46  pi->second->Get_value(lon);
47  }
48  pi = p.find("altitude_amsl");
49  if (pi != p.end()) {
50  pi->second->Get_value(alt);
51  }
52  position = Geodetic_tuple(lat, lon, alt);
53  p.at("acceptance_radius")->Get_value(acceptance_radius);
54  p.at("heading")->Get_value(heading);
55  p.at("climb_rate")->Get_value(climb_rate);
56  p.at("ground_elevation")->Get_value(elevation);
57  }
58 
62 
64  double heading;
65 
67  double elevation;
68 
70  double climb_rate;
71 
75 };
76 
78 template<>
79 struct Action::Mapper<Action::Type::TAKEOFF> {
82 };
83 
84 } /* namespace vsm */
85 } /* namespace ugcs */
86 
87 #endif /* _UGCS_VSM_TAKEOFF_ACTION_H_ */
Definition: property.h:249
Takeoff_action type
Real type.
Definition: takeoff_action.h:81
Coordinates tuple for geodetic CS.
Definition: coordinates.h:36
Wgs84_position position
Take-off position.
Definition: takeoff_action.h:61
Type
Types of vehicle actions as part of task (mission).
Definition: action.h:30
double elevation
Terrain height in meters underneath the position.
Definition: takeoff_action.h:67
Generic action.
Definition: action.h:22
Takeoff_action(const Property_list &p)
Construct move action from protobuf command.
Definition: takeoff_action.h:35
double acceptance_radius
Acceptance radius of the position.
Definition: takeoff_action.h:74
double climb_rate
Climbing rate, in meters per second.
Definition: takeoff_action.h:70
Generic action.
Map Action type enum value to specific Action type class.
Definition: action.h:120
double heading
Heading in radians.
Definition: takeoff_action.h:64
Take off from the specified position and reach specified altitude.
Definition: takeoff_action.h:18
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25