GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Static Protected Attributes | Friends | List of all members
gpu_coverage::RobotSceneConfiguration Class Reference

Represents a combined configuration of the robot and the articulation objects. More...

#include <RobotSceneConfiguration.h>

Classes

struct  ArticulationCost
 Linear cost function for manipulating an articulated scene object. More...
 

Public Member Functions

 RobotSceneConfiguration ()
 Constructor.
 
 RobotSceneConfiguration (const RobotSceneConfiguration &other)
 Copy constructor. More...
 
virtual ~RobotSceneConfiguration ()
 Destructor.
 
float getCost (RobotSceneConfiguration &previousConfig) const
 Computes the cost for transitioning from a previous configuration. More...
 
float getGain (RobotSceneConfiguration &previousConfig) const
 Calculates the information gain achieved by moving to the new configuration. More...
 
float getEvaluation (RobotSceneConfiguration &previousConfig) const
 Returns the evaluation of the current config. More...
 
void set (const RobotSceneConfiguration &other)
 Copy the configuration over from another configuration. More...
 
void setRandomArticulation (unsigned int &seed)
 Sets a random articulated object to a random configuration and the other articulated objects to the zero configuration. More...
 
void setRandomCameraHeight (unsigned int &seed)
 Sets the camera height to a random value within the feasible range. More...
 
void setRandomCameraPosition (unsigned int &seed, const std::vector< glm::vec3 > *const targetPoints)
 Sets the camera pose to a random pose with the camera facing a random point from targetPoints. More...
 
void setCameraHeight (const float &value)
 Sets the camera height. More...
 
void setCameraLocalTransform (const glm::mat4x4 &cameraTransform)
 Sets the camera to a given pose. More...
 
const glm::mat4x4 & getCameraLocalTransform () const
 Returns the camera pose. More...
 
void applyToScene (Scene *const scene) const
 Applies the articulation configuration to the scene and re-computes the scene graph transformations. More...
 
float getArticulation (const size_t &handle) const
 Returns the current articulation pose for a given articulated object. More...
 
void setArticulation (const size_t &handle, const float &value)
 Sets the current articulation pose for a given articulated object. More...
 
const GLuint & getCount () const
 Returns the total number of observed pixels so far. More...
 
void setCount (const GLuint &count)
 Sets the total number of observed pixels so far. More...
 

Static Public Member Functions

static void loadCosts ()
 Load the cost coefficients and feasible ranges from the configuration file. More...
 

Static Public Attributes

static size_t numArticulation
 The maximum number of articulated objects, hard-coded to 20.
 

Protected Attributes

glm::mat4x4 cameraLocalTransform
 Camera pose as homogeneous transformation matrix in world coordinates.
 
glm::vec3 cameraPosition
 Camera position in world coordinates.
 
float * articulation
 Array current of articulation positions.
 
GLuint count
 Total number of observed pixels so far.
 

Static Protected Attributes

static float costCameraHeightChange
 Cost factor for changing the height of the camera, see loadCosts()
 
static float costDistance
 Cost factor for moving the camera (Euclidean distance), see loadCosts()
 
static float minCameraHeight
 Minimum feasible camera height above ground, see loadCosts()
 
static float maxCameraHeight
 Maximum feasible camera height above ground, see loadCosts()
 
static float gainFactor
 Coefficient for weighting the information gain relative to the costs, see loadCosts()
 
static ArticulationCostcostArticulation
 Linear cost function for changing articulation, see loadCosts()
 

Friends

class RandomSearchTask
 
class HillclimbingTask
 

Detailed Description

Represents a combined configuration of the robot and the articulation objects.

Constructor & Destructor Documentation

gpu_coverage::RobotSceneConfiguration::RobotSceneConfiguration ( const RobotSceneConfiguration other)
explicit

Copy constructor.

Parameters
[in]otherRobotSceneConfiguration to copy data from.

Member Function Documentation

void gpu_coverage::RobotSceneConfiguration::applyToScene ( Scene *const  scene) const

Applies the articulation configuration to the scene and re-computes the scene graph transformations.

Parameters
[in]sceneThe scene to which to apply the articulation configuration.
float gpu_coverage::RobotSceneConfiguration::getArticulation ( const size_t &  handle) const
inline

Returns the current articulation pose for a given articulated object.

