2
3
4
5
6
7
8
9
10
11
12
13
14
15
17
18
19
21#ifndef CALC_RANGE_RANGE_RATE_HPP
22#define CALC_RANGE_RANGE_RATE_HPP
26#include "utils/Measurements.hpp"
27#include "core/safemath.hpp"
29#define RANGE_RANGERATE_TARGET_STATES 6
30#define RANGE_RANGERATE_OBSERVER_STATES 6
31#define RANGE_RANGERATE_MEASUREMENTS 2
54 out_measurements[0] = std::sqrt( (tar_state[0]-obs_state[0])*(tar_state[0]-obs_state[0]) + (tar_state[1]-obs_state[1])*(tar_state[1]-obs_state[1]) + (tar_state[2]-obs_state[2])*(tar_state[2]-obs_state[2]));
56 int err = clockwerk::safeDivide((tar_state[0]-obs_state[0])*(tar_state[3]-obs_state[3]) + (tar_state[1]-obs_state[1])*(tar_state[4]-obs_state[4]) + (tar_state[2]-obs_state[2])*(tar_state[5]-obs_state[5]),
57 out_measurements[0], out_measurements[1]);
#define RANGE_RANGERATE_MEASUREMENTS
Definition CalcRangeRangeRate.hpp:31
#define RANGE_RANGERATE_TARGET_STATES
Definition CalcRangeRangeRate.hpp:29
#define RANGE_RANGERATE_OBSERVER_STATES
Definition CalcRangeRangeRate.hpp:30
Definition CalcRangeRangeRate.hpp:36
int calculateMeasurements(T time, const std::array< T, 6 > &tar_state, const std::array< T, 6 > &obs_state, std::array< T, 2 > &out_measurements)
Function to calculate rate of change in 6-element orbit position with J2, J3.
Definition CalcRangeRangeRate.hpp:50
Definition Measurements.hpp:39