12 #include <mrpt/obs/obs_frwds.h>
13 #include <mrpt/opengl/opengl_frwds.h>
14 #include <mrpt/poses/CPose3D.h>
15 #include <mvsim/ClassFactory.h>
16 #include <mvsim/Simulable.h>
17 #include <mvsim/VisualObject.h>
37 using Ptr = std::shared_ptr<SensorBase>;
53 virtual void simulateOn3DScene(
54 [[maybe_unused]] mrpt::opengl::COpenGLScene& gl_scene)
59 static std::shared_ptr<mrpt::opengl::CSetOfObjects> GetAllSensorsOriginViz();
61 static std::shared_ptr<mrpt::opengl::CSetOfObjects> GetAllSensorsFOVViz();
62 static void RegisterSensorFOVViz(
const std::shared_ptr<mrpt::opengl::CSetOfObjects>& o);
63 static void RegisterSensorOriginViz(
const std::shared_ptr<mrpt::opengl::CSetOfObjects>& o);
85 const World* world()
const {
return vehicle_.getSimulableWorldObject(); }
99 bool parseSensorPublish(
102 void reportNewObservation(
103 const std::shared_ptr<mrpt::obs::CObservation>& obs,
const TSimulContext& context);
105 void reportNewObservation_lidar_2d(
106 const std::shared_ptr<mrpt::obs::CObservation2DRangeScan>& obs,
113 using TListSensors = std::vector<SensorBase::Ptr>;
120 #define DECLARES_REGISTER_SENSOR(CLASS_NAME) \
121 DECLARES_REGISTER_CLASS2(CLASS_NAME, SensorBase, Simulable&, const rapidxml::xml_node<char>*)
123 #define REGISTER_SENSOR(TEXTUAL_NAME, CLASS_NAME) \
124 REGISTER_CLASS2(TClassFactory_sensors, classFactory_sensors, TEXTUAL_NAME, CLASS_NAME)
Definition: ClassFactory.h:26
Virtual base class for all sensors.
Definition: SensorBase.h:35
virtual void loadConfigFrom(const rapidxml::xml_node< char > *root)
void make_sure_we_have_a_name(const std::string &prefix)
Assign a sensible default name/sensor label if none is provided:
double sensor_period_
Definition: SensorBase.h:88
bool should_simulate_sensor(const TSimulContext &context)
std::map< std::string, std::string > varValues_
Filled in by SensorBase::loadConfigFrom()
Definition: SensorBase.h:97
std::string publishTopic_
Definition: SensorBase.h:94
static SensorBase::Ptr factory(Simulable &parent, const rapidxml::xml_node< char > *xml_node)
double sensor_last_timestamp_
Definition: SensorBase.h:91
Simulable & vehicle()
Definition: SensorBase.h:68
SensorBase(Simulable &vehicle)
Simulable & vehicle_
The vehicle this sensor is attached to.
Definition: SensorBase.h:82
Definition: Simulable.h:40
Definition: VisualObject.h:36
Definition: basic_types.h:58