VSM C++ SDK
Vehicle Specific Modules SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
panorama_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_PANORAMA_ACTION_H_
9 #define _UGCS_VSM_PANORAMA_ACTION_H_
10 
11 #include <ugcs/vsm/action.h>
12 #include <ugcs/vsm/mavlink.h>
13 #include <chrono>
14 
15 namespace ugcs {
16 namespace vsm {
17 
24 class Panorama_action: public Action {
26 
27 public:
29  Panorama_action(proto::Panorama_mode trigger_state, double angle, double step,
30  std::chrono::milliseconds delay, double speed):
31  Action(Type::PANORAMA), trigger_state(trigger_state),
32  angle(angle), step(step), delay(delay), speed(speed)
33  {}
34 
39  Action(Type::PANORAMA)
40  {
41  int tmp;
42  float time;
43  p.at("mode")->Get_value(tmp);
44  trigger_state = static_cast<proto::Panorama_mode>(tmp);
45  p.at("angle")->Get_value(angle);
46  p.at("step")->Get_value(step);
47  p.at("delay")->Get_value(time);
48  tmp = time * 1000;
49  delay = std::chrono::milliseconds(tmp);
50  p.at("speed")->Get_value(speed);
51  }
52 
54  proto::Panorama_mode trigger_state;
55 
60  double angle;
61 
65  double step;
66 
68  std::chrono::milliseconds delay;
69 
71  double speed;
72 };
73 
75 template<>
76 struct Action::Mapper<Action::Type::PANORAMA> {
79 };
80 
81 } /* namespace vsm */
82 } /* namespace ugcs */
83 
84 #endif /* _UGCS_VSM_PANORAMA_ACTION_H_ */
Definition: property.h:249
std::chrono::milliseconds delay
Delay interval between two steps.
Definition: panorama_action.h:68
double step
Absolute value of a step angle in case of a discrete shooting.
Definition: panorama_action.h:65
double speed
Rotation speed in radians per second.
Definition: panorama_action.h:71
Type
Types of vehicle actions as part of task (mission).
Definition: action.h:30
Generic action.
Definition: action.h:22
Generic action.
Map Action type enum value to specific Action type class.
Definition: action.h:120
double angle
Target panorama angle in a range [-2Pi, 2Pi].
Definition: panorama_action.h:60
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25
Panorama_action type
Real type.
Definition: panorama_action.h:78
Panorama action.
Definition: panorama_action.h:24
Panorama_action(const Property_list &p)
Construct action from protobuf command.
Definition: panorama_action.h:38
proto::Panorama_mode trigger_state
Trigger state.
Definition: panorama_action.h:54