APM:Libraries
SIM_Tracker.h
Go to the documentation of this file.
1 /*
2  This program is free software: you can redistribute it and/or modify
3  it under the terms of the GNU General Public License as published by
4  the Free Software Foundation, either version 3 of the License, or
5  (at your option) any later version.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program. If not, see <http://www.gnu.org/licenses/>.
14  */
15 /*
16  antenna-tracker simulator class
17 */
18 
19 #pragma once
20 
21 #include "SIM_Aircraft.h"
22 
23 namespace SITL {
24 
25 /*
26  a antenna tracker simulator
27  */
28 class Tracker : public Aircraft {
29 public:
30  Tracker(const char *home_str, const char *frame_str);
31  void update(const struct sitl_input &input);
32 
33  /* static object creator */
34  static Aircraft *create(const char *home_str, const char *frame_str) {
35  return new Tracker(home_str, frame_str);
36  }
37 
38 private:
39 
40  const bool onoff = false;
41  const float yawrate = 9.0f;
42  const float pitchrate = 1.0f;
43  const float pitch_range = 45;
44  const float yaw_range = 170;
45  const float zero_yaw = 270; // yaw direction at startup
46  const float zero_pitch = 10; // pitch at startup
47  uint64_t last_debug_us = 0;
48 
49  float pitch_input;
50  float yaw_input;
53 
54  void update_position_servos(float delta_time, float &yaw_rate, float &pitch_rate);
55  void update_onoff_servos(float &yaw_rate, float &pitch_rate);
56 };
57 
58 } // namespace SITL
const float zero_yaw
Definition: SIM_Tracker.h:45
const float pitch_range
Definition: SIM_Tracker.h:43
void update(const struct sitl_input &input)
Definition: SIM_Tracker.cpp:69
const float pitchrate
Definition: SIM_Tracker.h:42
const bool onoff
Definition: SIM_Tracker.h:40
void update_onoff_servos(float &yaw_rate, float &pitch_rate)
Definition: SIM_Tracker.cpp:47
static Aircraft * create(const char *home_str, const char *frame_str)
Definition: SIM_Tracker.h:34
float yaw_current_relative
Definition: SIM_Tracker.h:51
const float yaw_range
Definition: SIM_Tracker.h:44
const float zero_pitch
Definition: SIM_Tracker.h:46
const float yawrate
Definition: SIM_Tracker.h:41
Tracker(const char *home_str, const char *frame_str)
Definition: SIM_Tracker.cpp:25
void update_position_servos(float delta_time, float &yaw_rate, float &pitch_rate)
Definition: SIM_Tracker.cpp:33
float pitch_current_relative
Definition: SIM_Tracker.h:52
float pitch_input
Definition: SIM_Tracker.h:49
float yaw_input
Definition: SIM_Tracker.h:50
uint64_t last_debug_us
Definition: SIM_Tracker.h:47