A 3D LiDAR sensor, with 360 degrees horizontal fielf-of-view, and a configurable vertical FOV. The number of rays in the vertical FOV and the number of samples in each horizontal row are configurable. More...
#include <Lidar3D.h>
Classes | |
struct | PerHorzAngleLUT |
struct | PerRayLUT |
Public Member Functions | |
void | freeOpenGLResources () override |
Lidar3D (Simulable &parent, const rapidxml::xml_node< char > *root) | |
virtual void | loadConfigFrom (const rapidxml::xml_node< char > *root) override |
virtual void | simul_post_timestep (const TSimulContext &context) override |
virtual void | simul_pre_timestep (const TSimulContext &context) override |
void | simulateOn3DScene (mrpt::opengl::COpenGLScene &gl_scene) override |
virtual | ~Lidar3D () |
![]() | |
void | registerOnServer (mvsim::Client &c) override |
double | sensor_period () const |
SensorBase (Simulable &vehicle) | |
virtual void | simulateOn3DScene ([[maybe_unused]] mrpt::opengl::COpenGLScene &gl_scene) |
virtual | ~SensorBase () |
![]() | |
const std::optional< Shape2p5 > & | collisionShape () const |
void | customVisualVisible (const bool visible) |
bool | customVisualVisible () const |
virtual void | guiUpdate (const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &viz, const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &physical) |
World * | parent () |
const World * | parent () const |
void | showCollisionShape (bool show) |
VisualObject (World *parent, bool insertCustomVizIntoViz=true, bool insertCustomVizIntoPhysical=true) | |
virtual | ~VisualObject () |
![]() | |
virtual void | apply_force (const mrpt::math::TVector2D &force, const mrpt::math::TPoint2D &applyPoint=mrpt::math::TPoint2D(0, 0)) |
const b2Body * | b2d_body () const |
b2Body * | b2d_body () |
mrpt::poses::CPose2D | getCPose2D () const |
Alternative to getPose() More... | |
mrpt::poses::CPose3D | getCPose3D () const |
Alternative to getPose() More... | |
mrpt::math::TVector3D | getLinearAcceleration () const |
const std::string & | getName () const |
mrpt::math::TPose3D | getPose () const |
mrpt::math::TPose3D | getPoseNoLock () const |
No thread-safe version. Used internally only. More... | |
World * | getSimulableWorldObject () |
const World * | getSimulableWorldObject () const |
mrpt::math::TTwist2D | getTwist () const |
mrpt::math::TTwist2D | getVelocityLocal () const |
bool | hadCollision () const |
bool | isInCollision () const |
virtual VisualObject * | meAsVisualObject () |
void | resetCollisionFlag () |
void | setName (const std::string &s) |
void | setPose (const mrpt::math::TPose3D &p) const |
void | setTwist (const mrpt::math::TTwist2D &dq) const |
Simulable (World *parent) | |
Protected Member Functions | |
virtual void | internalGuiUpdate (const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &viz, const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &physical, bool childrenOnly) override |
![]() | |
void | make_sure_we_have_a_name (const std::string &prefix) |
Assign a sensible default name/sensor label if none is provided: More... | |
bool | parseSensorPublish (const rapidxml::xml_node< char > *node, const std::map< std::string, std::string > &varValues) |
void | reportNewObservation (const std::shared_ptr< mrpt::obs::CObservation > &obs, const TSimulContext &context) |
void | reportNewObservation_lidar_2d (const std::shared_ptr< mrpt::obs::CObservation2DRangeScan > &obs, const TSimulContext &context) |
bool | should_simulate_sensor (const TSimulContext &context) |
World * | world () |
const World * | world () const |
![]() | |
void | addCustomVisualization (const mrpt::opengl::CRenderizable::Ptr &glModel, const mrpt::poses::CPose3D &modelPose={}, const float modelScale=1.0f, const std::string &modelName="group", const std::optional< std::string > &modelURI=std::nullopt, const bool initialShowBoundingBox=false) |
bool | parseVisual (const rapidxml::xml_node< char > &rootNode) |
Returns true if there is at least one <visual>...</visual> entry. More... | |
bool | parseVisual (const JointXMLnode<> &rootNode) |
void | setCollisionShape (const Shape2p5 &cs) |
Protected Attributes | |
int | fbo_nrows_ = vertNumRays_ * 20 |
std::shared_ptr< mrpt::opengl::CFBORender > | fbo_renderer_depth_ |
mrpt::opengl::CSetOfObjects::Ptr | gl_sensor_fov_ |
mrpt::opengl::CSetOfObjects::Ptr | gl_sensor_origin_ |
mrpt::opengl::CSetOfObjects::Ptr | gl_sensor_origin_corner_ |
mrpt::opengl::CPointCloudColoured::Ptr | glPoints_ |
bool | gui_uptodate_ = false |
std::optional< TSimulContext > | has_to_render_ |
std::mutex | has_to_render_mtx_ |
int | horzNumRays_ = 180 |
bool | ignore_parent_body_ = false |
mrpt::obs::CObservationPointCloud::Ptr | last_scan2gui_ |
mrpt::obs::CObservationPointCloud::Ptr | last_scan_ |
std::mutex | last_scan_cs_ |
std::vector< PerHorzAngleLUT > | lut_ |
float | maxRange_ = 80.0f |
float | minRange_ = 0.01f |
double | rangeStdNoise_ = 0.01 |
mrpt::poses::CPose3D | sensorPoseOnVeh_ |
double | vertical_fov_ = mrpt::DEG2RAD(30.0) |
int | vertNumRays_ = 16 |
float | viz_pointSize_ = 3.0f |
![]() | |
std::string | publishTopic_ |
std::shared_ptr< mrpt::io::CFileGZOutputStream > | rawlog_io_ |
std::string | save_to_rawlog_ |
double | sensor_last_timestamp_ = 0 |
double | sensor_period_ = 0.1 |
std::map< std::string, std::string > | varValues_ |
Filled in by SensorBase::loadConfigFrom() More... | |
Simulable & | vehicle_ |
The vehicle this sensor is attached to. More... | |
![]() | |
std::shared_ptr< mrpt::opengl::CSetOfObjects > | glCollision_ |
std::shared_ptr< mrpt::opengl::CSetOfObjects > | glCustomVisual_ |
int32_t | glCustomVisualId_ = -1 |
const bool | insertCustomVizIntoPhysical_ = true |
const bool | insertCustomVizIntoViz_ = true |
World * | world_ |
![]() | |
std::string | name_ |
Additional Inherited Members | |
![]() | |
using | Ptr = std::shared_ptr< SensorBase > |
![]() | |
using | Ptr = std::shared_ptr< Simulable > |
![]() | |
static SensorBase::Ptr | factory (Simulable &parent, const rapidxml::xml_node< char > *xml_node) |
static std::shared_ptr< mrpt::opengl::CSetOfObjects > | GetAllSensorsFOVViz () |
static std::shared_ptr< mrpt::opengl::CSetOfObjects > | GetAllSensorsOriginViz () |
static void | RegisterSensorFOVViz (const std::shared_ptr< mrpt::opengl::CSetOfObjects > &o) |
static void | RegisterSensorOriginViz (const std::shared_ptr< mrpt::opengl::CSetOfObjects > &o) |
![]() | |
static void | FreeOpenGLResources () |
![]() | |
static double | GeometryEpsilon = 1e-3 |
A 3D LiDAR sensor, with 360 degrees horizontal fielf-of-view, and a configurable vertical FOV. The number of rays in the vertical FOV and the number of samples in each horizontal row are configurable.
Lidar3D::Lidar3D | ( | Simulable & | parent, |
const rapidxml::xml_node< char > * | root | ||
) |
Definition at line 32 of file Lidar3D.cpp.
|
virtual |
Definition at line 38 of file Lidar3D.cpp.
|
overridevirtual |
Reimplemented from mvsim::Simulable.
Definition at line 170 of file Lidar3D.cpp.
|
overrideprotectedvirtual |
Implements mvsim::VisualObject.
Definition at line 67 of file Lidar3D.cpp.
|
overridevirtual |
Loads the parameters common to all sensors. Should be overriden, and they call to this base method.
Reimplemented from mvsim::SensorBase.
Definition at line 40 of file Lidar3D.cpp.
|
overridevirtual |
Override to do any required process right after the integration of dynamic equations for each timestep. IMPORTANT: Reimplementations MUST also call this base method, since it is in charge of important tasks (e.g. update q_, dq_)
Reimplemented from mvsim::Simulable.
Definition at line 147 of file Lidar3D.cpp.
|
overridevirtual |
Process right before the integration of dynamic equations for each timestep: set action forces from motors, update friction models, etc.
Reimplemented from mvsim::Simulable.
Definition at line 142 of file Lidar3D.cpp.
|
override |
Definition at line 176 of file Lidar3D.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Whether gl_scan_ has to be updated upon next call of internalGuiUpdate() from last_scan2gui_
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |