supereight
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
se::SensorBase< DerivedT > Class Template Reference

#include <sensor.hpp>

Public Member Functions

template<typename ConfigT >
 SensorBase (const ConfigT &c)
 
 SensorBase (const DerivedT &d)
 
template<typename ValidPredicate >
bool projectToPixelValue (const Eigen::Vector3f &point_S, const se::Image< float > &img, float &img_value, ValidPredicate valid_predicate) const
 Project a point in sensor frame to its image value. More...
 
template<typename ValidPredicate >
bool getPixelValue (const Eigen::Vector2f &pixel_f, const se::Image< float > &img, float &img_value, ValidPredicate valid_predicate) const
 Get the image value for a given pixel coordindate. More...
 
int computeIntegrationScale (const Eigen::Vector3f &block_centre_S, const float map_res, const int last_scale, const int min_scale, const int max_block_scale) const
 Computes the scale corresponding to the back-projected pixel size in voxel space. More...
 
float nearDist (const Eigen::Vector3f &ray_S) const
 Return the minimum distance at which measurements are available along the ray passing through pixels x and y. More...
 
float farDist (const Eigen::Vector3f &ray_S) const
 Return the maximum distance at which measurements are available along the ray passing through pixels x and y. More...
 
float measurementFromPoint (const Eigen::Vector3f &point_S) const
 Convert a point in the sensor frame into a depth measurement. More...
 
bool pointInFrustum (const Eigen::Vector3f &point_S) const
 Test whether a 3D point in sensor coordinates is inside the sensor frustum. More...
 
bool pointInFrustumInf (const Eigen::Vector3f &point_S) const
 Test whether a 3D point in sensor coordinates is inside the sensor frustum. More...
 
bool sphereInFrustum (const Eigen::Vector3f &centre_S, const float radius) const
 Test whether a sphere in sensor coordinates is at least partially inside the sensor frustum. More...
 
bool sphereInFrustumInf (const Eigen::Vector3f &centre_S, const float radius) const
 Test whether a sphere in sensor coordinates is at least partially inside the sensor frustum. More...
 

Static Public Member Functions

static std::string type ()
 Return the sensor type as a string. More...
 

Public Attributes

bool left_hand_frame
 
float near_plane
 
float far_plane
 
Eigen::Matrix4f T_BS
 

Constructor & Destructor Documentation

◆ SensorBase() [1/2]

template<typename DerivedT>
template<typename ConfigT >
se::SensorBase< DerivedT >::SensorBase ( const ConfigT &  c)

◆ SensorBase() [2/2]

template<typename DerivedT>
se::SensorBase< DerivedT >::SensorBase ( const DerivedT &  d)

Member Function Documentation

◆ projectToPixelValue()

template<typename DerivedT>
template<typename ValidPredicate >
bool se::SensorBase< DerivedT >::projectToPixelValue ( const Eigen::Vector3f &  point_S,
const se::Image< float > &  img,
float &  img_value,
ValidPredicate  valid_predicate 
) const

Project a point in sensor frame to its image value.

Template Parameters
ValidPredicate
Parameters
[in]point_SThe point to project to the image
[in]imgThe image to get the value from
[out]img_valueThe image value the point projects to
[in]valid_predicateThe lambda function verifying if the value is valid (e.g. infront of far dist)
Returns
True if the image value is valid, false otherwise

◆ getPixelValue()

template<typename DerivedT>
template<typename ValidPredicate >
bool se::SensorBase< DerivedT >::getPixelValue ( const Eigen::Vector2f &  pixel_f,
const se::Image< float > &  img,
float &  img_value,
ValidPredicate  valid_predicate 
) const

Get the image value for a given pixel coordindate.

Template Parameters
ValidPredicate
Parameters
[in]pixel_fThe pixel coordinates to get the image value from
[in]imgThe image to get the value from
[out]img_valueThe image value corresponding the the pixel
[in]valid_predicateThe lambda function verifying if the value is valid (e.g. infront of far dist)
Returns
True if the image value is valid, false otherwise

◆ computeIntegrationScale()

template<typename DerivedT>
int se::SensorBase< DerivedT >::computeIntegrationScale ( const Eigen::Vector3f &  block_centre_S,
const float  map_res,
const int  last_scale,
const int  min_scale,
const int  max_block_scale 
) const

