VSM C++ SDK
Vehicle Specific Modules SDK
camera_control_action.h
Go to the documentation of this file.
1 // Copyright (c) 2014, Smart Projects Holdings Ltd
2 // All rights reserved.
3 // See LICENSE file for license details.
4 
8 #ifndef _CAMERA_CONTROL_ACTION_H_
9 #define _CAMERA_CONTROL_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 
24  Camera_control_action(double tilt, double roll, double yaw, double zoom) :
25  Action(Type::CAMERA_CONTROL),
26  tilt(tilt), roll(roll), yaw(yaw), zoom(zoom) {}
27 
33  Camera_control_action(const mavlink::ugcs::Pld_mission_item_ex& item) :
34  Action(Type::CAMERA_CONTROL),
35  tilt(item->param1 * M_PI / 180.0),
36  roll(item->param2 * M_PI / 180.0),
37  yaw(item->param3 * M_PI / 180.0),
38  zoom(item->param4)
39  {
40  ASSERT(item->command == mavlink::ugcs::MAV_CMD::MAV_CMD_DO_PAYLOAD_CONTROL);
41  }
42 
47  Action(Type::CAMERA_CONTROL)
48  {
49  p.at("tilt")->Get_value(tilt);
50  p.at("roll")->Get_value(roll);
51  p.at("yaw")->Get_value(yaw);
52  p.at("zoom_level")->Get_value(zoom);
53  }
54 
58  double tilt;
59 
63  double roll;
64 
68  double yaw;
69 
71  double zoom;
72 };
73 
75 template<>
79 };
80 
81 } /* namespace vsm */
82 } /* namespace ugcs */
83 
84 #endif /* _CAMERA_CONTROL_ACTION_H_ */
UGCS root namespace.
Definition: android-linux/ugcs/vsm/platform_sockets.h:27
Camera control action ugcs::vsm::Camera_control_action.
Definition: property.h:191
Camera_control_action type
Real type.
Definition: camera_control_action.h:78
double zoom
Device specific camera zoom level.
Definition: camera_control_action.h:71
Type
Types of vehicle actions as part of task (mission).
Definition: action.h:30
Camera_control_action(const Property_list &p)
Construct action from protobuf command.
Definition: camera_control_action.h:46
Generic action.
Definition: action.h:22
#define ASSERT(x)
No action in release.
Definition: debug.h:68
Generic action.
Map Action type enum value to specific Action type class.
Definition: action.h:117
#define M_PI
PI constant.
Definition: coordinates.h:21
Camera control action.
Definition: camera_control_action.h:18
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25
Camera_control_action(const mavlink::ugcs::Pld_mission_item_ex &item)
Construct camera control action from Mavlink mission item.
Definition: camera_control_action.h:33
double roll
Target camera roll value in radians: [-Pi/2, Pi/2], where -Pi/2 stands for left and Pi/2 for right...
Definition: camera_control_action.h:63
double tilt
Target camera tilt value in radians: [-Pi/2, Pi/2], where -Pi/2 stands for looking backward...
Definition: camera_control_action.h:58
double yaw
Target camera yaw value in radians: [-Pi/2, Pi/2], where -Pi/2 stands for left and Pi/2 for right...
Definition: camera_control_action.h:68