15 #if MRPT_HAS_OPENGL_GLUT
16 #ifdef MRPT_OS_WINDOWS
22 #include <OpenGL/gl.h>
29 #if MRPT_HAS_OPENGL_GLUT && defined(MRPT_OS_WINDOWS)
31 #if defined(_MSC_VER) || defined(__BORLANDC__)
32 #pragma comment(lib, "opengl32.lib")
33 #pragma comment(lib, "GlU32.lib")
67 m_enable_points(true),
69 m_enable_surface(true)
87 #if MRPT_HAS_OPENGL_GLUT
102 const float *
x, *
y, *
z;
105 if (!
n || !
x)
return;
120 for (i = 0; i <
n - 1; i++)
139 for (i = 0; i <
n; i++)
155 for (i = 0; i <
n - 1; i++)
242 const float *
x, *
y, *
z;
245 if (!
n || !
x)
return;
248 std::numeric_limits<double>::max(), std::numeric_limits<double>::max(),
249 std::numeric_limits<double>::max());
251 -std::numeric_limits<double>::max(),
252 -std::numeric_limits<double>::max(),
253 -std::numeric_limits<double>::max());
255 for (
size_t i = 0; i <
n; i++)
IMPLEMENTS_SERIALIZABLE(CPlanarLaserScan, CRenderizableDisplayList, mrpt::opengl) CPlanarLaserScan
bool insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL)
Insert the observation information into this map.
void clear()
Erase all the contents of the map.
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.
TInsertionOptions insertionOptions
The options used when inserting observations in the map.
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< char > > validRange
It's false (=0) on no reflected rays, referenced to elements in scan.
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< float > > scan
The range values of the scan, in meters.
void resizeScan(const size_t len)
Resizes all data vectors to allocate a given number of scan rays.
This object renders a 2D laser scan by means of three elements: the points, the line along end-points...
mrpt::maps::CSimplePointsMap m_cache_points
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
CPlanarLaserScan()
Constructor.
void render_dl() const override
Render.
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
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...
mrpt::obs::CObservation2DRangeScan m_scan
A renderizable object suitable for rendering with OpenGL's display lists.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
void readFromStreamRender(mrpt::utils::CStream &in)
mrpt::poses::CPose3D m_pose
6D pose wrt the parent coordinate reference.
void writeToStreamRender(utils::CStream &out) const
static void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
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...
double x() const
Common members of all points & poses classes.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
GLAPI void GLAPIENTRY glEnable(GLenum cap)
GLAPI void GLAPIENTRY glPointSize(GLfloat size)
GLAPI void GLAPIENTRY glLineWidth(GLfloat width)
GLAPI void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
GLAPI void GLAPIENTRY glBegin(GLenum mode)
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
#define GL_ONE_MINUS_SRC_ALPHA
GLAPI void GLAPIENTRY glEnd(void)
GLAPI void GLAPIENTRY glDisable(GLenum cap)
GLAPI void GLAPIENTRY glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This base provides a set of functions for maths stuff.
The namespace for 3D scene representation and rendering.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...
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 clear()
Clear the contents of this container.
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.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
float minDistBetweenLaserPoints
The minimum distance between points (in 3D): If two points are too close, one of them is not inserted...
bool isPlanarMap
If set to true, only HORIZONTAL (in the XY plane) measurements will be inserted in the map (Default v...
double x
X,Y,Z coordinates.