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")
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++)
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::containers::ContainerReadOnlyProxyAccessor< mrpt::aligned_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.
void resizeScan(const size_t len)
Resizes all data vectors to allocate a given number of scan rays.
mrpt::containers::ContainerReadOnlyProxyAccessor< mrpt::aligned_std_vector< float > > scan
The range values of the scan, in meters.
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 serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
CPlanarLaserScan()
Constructor.
void render_dl() const override
Render.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
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.
void readFromStreamRender(mrpt::serialization::CArchive &in)
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
mrpt::poses::CPose3D m_pose
6D pose wrt the parent coordinate reference.
void writeToStreamRender(mrpt::serialization::CArchive &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.
Virtual base class for "archives": classes abstracting I/O streams.
#define ASSERT_(f)
Defines an assertion mechanism.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
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)
void clear()
Clear the contents of this container.
This base provides a set of functions for maths stuff.
The namespace for 3D scene representation and rendering.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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.
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.
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.