Simox
2.3.74.0
|
Data Structures | |
struct | Extends |
struct | Size |
Public Types | |
enum | CellUpdateMode { MIN, MAX } |
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | WorkspaceGrid (float minX, float maxX, float minY, float maxY, float discretizeSize, bool checkNeighbors=false) |
~WorkspaceGrid () | |
int | getEntry (float x, float y) |
returns entry of position in x/y plane (in world coords) More... | |
bool | getEntry (float x, float y, int &storeEntry, GraspPtr &storeGrasp) |
bool | getEntry (float x, float y, int &nStoreEntry, std::vector< GraspPtr > &storeGrasps) |
int | getCellEntry (int cellX, int cellY) |
returns entry of discretized square (x/y) More... | |
bool | getCellEntry (int cellX, int cellY, int &nStoreEntry, GraspPtr &storeGrasp) |
bool | getCellEntry (int cellX, int cellY, int &nStoreEntry, std::vector< GraspPtr > &storeGrasps) |
void | setEntry (float x, float y, int value, GraspPtr grasp) |
void | setCellEntry (int cellX, int cellY, int value, GraspPtr pGrasp) |
int | getMaxEntry () |
void | setEntryCheckNeighbors (float x, float y, int value, GraspPtr grasp) |
bool | getRandomPos (int minEntry, float &storeXGlobal, float &storeYGlobal, GraspPtr &storeGrasp, int maxLoops=50, int *entries=NULL) |
tries to find a random position with a entry >= minEntry More... | |
bool | getRandomPos (int minEntry, float &storeXGlobal, float &storeYGlobal, std::vector< GraspPtr > &storeGrasps, int maxLoops=50, int *entries=NULL) |
void | reset () |
bool | fillGridData (WorkspaceRepresentationPtr ws, ManipulationObjectPtr o, GraspPtr g, RobotNodePtr baseRobotNode, float baseOrientation=0, float maxAngle=M_PIf32) |
bool | fillGridData (WorkspaceRepresentationPtr ws, const Eigen::Matrix4f &graspGlobal, GraspPtr g, RobotNodePtr baseRobotNode, float baseOrientation=0, float maxAngle=M_PIf32, float minCenterDistance=0) |
void | setGridPosition (float x, float y) |
void | getExtends (float &storeMinX, float &storeMaxX, float &storeMinY, float &storeMaxY) |
Extends | getExtends () const |
void | setCellUpdateMode (const CellUpdateMode mode) |
void | getCells (int &storeCellsX, int &storeCellsY) |
Size | getCells () const |
Eigen::Vector2f | getPosition (int cellX, int cellY) const |
float | getDiscretizeSize () const |
Eigen::Vector2f | getMin () const |
Eigen::Vector2f | getMax () const |
Static Public Member Functions | |
static WorkspaceGridPtr | MergeWorkspaceGrids (const std::vector< WorkspaceGridPtr > &reachGrids) |
Creates the intersection between multiple grids into one grid by considering for each x,y position the worst values of all grids. More... | |
Protected Member Functions | |
void | setEntries (std::vector< WorkspaceRepresentation::WorkspaceCut2DTransformationPtr > &wsData, const Eigen::Matrix4f &graspGlobal, GraspPtr grasp) |
void | checkAndReplaceValue (int &val, int newVal) |
int | getDataPos (int x, int y) |
Protected Attributes | |
float | minX |
float | maxX |
float | minY |
float | maxY |
float | discretizeSize |
int | gridSizeX |
int | gridSizeY |
float | gridExtendX |
float | gridExtendY |
int * | data |
std::vector< GraspPtr > * | graspLink |
const bool | checkNeighbors |
A 2D grid which represents a quality distribution (e.g. the reachability) at 2D positions w.r.t. one or multiple grasp(s). Internally the inverse workspace data (
VirtualRobot::WorkspaceGrid::WorkspaceGrid | ( | float | minX, |
float | maxX, | ||
float | minY, | ||
float | maxY, | ||
float | discretizeSize, | ||
bool | checkNeighbors = false |
||
) |
Setup the 2D grid with given extends and discretization parameter.
VirtualRobot::WorkspaceGrid::~WorkspaceGrid | ( | ) |
|
protected |
bool VirtualRobot::WorkspaceGrid::fillGridData | ( | WorkspaceRepresentationPtr | ws, |
ManipulationObjectPtr | o, | ||
GraspPtr | g, | ||
RobotNodePtr | baseRobotNode, | ||
float | baseOrientation = 0 , |
||
float | maxAngle = M_PIf32 |
||
) |
Fill the grid with inverse reachability data generated from grasp g and object o.
bool VirtualRobot::WorkspaceGrid::fillGridData | ( | WorkspaceRepresentationPtr | ws, |
const Eigen::Matrix4f & | graspGlobal, | ||
GraspPtr | g, | ||
RobotNodePtr | baseRobotNode, | ||
float | baseOrientation = 0 , |
||
float | maxAngle = M_PIf32 , |
||
float | minCenterDistance = 0 |
||
) |
int VirtualRobot::WorkspaceGrid::getCellEntry | ( | int | cellX, |
int | cellY | ||
) |
returns entry of discretized square (x/y)
bool VirtualRobot::WorkspaceGrid::getCellEntry | ( | int | cellX, |
int | cellY, | ||
int & | nStoreEntry, | ||
GraspPtr & | storeGrasp | ||
) |
bool VirtualRobot::WorkspaceGrid::getCellEntry | ( | int | cellX, |
int | cellY, | ||
int & | nStoreEntry, | ||
std::vector< GraspPtr > & | storeGrasps | ||
) |
void VirtualRobot::WorkspaceGrid::getCells | ( | int & | storeCellsX, |
int & | storeCellsY | ||
) |
Number of cells in x and y
|
inline |
|
inlineprotected |
float VirtualRobot::WorkspaceGrid::getDiscretizeSize | ( | ) | const |
int VirtualRobot::WorkspaceGrid::getEntry | ( | float | x, |
float | y | ||
) |
returns entry of position in x/y plane (in world coords)
bool VirtualRobot::WorkspaceGrid::getEntry | ( | float | x, |
float | y, | ||
int & | storeEntry, | ||
GraspPtr & | storeGrasp | ||
) |
Gets the corresponding entry of a world / global 2d position.
x | The x coordinate (in global coordinate system) |
y | The y coordinate (in global coordinate system) |
storeEntry | The corresponding entry is stored. |
storeGrasp | A random grasp of corresponding cell is stored. |
bool VirtualRobot::WorkspaceGrid::getEntry | ( | float | x, |
float | y, | ||
int & | nStoreEntry, | ||
std::vector< GraspPtr > & | storeGrasps | ||
) |
void VirtualRobot::WorkspaceGrid::getExtends | ( | float & | storeMinX, |
float & | storeMaxX, | ||
float & | storeMinY, | ||
float & | storeMaxY | ||
) |
Get extends in global coord system.
|
inline |
Eigen::Vector2f VirtualRobot::WorkspaceGrid::getMax | ( | ) | const |
int VirtualRobot::WorkspaceGrid::getMaxEntry | ( | ) |
Eigen::Vector2f VirtualRobot::WorkspaceGrid::getMin | ( | ) | const |
Eigen::Vector2f VirtualRobot::WorkspaceGrid::getPosition | ( | int | cellX, |
int | cellY | ||
) | const |
bool VirtualRobot::WorkspaceGrid::getRandomPos | ( | int | minEntry, |
float & | storeXGlobal, | ||
float & | storeYGlobal, | ||
GraspPtr & | storeGrasp, | ||
int | maxLoops = 50 , |
||
int * | entries = NULL |
||
) |
tries to find a random position with a entry >= minEntry
bool VirtualRobot::WorkspaceGrid::getRandomPos | ( | int | minEntry, |
float & | storeXGlobal, | ||
float & | storeYGlobal, | ||
std::vector< GraspPtr > & | storeGrasps, | ||
int | maxLoops = 50 , |
||
int * | entries = NULL |
||
) |
|
static |
Creates the intersection between multiple grids into one grid by considering for each x,y position the worst values of all grids.
reachGrids | grids for different grasp poses or object poses |
void VirtualRobot::WorkspaceGrid::reset | ( | ) |
Clear all entries.
void VirtualRobot::WorkspaceGrid::setCellEntry | ( | int | cellX, |
int | cellY, | ||
int | value, | ||
GraspPtr | pGrasp | ||
) |
|
inline |
|
protected |
Adds data stored in reachability transformations. This data defines transformations from robot base system to grasping pose, so when defining a grasping pose, the inverse reachability can be represented by this grid Therefor the "world coordinates" of the inverse reachability distributions are computed by T_grasp * ReachTransformation^-1
void VirtualRobot::WorkspaceGrid::setEntry | ( | float | x, |
float | y, | ||
int | value, | ||
GraspPtr | grasp | ||
) |
sets the entry to value, if the current value is lower
void VirtualRobot::WorkspaceGrid::setEntryCheckNeighbors | ( | float | x, |
float | y, | ||
int | value, | ||
GraspPtr | grasp | ||
) |
This method sets the grid value to nValue and checks if the neighbors have a lower value and in case the value of the neighbors is set to nValue.
void VirtualRobot::WorkspaceGrid::setGridPosition | ( | float | x, |
float | y | ||
) |
Move the grid to (x,y), given in global coordinate system. Sets the new center.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |