16 namespace mrpt {
namespace obs {
namespace utils {
31 template<
class OBSERVATION_T>
33 mrpt::obs::CSensoryFramePtr& observations,
34 mrpt::obs::CObservationPtr& observation,
35 bool priority_to_sf=
true) {
37 typedef typename OBSERVATION_T::Ptr obs_t;
45 if (observation.present() &&
46 observation->GetRuntimeClass()->derivedFrom(class_ID)) {
48 static_cast<obs_t
>(observation);
52 if (observations.present()) {
53 cobs_ptr = observations->getObservationByClass<OBSERVATION_T>();
57 if (cobs_ptr.present() && sf_ptr.present()) {
58 obs_out = priority_to_sf? sf_ptr : cobs_ptr;
60 else if (cobs_ptr.present()) {
63 else if (sf_ptr.present()) {
67 obs_out =
typename OBSERVATION_T::Ptr();
OBSERVATION_T::Ptr getObservation(mrpt::obs::CSensoryFramePtr &observations, mrpt::obs::CObservationPtr &observation, bool priority_to_sf=true)
Given an mrpt::obs::CSensoryFrame and a mrpt::obs::CObservation pointer if a OBSERVATION_T type obser...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A structure that holds runtime class type information.