Public Member Functions | List of all members
gazebo::rendering::CameraLens Class Reference

Describes a lens of a camera as amapping function of type r = c1*f*fun(theta/c2+c3) More...

#include <rendering/rendering.hh>

Public Member Functions

 CameraLens ()
 Constructor. More...
 
 ~CameraLens ()=default
 Destructor. More...
 
double C1 () const
 Gets c1 parameter. More...
 
double C2 () const
 Gets c2 parameter. More...
 
double C3 () const
 Gets c3 parameter. More...
 
double CutOffAngle () const
 Gets cut off angle. More...
 
double F () const
 Gets f parameter. More...
 
std::string Fun () const
 Gets angle transform function. More...
 
void Init (const double _c1, const double _c2, const std::string &_fun, const double _f, const double _c3)
 Init custom camera lens with specified parameters. More...
 
void Init (const std::string &_name)
 Init camera lens with standard mapping function. More...
 
bool IsCustom () const
 Checks if lens type is of the custom type. More...
 
void Load (sdf::ElementPtr _sdf)
 Load camera lens from SDF file. More...
 
void Load ()
 Load camera lens with default parameters. More...
 
bool ScaleToHFOV () const
 Checks if image should be scaled to fit horizontal FOV. More...
 
void SetC1 (const double _c)
 Sets c1 parameter. More...
 
void SetC2 (const double _c)
 Sets c2 parameter. More...
 
void SetC3 (const double _c)
 Sets c3 parameter. More...
 
void SetCutOffAngle (const double _angle)
 Sets cut-off angle. More...
 
void SetF (const double _f)
 Sets f parameter. More...
 
void SetFun (const std::string &_fun)
 Sets angle transform function. More...
 
void SetScaleToHFOV (const bool _scale)
 Sets whether the image should be scaled to fit horizontal FOV. More...
 
void SetType (const std::string &_type)
 Set lens projection type. More...
 
void SetUniformVariables (Ogre::Pass *_pass, const float _ratio, const float _hfov)
 Set uniform variables of a shader for the provided material technique pass. More...
 
std::string Type () const
 Get lens projection type. More...
 

Detailed Description

Describes a lens of a camera as amapping function of type r = c1*f*fun(theta/c2+c3)

Constructor & Destructor Documentation

gazebo::rendering::CameraLens::CameraLens ( )

Constructor.

gazebo::rendering::CameraLens::~CameraLens ( )
default

Destructor.

Member Function Documentation

double gazebo::rendering::CameraLens::C1 ( ) const

Gets c1 parameter.

Returns
c1 parameter
double gazebo::rendering::CameraLens::C2 ( ) const

Gets c2 parameter.

Returns
c2 parameter
double gazebo::rendering::CameraLens::C3 ( ) const

Gets c3 parameter.

Returns
c3 parameter
double gazebo::rendering::CameraLens::CutOffAngle ( ) const

Gets cut off angle.

Returns
Cut off angle
double gazebo::rendering::CameraLens::F ( ) const

Gets f parameter.

Returns
f parameter
std::string gazebo::rendering::CameraLens::Fun ( ) const

Gets angle transform function.

Returns
Angle transform function string
void gazebo::rendering::CameraLens::Init ( const double  _c1,
const double  _c2,
const std::string &  _fun,
const double  _f,
const double  _c3 
)

Init custom camera lens with specified parameters.

Parameters
[in]_c1Image scaling factor
[in]_c2Angle scaling factor
[in]_funAngle transform function
[in]_fFocal length of the optical system
[in]_c3Angle shift parameter, should be 0 in most cases
void gazebo::rendering::CameraLens::Init ( const std::string &  _name)

Init camera lens with standard mapping function.

Parameters
[in]_nameMapping function name
bool gazebo::rendering::CameraLens::IsCustom ( ) const

Checks if lens type is of the custom type.

Returns
True if this->Type() == "custom"
void gazebo::rendering::CameraLens::Load ( sdf::ElementPtr  _sdf)

Load camera lens from SDF file.

Parameters
[in]_sdfSDF lens element
void gazebo::rendering::CameraLens::Load ( )

Load camera lens with default parameters.

bool gazebo::rendering::CameraLens::ScaleToHFOV ( ) const

Checks if image should be scaled to fit horizontal FOV.

Returns
True if the image will be scaled
void gazebo::rendering::CameraLens::SetC1 ( const double  _c)

Sets c1 parameter.

Parameters
[in]_cc1 parameter
void gazebo::rendering::CameraLens::SetC2 ( const double  _c)

Sets c2 parameter.

Parameters
[in]_cc2 parameter
void gazebo::rendering::CameraLens::SetC3 ( const double  _c)

Sets c3 parameter.

Parameters
[in]_cc3 parameter
void gazebo::rendering::CameraLens::SetCutOffAngle ( const double  _angle)

Sets cut-off angle.

Parameters
[in]_anglecut-off angle
void gazebo::rendering::CameraLens::SetF ( const double  _f)

Sets f parameter.

Parameters
[in]_ff parameter
void gazebo::rendering::CameraLens::SetFun ( const std::string &  _fun)

Sets angle transform function.

Parameters
[in]_funAngle transform function string
void gazebo::rendering::CameraLens::SetScaleToHFOV ( const bool  _scale)

Sets whether the image should be scaled to fit horizontal FOV.

Parameters
[in]_scaletrue if it should, note: c1 and f parameters are ignored in this case
void gazebo::rendering::CameraLens::SetType ( const std::string &  _type)

Set lens projection type.

Parameters
[in]_typeLens projection type string
void gazebo::rendering::CameraLens::SetUniformVariables ( Ogre::Pass *  _pass,
const float  _ratio,
const float  _hfov 
)

Set uniform variables of a shader for the provided material technique pass.

Parameters
[in]_passOgre::Pass used for rendering
[in]_ratioFrame aspect ratio
[in]_hfovHorizontal field of view
std::string gazebo::rendering::CameraLens::Type ( ) const

Get lens projection type.

Returns
Lens projection type string

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