Skip to content

Commit

Permalink
updated licensing info
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Feb 15, 2017
1 parent 28e95e3 commit 6efa9c3
Show file tree
Hide file tree
Showing 147 changed files with 23,961 additions and 23,520 deletions.
3 changes: 3 additions & 0 deletions AirLib/include/common/Common.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#ifndef msr_air_copter_sim_Common_hpp
#define msr_air_copter_sim_Common_hpp

Expand Down
3 changes: 3 additions & 0 deletions AirLib/include/common/CommonStructs.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#ifndef msr_air_copter_sim_CommonStructs_hpp
#define msr_air_copter_sim_CommonStructs_hpp

Expand Down
181 changes: 92 additions & 89 deletions AirLib/include/common/DelayLine.hpp
Original file line number Diff line number Diff line change
@@ -1,89 +1,92 @@
#ifndef common_utils_DelayLine_hpp
#define common_utils_DelayLine_hpp

#include "common/Common.hpp"
#include "UpdatableObject.hpp"
#include <list>

namespace msr { namespace airlib {

template<typename T>
class DelayLine : UpdatableObject {
public:
DelayLine()
{}
DelayLine(double delay) //in seconds
{
initialize(delay);
}
void initialize(double delay) //in seconds
{
setDelay(delay);
DelayLine::reset();
}
void setDelay(double delay)
{
delay_ = delay;
}
double getDelay() const
{
return delay_;
}

//*** Start: UpdatableState implementation ***//
virtual void reset() override
{
values_.clear();
times_.clear();
time_now = 0;
last_time_ = -1;
last_value_ = T();
}

virtual void update(real_T dt) override
{
time_now += dt;

if (!times_.empty() &&
time_now - times_.front() >= delay_) {

last_value_ = values_.front();
last_time_ = times_.front();

times_.pop_front();
values_.pop_front();
}
}
//*** End: UpdatableState implementation ***//


T getOutput() const
{
return last_value_;
}
double getOutputTime() const
{
return last_time_;
}

void push_back(const T& val, double time_offset = 0)
{
values_.push_back(val);
times_.push_back(time_now + time_offset);
}

private:
template<typename TItem>
using list = std::list<TItem>;

list<T> values_;
list<double> times_;
double delay_;

T last_value_;
double last_time_ = -1;
double time_now = 0;
};

}} //namespace
#endif
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#ifndef common_utils_DelayLine_hpp
#define common_utils_DelayLine_hpp

#include "common/Common.hpp"
#include "UpdatableObject.hpp"
#include <list>

namespace msr { namespace airlib {

template<typename T>
class DelayLine : UpdatableObject {
public:
DelayLine()
{}
DelayLine(double delay) //in seconds
{
initialize(delay);
}
void initialize(double delay) //in seconds
{
setDelay(delay);
DelayLine::reset();
}
void setDelay(double delay)
{
delay_ = delay;
}
double getDelay() const
{
return delay_;
}

//*** Start: UpdatableState implementation ***//
virtual void reset() override
{
values_.clear();
times_.clear();
time_now = 0;
last_time_ = -1;
last_value_ = T();
}

virtual void update(real_T dt) override
{
time_now += dt;

if (!times_.empty() &&
time_now - times_.front() >= delay_) {

last_value_ = values_.front();
last_time_ = times_.front();

times_.pop_front();
values_.pop_front();
}
}
//*** End: UpdatableState implementation ***//


T getOutput() const
{
return last_value_;
}
double getOutputTime() const
{
return last_time_;
}

void push_back(const T& val, double time_offset = 0)
{
values_.push_back(val);
times_.push_back(time_now + time_offset);
}

private:
template<typename TItem>
using list = std::list<TItem>;

list<T> values_;
list<double> times_;
double delay_;

T last_value_;
double last_time_ = -1;
double time_now = 0;
};

}} //namespace
#endif
5 changes: 4 additions & 1 deletion AirLib/include/common/EarthUtils.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.


#ifndef air_Earth_hpp
#define air_Earth_hpp
Expand Down Expand Up @@ -360,4 +363,4 @@ class EarthUtils {
};

}} //namespace
#endif
#endif
5 changes: 4 additions & 1 deletion AirLib/include/common/FirstOrderFilter.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.


#ifndef airsimcore_firstorderfilter_hpp
#define airsimcore_firstorderfilter_hpp
Expand Down Expand Up @@ -77,4 +80,4 @@ class FirstOrderFilter : UpdatableObject {
};

}} //namespace
#endif
#endif
3 changes: 3 additions & 0 deletions AirLib/include/common/FrequencyLimiter.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#ifndef msr_air_copter_sim_FrequencyLimiter_hpp
#define msr_air_copter_sim_FrequencyLimiter_hpp