Computes the scale corresponding to the back-projected pixel size in voxel space.

Parameters
[in]block_centre_SThe coordinates of the block centre in the sensor frame.
[in]map_resThe resolution of the map in [meter].
[in]last_scaleScale from which propagate up voxel values.
[in]min_scaleFinest scale at which data has been integrated into the voxel block (-1 if no data has been integrated yet).
[in]max_block_scaleThe maximum allowed scale within a VoxelBlock.
Returns
The scale that should be used for the integration.

◆ nearDist()

template<typename DerivedT>
float se::SensorBase< DerivedT >::nearDist ( const Eigen::Vector3f &  ray_S) const

Return the minimum distance at which measurements are available along the ray passing through pixels x and y.

This differs from the PinholeCamera::near_plane since the near_plane is a z-value while nearDist is a distance along a ray.

Parameters
[in]ray_SThe ray starting from the sensor centre and expressed in the sensor frame along which nearDist will be computed.
Returns
The minimum distance along the ray through the pixel at which valid measurements may be encountered.

◆ farDist()

template<typename DerivedT>
float se::SensorBase< DerivedT >::farDist ( const Eigen::Vector3f &  ray_S) const

Return the maximum distance at which measurements are available along the ray passing through pixels x and y.

This differs from the PinholeCamera::far_plane since the far_plane is a z-value while farDist is a distance along a ray.

Parameters
[in]ray_SThe ray starting from the sensor centre and expressed in the sensor frame along which nearDist will be computed.
Returns
The maximum distance along the ray through the pixel at which valid measurements may be encountered.

◆ measurementFromPoint()

template<typename DerivedT>
float se::SensorBase< DerivedT >::measurementFromPoint ( const Eigen::Vector3f &  point_S) const

Convert a point in the sensor frame into a depth measurement.

For the PinholeCamera this means returning the z-coordinate of the point.

Parameters
[in]point_CA point observed by the sensor expressed in the sensor frame.
Returns
The depth value that the sensor would get from this point.

◆ pointInFrustum()

template<typename DerivedT>
bool se::SensorBase< DerivedT >::pointInFrustum ( const Eigen::Vector3f &  point_S) const

Test whether a 3D point in sensor coordinates is inside the sensor frustum.

◆ pointInFrustumInf()

template<typename DerivedT>
bool se::SensorBase< DerivedT >::pointInFrustumInf ( const Eigen::Vector3f &  point_S) const

Test whether a 3D point in sensor coordinates is inside the sensor frustum.

The difference from PinholeCamera::pointInFrustum is that it is assumed that the far plane is at infinity.

◆ sphereInFrustum()

template<typename DerivedT>
bool se::SensorBase< DerivedT >::sphereInFrustum ( const Eigen::Vector3f &  centre_S,
const float  radius 
) const

Test whether a sphere in sensor coordinates is at least partially inside the sensor frustum.

It is tested whether the sphere's centre is inside the sensor frustum offest outwards by the sphere's radius. This is a quick test that in some rare cases may return a sphere as being visible although it isn't.

◆ sphereInFrustumInf()

template<typename DerivedT>
bool se::SensorBase< DerivedT >::sphereInFrustumInf ( const Eigen::Vector3f &  centre_S,
const float  radius 
) const

Test whether a sphere in sensor coordinates is at least partially inside the sensor frustum.

The difference from PinholeCamera::sphereInFrustum is that it is assumed that the far plane is at infinity.

◆ type()

template<typename DerivedT>
static std::string se::SensorBase< DerivedT >::type ( )
static

Return the sensor type as a string.

Member Data Documentation

◆ left_hand_frame

template<typename DerivedT>
bool se::SensorBase< DerivedT >::left_hand_frame

◆ near_plane

template<typename DerivedT>
float se::SensorBase< DerivedT >::near_plane

◆ far_plane

template<typename DerivedT>
float se::SensorBase< DerivedT >::far_plane

◆ T_BS

template<typename DerivedT>
Eigen::Matrix4f se::SensorBase< DerivedT >::T_BS

The documentation for this class was generated from the following file: