VSM C++ SDK
Vehicle Specific Modules SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
camera_series_by_time_action.h
1 // Copyright (c) 2018, Smart Projects Holdings Ltd
2 // All rights reserved.
3 // See LICENSE file for license details.
4 
8 #ifndef _UGCS_VSM_CAMERA_SERIES_BY_TIME_ACTION_H_
9 #define _UGCS_VSM_CAMERA_SERIES_BY_TIME_ACTION_H_
10 
11 #include <ugcs/vsm/action.h>
12 #include <ugcs/vsm/mavlink.h>
13 
14 namespace ugcs {
15 namespace vsm {
16 
20 
21 public:
22  Camera_series_by_time_action(std::chrono::milliseconds interval,
23  Optional<int> count,
24  std::chrono::milliseconds initial_delay):
25  Action(Type::CAMERA_SERIES_BY_TIME),
26  interval(interval),
27  count(count),
29  {}
30 
35  Action(Type::CAMERA_SERIES_BY_TIME)
36  {
37  int tmp;
38  float time;
39 
40  if (p.at("count")->Get_value(tmp)) {
41  count = tmp;
42  }
43  p.at("period")->Get_value(time);
44  tmp = time * 1000;
45  interval = std::chrono::milliseconds(tmp);
46 
47  p.at("delay")->Get_value(time);
48  tmp = time * 1000;
49  initial_delay = std::chrono::milliseconds(tmp);
50  }
51 
53  std::chrono::milliseconds interval;
55  Optional<int> count;
59  std::chrono::milliseconds initial_delay;
60 };
61 
63 template<>
64 struct Action::Mapper<Action::Type::CAMERA_SERIES_BY_TIME> {
67 };
68 
69 } /* namespace vsm */
70 } /* namespace ugcs */
71 
72 #endif /* _UGCS_VSM_CAMERA_SERIES_BY_TIME_ACTION_H_ */
Definition: property.h:249
std::chrono::milliseconds interval
Time interval between two consequent shots.
Definition: camera_series_by_time_action.h:53
Camera_series_by_time_action(const Property_list &p)
Construct action from protobuf command.
Definition: camera_series_by_time_action.h:34
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
Performs a series of consequent camera shots in a fixed time intervals.
Definition: camera_series_by_time_action.h:18
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25
Optional< int > count
Total number of shots to perform.
Definition: camera_series_by_time_action.h:55
Camera_series_by_time_action type
Real type.
Definition: camera_series_by_time_action.h:66
std::chrono::milliseconds initial_delay
Initial delay.
Definition: camera_series_by_time_action.h:59