Expand Down
151 changes: 77 additions & 74 deletions AirLib/include/common/GaussianMarkov.hpp
Original file line number Diff line number Diff line change
@@ -1,74 +1,77 @@
#ifndef common_utils_GaussianMarkov_hpp
#define common_utils_GaussianMarkov_hpp

#include "common/Common.hpp"
#include "UpdatableObject.hpp"
#include <list>
#include "common_utils/RandomGenerator.hpp"

namespace msr { namespace airlib {

class GaussianMarkov : UpdatableObject {
public:
GaussianMarkov()
{}
GaussianMarkov(real_T tau, real_T sigma, real_T initial_output) //in seconds
{
initialize(tau, sigma, initial_output);
}
void initialize(real_T tau, real_T sigma, real_T initial_output) //in seconds
{
tau_ = tau;
sigma_ = sigma;
rand_ = RandomGeneratorGausianR(0.0f, 1.0f);

if (std::isnan(initial_output))
initial_output_ = getNextRandom() * sigma_;
else
initial_output_ = initial_output;

GaussianMarkov::reset();
}

//*** Start: UpdatableState implementation ***//
virtual void reset() override
{
output_ = initial_output_;
rand_.reset();
}

virtual void update(real_T dt) override
{
/*
Ref:
A Comparison between Different Error Modeling of MEMS Applied to GPS/INS Integrated Systems
Quinchia, sec 3.2, https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3812568/
A Study of the Effects of Stochastic Inertial Sensor Errors in Dead-Reckoning Navigation
John H Wall, 2007, eq 2.5, pg 13, http://etd.auburn.edu/handle/10415/945
*/
real_T alpha = exp(-dt / tau_);
output_ = alpha * output_ + (1 - alpha) * getNextRandom() * sigma_;
}
//*** End: UpdatableState implementation ***//


real_T getNextRandom()
{
return rand_.next();
}

real_T getOutput() const
{
return output_;
}

private:
RandomGeneratorGausianR rand_;
real_T tau_, sigma_;
real_T output_, initial_output_;
};


}} //namespace
#endif
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#ifndef common_utils_GaussianMarkov_hpp
#define common_utils_GaussianMarkov_hpp

#include "common/Common.hpp"
#include "UpdatableObject.hpp"
#include <list>
#include "common_utils/RandomGenerator.hpp"

namespace msr { namespace airlib {

class GaussianMarkov : UpdatableObject {
public:
GaussianMarkov()
{}
GaussianMarkov(real_T tau, real_T sigma, real_T initial_output) //in seconds
{
initialize(tau, sigma, initial_output);
}
void initialize(real_T tau, real_T sigma, real_T initial_output) //in seconds
{
tau_ = tau;
sigma_ = sigma;
rand_ = RandomGeneratorGausianR(0.0f, 1.0f);

if (std::isnan(initial_output))
initial_output_ = getNextRandom() * sigma_;
else
initial_output_ = initial_output;

GaussianMarkov::reset();
}

//*** Start: UpdatableState implementation ***//
virtual void reset() override
{
output_ = initial_output_;
rand_.reset();
}

virtual void update(real_T dt) override
{
/*
Ref:
A Comparison between Different Error Modeling of MEMS Applied to GPS/INS Integrated Systems
Quinchia, sec 3.2, https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3812568/
A Study of the Effects of Stochastic Inertial Sensor Errors in Dead-Reckoning Navigation
John H Wall, 2007, eq 2.5, pg 13, http://etd.auburn.edu/handle/10415/945
*/
real_T alpha = exp(-dt / tau_);
output_ = alpha * output_ + (1 - alpha) * getNextRandom() * sigma_;
}
//*** End: UpdatableState implementation ***//


real_T getNextRandom()
{
return rand_.next();
}

real_T getOutput() const
{
return output_;
}

private:
RandomGeneratorGausianR rand_;
real_T tau_, sigma_;
real_T output_, initial_output_;
};


}} //namespace
#endif
5 changes: 4 additions & 1 deletion AirLib/include/common/GeodeticConverter.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#ifndef air_GeodeticConverter_hpp
#define air_GeodeticConverter_hpp

Expand Down Expand Up @@ -220,4 +223,4 @@ class GeodeticConverter
}; // class GeodeticConverter

}}
#endif // GEODETIC_CONVERTER_H_
#endif // GEODETIC_CONVERTER_H_
Loading

0 comments on commit 6efa9c3

Please sign in to comment.