Parameters
[in]handleThe index of the articulated object.
Returns
The articulation value between 0.0 and 1.0.
Exceptions
std::out_of_rangeThe index of the articulated object is out of range.
const glm::mat4x4& gpu_coverage::RobotSceneConfiguration::getCameraLocalTransform ( ) const
inline

Returns the camera pose.

Returns
The camera pose as a 4x4 homogeneous transformation matrix in world coordinates.
float gpu_coverage::RobotSceneConfiguration::getCost ( RobotSceneConfiguration previousConfig) const

Computes the cost for transitioning from a previous configuration.

Parameters
[in]previousConfigThe previous configuration.
Returns
Cost value.

The cost consists of costs for moving the camera from the old position to the new position and the costs for changing the articulated objects' configurations. See loadCosts() for loading the cost coefficients.

const GLuint& gpu_coverage::RobotSceneConfiguration::getCount ( ) const
inline

Returns the total number of observed pixels so far.

Returns
Number of observed pixels.
See also
setCount()
float gpu_coverage::RobotSceneConfiguration::getEvaluation ( RobotSceneConfiguration previousConfig) const
inline

Returns the evaluation of the current config.

Parameters
[in]previousConfigThe previous config.
Returns
Evaluation value.

The evaluation value is the information gain minus the costs for getting from the previous configuration to the current configuration.

See getGain() and getCosts() for the individual components.

float gpu_coverage::RobotSceneConfiguration::getGain ( RobotSceneConfiguration previousConfig) const

Calculates the information gain achieved by moving to the new configuration.

Parameters
[in]previousConfigThe previous configuration.
Returns
Information gain value.

Before calling this method, the setCount() method needs to be called with the number of observed pixels for both the previous and current configuration.

static void gpu_coverage::RobotSceneConfiguration::loadCosts ( )
static

Load the cost coefficients and feasible ranges from the configuration file.

The following parameters are used:

Parameter Description Comment
costCameraHeightChange Cost factor for changing the height of the camera
costDistance Cost factor for moving the camera (Euclidean distance)
costArticulation Linear cost function for changing articulation (see ArticulationCost) hard-coded, should be moved to config file
minCameraHeight Minimum feasible camera height above ground
maxCameraHeight Maximum feasible camera height above ground
gainFactor Coefficient for weighting the information gain relative to the costs
void gpu_coverage::RobotSceneConfiguration::set ( const RobotSceneConfiguration other)
inline

Copy the configuration over from another configuration.

Parameters
[in]otherThe other configuration to copy from.
void gpu_coverage::RobotSceneConfiguration::setArticulation ( const size_t &  handle,
const float &  value 
)
inline

Sets the current articulation pose for a given articulated object.

Parameters
[in]handleThe index of the articulated object.
[in]Thearticulation value between 0.0 and 1.0.
Exceptions
std::out_of_rangeThe index of the articulated object is out of range.
void gpu_coverage::RobotSceneConfiguration::setCameraHeight ( const float &  value)

Sets the camera height.

Parameters
[in]valueThe new camera height above the ground.
void gpu_coverage::RobotSceneConfiguration::setCameraLocalTransform ( const glm::mat4x4 &  cameraTransform)

Sets the camera to a given pose.

Parameters
[in]valueThe camera pose as a 4x4 homogeneous transformation matrix in world coordinates.
void gpu_coverage::RobotSceneConfiguration::setCount ( const GLuint &  count)
inline

Sets the total number of observed pixels so far.

Returns
Number of observed pixels.
See also
getCount()
void gpu_coverage::RobotSceneConfiguration::setRandomArticulation ( unsigned int &  seed)

Sets a random articulated object to a random configuration and the other articulated objects to the zero configuration.

Parameters
[in]seedRandom seed.
void gpu_coverage::RobotSceneConfiguration::setRandomCameraHeight ( unsigned int &  seed)

Sets the camera height to a random value within the feasible range.

Parameters
[in]seedRandom seed.
void gpu_coverage::RobotSceneConfiguration::setRandomCameraPosition ( unsigned int &  seed,
const std::vector< glm::vec3 > *const  targetPoints 
)

Sets the camera pose to a random pose with the camera facing a random point from targetPoints.

Parameters
[in]seedRandom seed.
[in]targetPointsA list of 3D points in world coordinates

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