VSM C++ SDK
Vehicle Specific Modules SDK
change_speed_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 
10 #ifndef _CHANGE_SPEED_ACTION_H_
11 #define _CHANGE_SPEED_ACTION_H_
12 
13 #include <ugcs/vsm/action.h>
14 #include <ugcs/vsm/mavlink.h>
15 #include <ugcs/vsm/coordinates.h>
16 
17 namespace ugcs {
18 namespace vsm {
19 
21 class Change_speed_action: public Action {
23 
24 public:
25 
27  Change_speed_action(float h_speed, float v_speed) :
28  Action(Type::CHANGE_SPEED),
29  speed(h_speed),
30  vertical_speed(v_speed)
31  {}
32 
38  Change_speed_action(const mavlink::ugcs::Pld_mission_item_ex& item) :
39  Action(Type::CHANGE_SPEED),
40  speed(item->param1),
41  vertical_speed(item->param2)
42  {
43  ASSERT(item->command == mavlink::ugcs::MAV_CMD::MAV_CMD_DO_CHANGE_SPEED_EX);
44  }
45 
50  Action(Type::CHANGE_SPEED)
51  {
52  p.at("ground_speed")->Get_value(speed);
53  p.at("vertical_speed")->Get_value(vertical_speed);
54  }
55 
59  double speed;
64 };
65 
67 template<>
71 };
72 
73 } /* namespace vsm */
74 } /* namespace ugcs */
75 
76 #endif /* _CHANGE_SPEED_ACTION_H_ */
UGCS root namespace.
Definition: android-linux/ugcs/vsm/platform_sockets.h:27
Change_speed_action type
Real type.
Definition: change_speed_action.h:70
Definition: property.h:191
Type
Types of vehicle actions as part of task (mission).
Definition: action.h:30
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
float vertical_speed
Target vertical speed in meters per second.
Definition: change_speed_action.h:63
Change speed action ugcs::vsm::Change_speed_action.
Change_speed_action(const mavlink::ugcs::Pld_mission_item_ex &item)
Construct change speed action from Mavlink extended mission item.
Definition: change_speed_action.h:38
Immediate change or vehicle airspeed.
Definition: change_speed_action.h:21
Change_speed_action(const Property_list &p)
Construct action from protobuf command.
Definition: change_speed_action.h:49
double speed
Target ground speed in meters per second.
Definition: change_speed_action.h:59
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25
Coordinates manipulation.