VSM C++ SDK
Vehicle Specific Modules SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
landing_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 
9 #ifndef _UGCS_VSM_LANDING_ACTION_H_
10 #define _UGCS_VSM_LANDING_ACTION_H_
11 
12 #include <ugcs/vsm/action.h>
13 #include <ugcs/vsm/coordinates.h>
14 #include <ugcs/vsm/mavlink.h>
15 
16 namespace ugcs {
17 namespace vsm {
18 
20 class Landing_action: public Action {
22 
23 public:
26  double descend_rate, double acceptance_radius) :
27  Action(Type::LANDING),
28  position(position),
29  heading(heading),
30  elevation(elevation),
31  descend_rate(descend_rate),
33 
38  Action(Type::LANDING),
39  position(Geodetic_tuple(0, 0, 0))
40  {
41  double lat = 0, lon = 0, alt = 0;
42  auto pi = p.find("latitude");
43  if (pi != p.end()) {
44  pi->second->Get_value(lat);
45  }
46  pi = p.find("longitude");
47  if (pi != p.end()) {
48  pi->second->Get_value(lon);
49  }
50  pi = p.find("altitude_amsl");
51  if (pi != p.end()) {
52  pi->second->Get_value(alt);
53  }
54  position = Geodetic_tuple(lat, lon, alt);
55  p.at("acceptance_radius")->Get_value(acceptance_radius);
56  p.at("heading")->Get_value(heading);
57  p.at("descent_rate")->Get_value(descend_rate);
58  p.at("ground_elevation")->Get_value(elevation);
59  }
60 
64 
66  double heading;
67 
71  double elevation;
72 
74  double descend_rate;
75 
79 };
80 
82 template<>
83 struct Action::Mapper<Action::Type::LANDING> {
86 };
87 
88 } /* namespace vsm */
89 } /* namespace ugcs */
90 
91 #endif /* _UGCS_VSM_LANDING_ACTION_H_ */
Landing_action type
Real type.
Definition: landing_action.h:85
Definition: property.h:249
double elevation
Elevation in meters (i.e.
Definition: landing_action.h:71
Coordinates tuple for geodetic CS.
Definition: coordinates.h:36
Type
Types of vehicle actions as part of task (mission).
Definition: action.h:30
Generic action.
Definition: action.h:22
Wgs84_position position
Landing position.
Definition: landing_action.h:63
double heading
Heading in radians.
Definition: landing_action.h:66
Generic action.
Map Action type enum value to specific Action type class.
Definition: action.h:120
double descend_rate
Descending rate, m/s.
Definition: landing_action.h:74
Land at the specified position.
Definition: landing_action.h:20
Landing_action(const Property_list &p)
Construct move action from protobuf command.
Definition: landing_action.h:37
double acceptance_radius
Acceptance radius of the position.
Definition: landing_action.h:78
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25
Coordinates manipulation.