Qualcomm Navigator Flight Control Interface  2.0
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
trajectory_command.hpp
1 /****************************************************************************
2  * Copyright (c) 2018 John A. Dougherty. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in
12  * the documentation and/or other materials provided with the
13  * distribution.
14  * 3. Neither the name ATLFlight nor the names of its contributors may be
15  * used to endorse or promote products derived from this software
16  * without specific prior written permission.
17  *
18  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  * In addition Supplemental Terms apply. See the SUPPLEMENTAL file.
33  ****************************************************************************/
34 
35 #ifndef SNAV_FCI_TRAJECTORY_COMMAND_HPP_
36 #define SNAV_FCI_TRAJECTORY_COMMAND_HPP_
37 
38 #include <array>
39 
40 #include "api/state_vector.hpp"
41 #include "api/tx_commands/tx_command.hpp"
42 
43 namespace snav_fci
44 {
45 
51 {
52 public:
53 
58  {
59  mode_ = Mode::TRAJECTORY;
60  controller = SN_POSITION_CONTROL_VIO;
61  options = SN_TRAJ_DEFAULT;
62  position.fill(0);
63  velocity.fill(0);
64  acceleration.fill(0);
65  yaw = 0;
66  yaw_rate = 0;
67  }
68 
70  {
71  position[0] = sv.position[0];
72  position[1] = sv.position[1];
73  position[2] = sv.position[2];
74  velocity[0] = sv.velocity[0];
75  velocity[1] = sv.velocity[1];
76  velocity[2] = sv.velocity[2];
77  acceleration[0] = sv.acceleration[0];
78  acceleration[1] = sv.acceleration[1];
79  acceleration[2] = sv.acceleration[2];
80  yaw = sv.yaw;
81  yaw_rate = sv.yaw_rate;
82  }
83 
84  SnPositionController controller;
85  SnTrajectoryOptions options;
86  std::array<float, 3> position;
87  std::array<float, 3> velocity;
88  std::array<float, 3> acceleration;
90  float yaw;
91  float yaw_rate;
92 };
93 
94 } // namespace snav_fci
95 
96 #endif // SNAV_FCI_TRAJECTORY_COMMAND_HPP_
97 
float yaw
Definition: state_vector.hpp:91
Definition: tx_command.hpp:41
Eigen::Vector3f position
Definition: displacement_derivs.hpp:61
SnPositionController controller
Definition: trajectory_command.hpp:84
Eigen::Vector3f acceleration
Definition: displacement_derivs.hpp:63
float yaw
Definition: trajectory_command.hpp:90
std::array< float, 3 > acceleration
Definition: trajectory_command.hpp:88
float yaw_rate
Definition: trajectory_command.hpp:91
SnTrajectoryOptions options
Definition: trajectory_command.hpp:85
TrajectoryCommand()
Default constructor.
Definition: trajectory_command.hpp:57
float yaw_rate
Definition: state_vector.hpp:92
Structure containing position and yaw along with their derivatives.
Definition: state_vector.hpp:50
Eigen::Vector3f velocity
Definition: displacement_derivs.hpp:62
std::array< float, 3 > velocity
Definition: trajectory_command.hpp:87
std::array< float, 3 > position
Definition: trajectory_command.hpp:86
Structure containing the inputs to the sn_send_trajectory_tracking_command() Qualcomm Navigator API f...
Definition: trajectory_command.hpp:50