Nav2 Navigation Stack - lyrical  lyrical
ROS 2 Navigation Stack
Public Member Functions | Public Attributes | List of all members
nav2_simple_commander.occupancy_grid.PyOccupancyGrid Class Reference

Public Member Functions

def __init__ (self, OccupancyGrid occupancy_map)
 
def getSizeInCellsX (self)
 
def getSizeInCellsY (self)
 
def getSizeInMetersX (self)
 
def getSizeInMetersY (self)
 
def getOriginX (self)
 
def getOriginY (self)
 
def getResolution (self)
 
def getGlobalFrameID (self)
 
def getCostmapTimestamp (self)
 
def getCostXY (self, int mx, int my)
 
def getCostIdx (self, int index)
 
def setCost (self, int mx, int my, np.int8 cost)
 
def mapToWorld (self, int mx, int my)
 
def worldToMapValidated (self, float wx, float wy)
 
def getIndex (self, int mx, int my)
 

Public Attributes

 size_x
 
 size_y
 
 resolution
 
 origin_x
 
 origin_y
 
 global_frame_id
 
 costmap_timestamp
 
 costmap
 

Detailed Description

PyOccupancyGrid.

Occupancy grid Python3 API for OccupancyGrids to populate from published messages

Definition at line 28 of file occupancy_grid.py.

Constructor & Destructor Documentation

◆ __init__()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.__init__ (   self,
OccupancyGrid  occupancy_map 
)

Member Function Documentation

◆ getCostIdx()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getCostIdx (   self,
int  index 
)
Get the cost of a cell in the costmap using Index.

Args
----
    index (int): index of cell to get cost

Returns
-------
    np.int8: cost of a cell

Definition at line 110 of file occupancy_grid.py.

References nav2_simple_commander.costmap_2d.PyCostmap2D.costmap, nav2_simple_commander.occupancy_grid.PyOccupancyGrid.costmap, and nav2_voxel_grid::VoxelGrid.costmap.

◆ getCostmapTimestamp()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getCostmapTimestamp (   self)

◆ getCostXY()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getCostXY (   self,
int  mx,
int  my 
)

◆ getGlobalFrameID()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getGlobalFrameID (   self)

◆ getIndex()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getIndex (   self,
int  mx,
int  my 
)
Get the index of the cell using map coordinate XY.

Args
----
    mx (int): map coordinate X to get Index
    my (int): map coordinate Y to get Index

Returns
-------
    int: The index of the cell

Definition at line 187 of file occupancy_grid.py.

References map_t.size_x, nav2_simple_commander.costmap_2d.PyCostmap2D.size_x, nav2_simple_commander.occupancy_grid.PyOccupancyGrid.size_x, nav2_smac_planner::HybridMotionTable.size_x, and nav2_smac_planner::LatticeMotionTable.size_x.

Referenced by nav2_simple_commander.costmap_2d.PyCostmap2D.getCostXY(), nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getCostXY(), nav2_simple_commander.occupancy_grid.PyOccupancyGrid.setCost(), and nav2_simple_commander.costmap_2d.PyCostmap2D.setCost().

Here is the caller graph for this function:

◆ getOriginX()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getOriginX (   self)

◆ getOriginY()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getOriginY (   self)

◆ getResolution()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getResolution (   self)

◆ getSizeInCellsX()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getSizeInCellsX (   self)

◆ getSizeInCellsY()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getSizeInCellsY (   self)

◆ getSizeInMetersX()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getSizeInMetersX (   self)

◆ getSizeInMetersY()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.getSizeInMetersY (   self)

◆ mapToWorld()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.mapToWorld (   self,
int  mx,
int  my 
)
Get the world coordinate XY using map coordinate XY.

Args
----
    mx (int): map coordinate X to get world coordinate
    my (int): map coordinate Y to get world coordinate

Returns
-------
    tuple of float: wx, wy
    wx (float) [m]: world coordinate X
    wy (float) [m]: world coordinate Y

Definition at line 142 of file occupancy_grid.py.

References map_t.origin_x, nav2_simple_commander.costmap_2d.PyCostmap2D.origin_x, nav2_simple_commander.occupancy_grid.PyOccupancyGrid.origin_x, map_t.origin_y, nav2_simple_commander.costmap_2d.PyCostmap2D.origin_y, nav2_simple_commander.occupancy_grid.PyOccupancyGrid.origin_y, nav2_map_server::LoadParameters.resolution, nav2_simple_commander.costmap_2d.PyCostmap2D.resolution, and nav2_simple_commander.occupancy_grid.PyOccupancyGrid.resolution.

◆ setCost()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.setCost (   self,
int  mx,
int  my,
np.int8  cost 
)

◆ worldToMapValidated()

def nav2_simple_commander.occupancy_grid.PyOccupancyGrid.worldToMapValidated (   self,
float  wx,
float  wy 
)

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