15 #if MRPT_HAS_OPENGL_GLUT 22 #include <OpenGL/gl.h> 29 #if MRPT_HAS_OPENGL_GLUT && defined(_WIN32) 32 #pragma comment(lib, "opengl32.lib") 33 #pragma comment(lib, "GlU32.lib") 35 #endif // MRPT_HAS_OPENGL_GLUT 66 m_enable_points(true),
68 m_enable_surface(true)
86 #if MRPT_HAS_OPENGL_GLUT 101 const float *
x, *
y, *
z;
104 if (!
n || !
x)
return;
119 for (i = 0; i <
n - 1; i++)
138 for (i = 0; i <
n; i++)
154 for (i = 0; i <
n - 1; i++)
228 const float *
x, *
y, *
z;
231 if (!
n || !
x)
return;
234 std::numeric_limits<double>::max(), std::numeric_limits<double>::max(),
235 std::numeric_limits<double>::max());
237 -std::numeric_limits<double>::max(),
238 -std::numeric_limits<double>::max(),
239 -std::numeric_limits<double>::max());
241 for (
size_t i = 0; i <
n; i++)
void clear()
Erase all the contents of the map.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
double x() const
Common members of all points & poses classes.
bool isPlanarMap
If set to true, only HORIZONTAL (in the XY plane) measurements will be inserted in the map (Default v...
GLAPI void GLAPIENTRY glEnable(GLenum cap)
mrpt::maps::CSimplePointsMap m_cache_points
GLAPI void GLAPIENTRY glPointSize(GLfloat size)
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
#define GL_ONE_MINUS_SRC_ALPHA
void keep_min(T &var, const K test_val)
If the second argument is below the first one, set the first argument to this lower value...
GLAPI void GLAPIENTRY glLineWidth(GLfloat width)
mrpt::poses::CPose3D m_pose
6D pose wrt the parent coordinate reference.
mrpt::containers::ContainerReadOnlyProxyAccessor< mrpt::aligned_std_vector< char > > validRange
It's false (=0) on no reflected rays, referenced to elements in scan.
CPlanarLaserScan()
Constructor.
GLAPI void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
A renderizable object suitable for rendering with OpenGL's display lists.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define ASSERT_(f)
Defines an assertion mechanism.
This base provides a set of functions for maths stuff.
void keep_max(T &var, const K test_val)
If the second argument is above the first one, set the first argument to this higher value...
void writeToStreamRender(mrpt::serialization::CArchive &out) const
mrpt::containers::ContainerReadOnlyProxyAccessor< mrpt::aligned_std_vector< float > > scan
The range values of the scan, in meters.
void render_dl() const override
Render.
This object renders a 2D laser scan by means of three elements: the points, the line along end-points...
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
double x
X,Y,Z coordinates.
GLAPI void GLAPIENTRY glBegin(GLenum mode)
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
mrpt::obs::CObservation2DRangeScan m_scan
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
static void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
void getPointsBuffer(size_t &outPointsCount, const float *&xs, const float *&ys, const float *&zs) const
Provides a direct access to points buffer, or nullptr if there is no points in the map...
void resizeScan(const size_t len)
Resizes all data vectors to allocate a given number of scan rays.
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=nullptr, bool use_small_rot_approx=false) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
IMPLEMENTS_SERIALIZABLE(CPlanarLaserScan, CRenderizableDisplayList, mrpt::opengl) CPlanarLaserScan
The namespace for 3D scene representation and rendering.
GLAPI void GLAPIENTRY glEnd(void)
TInsertionOptions insertionOptions
The options used when inserting observations in the map.
GLAPI void GLAPIENTRY glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
GLAPI void GLAPIENTRY glDisable(GLenum cap)
void clear()
Clear the contents of this container.
bool insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL)
Insert the observation information into this map.
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
void readFromStreamRender(mrpt::serialization::CArchive &in)
float minDistBetweenLaserPoints
The minimum distance between points (in 3D): If two points are too close, one of them is not inserted...
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.