Initial Commit (tested training, testing, and TRT conversion)
This commit is contained in:
32
flightlib/include/flightlib/common/integrator_base.hpp
Normal file
32
flightlib/include/flightlib/common/integrator_base.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "flightlib/common/quad_state.hpp"
|
||||
#include "flightlib/common/types.hpp"
|
||||
|
||||
namespace flightlib {
|
||||
|
||||
class IntegratorBase {
|
||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
|
||||
public:
|
||||
using DynamicsFunction =
|
||||
std::function<bool(const Ref<const Vector<>>, Ref<Vector<>>)>;
|
||||
IntegratorBase(DynamicsFunction function, const Scalar dt_max = 1e-3);
|
||||
|
||||
bool integrate(const QuadState& initial, QuadState* const final) const;
|
||||
|
||||
bool integrate(const Ref<const Vector<>> initial, const Scalar dt,
|
||||
Ref<Vector<>> final) const;
|
||||
|
||||
virtual bool step(const Ref<const Vector<>> initial, const Scalar dt,
|
||||
Ref<Vector<>> final) const = 0;
|
||||
|
||||
Scalar dtMax() const;
|
||||
|
||||
protected:
|
||||
DynamicsFunction dynamics_;
|
||||
Scalar dt_max_;
|
||||
};
|
||||
|
||||
} // namespace flightlib
|
||||
Reference in New Issue
Block a user