VSM C++ SDK
Vehicle Specific Modules SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
camera_trigger_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_CAMERA_TRIGGER_ACTION_H_
9 #define _UGCS_VSM_CAMERA_TRIGGER_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 
21 
22 public:
24  Camera_trigger_action(proto::Camera_mission_trigger_state state, std::chrono::milliseconds interval):
25  Action(Type::CAMERA_TRIGGER),
26  state(state), interval(interval) {}
27 
32  Action(Type::CAMERA_TRIGGER),
33  interval(1000) /* Currently not supported by protocol. */
34  {
35  int tmp;
36  p.at("state")->Get_value(tmp);
37  state = static_cast<proto::Camera_mission_trigger_state>(tmp);
38  }
39 
41  proto::Camera_mission_trigger_state state;
42 
46  std::chrono::milliseconds interval;
47 };
48 
50 template<>
51 struct Action::Mapper<Action::Type::CAMERA_TRIGGER> {
54 };
55 
56 } /* namespace vsm */
57 } /* namespace ugcs */
58 
59 #endif /* _UGCS_VSM_CAMERA_TRIGGER_ACTION_H_ */
Definition: property.h:250
proto::Camera_mission_trigger_state state
Camera trigger state.
Definition: camera_trigger_action.h:41
Type
Types of vehicle actions as part of task (mission).
Definition: action.h:30
Generic action.
Definition: action.h:22
Camera trigger action.
Definition: camera_trigger_action.h:19
Generic action.
Map Action type enum value to specific Action type class.
Definition: action.h:120
Camera_trigger_action type
Real type.
Definition: camera_trigger_action.h:53
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25
std::chrono::milliseconds interval
Interval between two consequent camera shots in case of serial triggering (State::SERIAL_PHOTO).
Definition: camera_trigger_action.h:46
Camera_trigger_action(const Property_list &p)
Construct action from protobuf command.
Definition: camera_trigger_action.h:31