VSM C++ SDK
Vehicle Specific Modules SDK
heading_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 _HEADING_ACTION_H_
9 #define _HEADING_ACTION_H_
10 
11 #include <ugcs/vsm/action.h>
12 #include <ugcs/vsm/mavlink.h>
13 
14 namespace ugcs {
15 namespace vsm {
16 
21 class Heading_action: public Action {
23 
24 public:
25 
28  Action(Type::HEADING),
29  heading(heading) {}
30 
31 
38  Heading_action(const mavlink::ugcs::Pld_mission_item_ex& item) :
39  Action(Type::HEADING),
40  heading(item->param1 * M_PI / 180.0)
41  {
42  ASSERT(item->command == mavlink::MAV_CMD::MAV_CMD_CONDITION_YAW);
43  if (item->param4) {
45  "Heading action wrong angle type %f", item->param4.Get());
46  }
47  }
48 
52  double heading;
53 };
54 
56 template<>
60 };
61 
62 } /* namespace vsm */
63 } /* namespace ugcs */
64 
65 #endif /* _HEADING_ACTION_H_ */
UGCS root namespace.
Definition: android-linux/ugcs/vsm/platform_sockets.h:27
Change the heading of a vehicle.
Definition: heading_action.h:21
Exception class with one parameter.
Definition: exception.h:88
Type
Types of vehicle actions as part of task (mission).
Definition: action.h:30
Generic action.
Definition: action.h:22
Heading_action type
Real type.
Definition: heading_action.h:59
#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
double heading
Heading in radians.
Definition: heading_action.h:52
#define M_PI
PI constant.
Definition: coordinates.h:21
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25
#define VSM_EXCEPTION(__exc_class, __msg,...)
Throw VSM exception instance.
Definition: exception.h:170
Heading_action(const mavlink::ugcs::Pld_mission_item_ex &item)
Construct heading action from Mavlink mission item.
Definition: heading_action.h:38
Heading ugcs::vsm::Heading_action.