MAV'RIC
|
00001 /******************************************************************************* 00002 * Copyright (c) 2009-2016, MAV'RIC Development Team 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright notice, 00009 * this list of conditions and the following disclaimer. 00010 * 00011 * 2. Redistributions in binary form must reproduce the above copyright notice, 00012 * this list of conditions and the following disclaimer in the documentation 00013 * and/or other materials provided with the distribution. 00014 * 00015 * 3. Neither the name of the copyright holder nor the names of its contributors 00016 * may be used to endorse or promote products derived from this software without 00017 * specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00020 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00021 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00022 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 00023 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00024 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00025 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00026 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00027 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00028 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00029 * POSSIBILITY OF SUCH DAMAGE. 00030 ******************************************************************************/ 00031 00032 /******************************************************************************* 00033 * \file waypoint.hpp 00034 * 00035 * \author MAV'RIC Team 00036 * \author Matthew Douglas 00037 * 00038 * \brief The waypoint class 00039 * 00040 ******************************************************************************/ 00041 00042 00043 #ifndef WAYPOINT__ 00044 #define WAYPOINT__ 00045 00046 #include "navigation/dubin.hpp" 00047 #include "communication/mavlink_communication.hpp" 00048 #include "communication/mavlink_stream.hpp" 00049 #include "communication/mavlink_message_handler.hpp" 00050 #include "util/coord_conventions.hpp" 00051 00052 /* 00053 * N.B.: Reference Frames and MAV_CMD_NAV are defined in "maveric.h" 00054 */ 00055 00056 class Waypoint 00057 { 00058 public: 00062 Waypoint(); 00063 00069 Waypoint(mavlink_mission_item_t& packet); 00070 00085 Waypoint( uint8_t frame, 00086 uint16_t command, 00087 uint8_t autocontinue, 00088 float param1, 00089 float param2, 00090 float param3, 00091 float param4, 00092 float param5, 00093 float param6, 00094 float param7); 00095 00105 void send(const Mavlink_stream& mavlink_stream, uint32_t sysid, const mavlink_message_t* msg, uint16_t seq, uint8_t current); 00106 00112 uint8_t frame() const; 00113 00119 uint16_t command() const; 00120 00126 uint8_t autocontinue() const; 00127 00133 float param1() const; 00134 00140 float param2() const; 00141 00147 float param3() const; 00148 00154 float param4() const; 00155 00161 float param5() const; 00162 00168 float param6() const; 00169 00175 float param7() const; 00176 00186 bool heading(float& heading) const; 00187 00197 bool radius(float& radius) const; 00198 00204 local_position_t local_pos() const; 00205 00206 protected: 00207 uint8_t frame_; 00208 uint16_t command_; 00209 uint8_t autocontinue_; 00210 float param1_; 00211 float param2_; 00212 float param3_; 00213 float param4_; 00214 float param5_; 00215 float param6_; 00216 float param7_; 00217 }; 00218 00219 00220 00221 00222 00223 #endif // WAYPOINT__