25 #ifndef SRC_OBSERVERS_INCLUDE_CORBO_OBSERVERS_OBSERVER_INTERFACE_H_ 26 #define SRC_OBSERVERS_INCLUDE_CORBO_OBSERVERS_OBSERVER_INTERFACE_H_ 33 #ifdef MESSAGE_SUPPORT 34 #include <corbo-communication/messages/observers/observers.pb.h> 61 using Ptr = std::shared_ptr<ObserverInterface>;
62 using UPtr = std::unique_ptr<ObserverInterface>;
118 #ifdef MESSAGE_SUPPORT 119 virtual void toMessage(corbo::messages::Observer& message)
const {}
122 virtual void fromMessage(
const corbo::messages::Observer& message, std::stringstream* issues =
nullptr) {}
127 #define FACTORY_REGISTER_OBSERVER(type) FACTORY_REGISTER_OBJECT(type, ObserverInterface) 141 class NoObserver :
public ObserverInterface
145 Ptr getInstance()
const override {
return std::make_shared<NoObserver>(); }
153 SignalTargetInterface* signal_target =
nullptr,
const std::string& ns =
"")
override 159 #ifdef MESSAGE_SUPPORT 161 void toMessage(corbo::messages::Observer& message)
const override { message.mutable_no_observer(); }
169 #endif // SRC_OBSERVERS_INCLUDE_CORBO_OBSERVERS_OBSERVER_INTERFACE_H_ static Factory< ObserverInterface > & getFactory()
Get access to the associated factory.
#define FACTORY_REGISTER_OBSERVER(type)
std::unique_ptr< ObserverInterface > UPtr
Eigen::VectorXd StateVector
Interface class for signal targets.
Representation of time stamps.
virtual bool observe(const OutputVector &y, StateVector &x, const Duration &dt, const Time &t, SignalTargetInterface *signal_target=nullptr, const std::string &ns="")=0
Perform actual observer step / state estimation.
Interface class for observers.
virtual int getOutputDimension() const =0
Return the dimension of the supported plant output.
std::shared_ptr< ObserverInterface > Ptr
static Factory & instance()
< Retrieve static instance of the factory
constexpr const int INHERITED
Inherit property.
virtual void getAvailableSignals(SignalTargetInterface &signal_target, const std::string &ns="") const
Retrieve available signals from the observer.
Eigen::VectorXd OutputVector
virtual Ptr getInstance() const =0
Return a newly created shared instance of the implemented class.
virtual void reset()
Reset internal observer state and caches.
Representation of time durations.
virtual int getStateDimension() const =0
Return the dimension of the observed state.
virtual ~ObserverInterface()
Virtual destructor.