Nav2 Navigation Stack - humble  humble
ROS 2 Navigation Stack
Public Member Functions | Public Attributes | List of all members
nav2_simple_commander.costmap_2d.PyCostmap2D Class Reference

Public Member Functions

def __init__ (self, 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)
 
np.uint8 getCostXY (self, int mx, int my)
 
np.uint8 getCostIdx (self, int index)
 
None setCost (self, int mx, int my, np.uint8 cost)
 
tuple[float, float] mapToWorld (self, int mx, int my)
 
tuple[int, int] worldToMap (self, float wx, float wy)
 
int 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

PyCostmap2D.

Costmap Python3 API for OccupancyGrids to populate from published messages

Definition at line 28 of file costmap_2d.py.

Constructor & Destructor Documentation

◆ __init__()

def nav2_simple_commander.costmap_2d.PyCostmap2D.__init__ (   self,
  occupancy_map 
)

Member Function Documentation

◆ getCostIdx()

np.uint8 nav2_simple_commander.costmap_2d.PyCostmap2D.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.uint8: cost of a cell

Definition at line 106 of file costmap_2d.py.

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

◆ getCostmapTimestamp()

def nav2_simple_commander.costmap_2d.PyCostmap2D.getCostmapTimestamp (   self)
Get costmap timestamp.

Definition at line 86 of file costmap_2d.py.

References nav2_simple_commander.costmap_2d.PyCostmap2D.costmap_timestamp.

◆ getCostXY()

np.uint8 nav2_simple_commander.costmap_2d.PyCostmap2D.getCostXY (   self,
int  mx,
int  my 
)
Get the cost of a cell in the costmap using map coordinate XY.

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

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

Definition at line 90 of file costmap_2d.py.

References nav2_simple_commander.costmap_2d.PyCostmap2D.costmap, nav2_voxel_grid::VoxelGrid.costmap, nav2_smac_planner::Node2D.getIndex(), nav2_smac_planner::NodeHybrid.getIndex(), nav2_smac_planner::NodeLattice.getIndex(), theta_star::ThetaStar.getIndex(), nav2_simple_commander.costmap_2d.PyCostmap2D.getIndex(), and nav2_costmap_2d::Costmap2D.getIndex().

Here is the call graph for this function:

◆ getGlobalFrameID()

def nav2_simple_commander.costmap_2d.PyCostmap2D.getGlobalFrameID (   self)
Get global frame_id.

Definition at line 82 of file costmap_2d.py.

References nav2_simple_commander.costmap_2d.PyCostmap2D.global_frame_id.

◆ getIndex()

int nav2_simple_commander.costmap_2d.PyCostmap2D.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 178 of file costmap_2d.py.

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

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

Here is the caller graph for this function:

◆ getOriginX()

def nav2_simple_commander.costmap_2d.PyCostmap2D.getOriginX (   self)
Get the origin x axis of the map [m].

Definition at line 70 of file costmap_2d.py.

References map_t.origin_x, and nav2_simple_commander.costmap_2d.PyCostmap2D.origin_x.

◆ getOriginY()

def nav2_simple_commander.costmap_2d.PyCostmap2D.getOriginY (   self)
Get the origin y axis of the map [m].

Definition at line 74 of file costmap_2d.py.

References map_t.origin_y, and nav2_simple_commander.costmap_2d.PyCostmap2D.origin_y.

◆ getResolution()

def nav2_simple_commander.costmap_2d.PyCostmap2D.getResolution (   self)
Get map resolution [m/cell].

Definition at line 78 of file costmap_2d.py.

References nav2_map_server::LoadParameters.resolution, and nav2_simple_commander.costmap_2d.PyCostmap2D.resolution.

◆ getSizeInCellsX()

def nav2_simple_commander.costmap_2d.PyCostmap2D.getSizeInCellsX (   self)

◆ getSizeInCellsY()

def nav2_simple_commander.costmap_2d.PyCostmap2D.getSizeInCellsY (   self)
Get map height in cells.

Definition at line 58 of file costmap_2d.py.

References map_t.size_y, and nav2_simple_commander.costmap_2d.PyCostmap2D.size_y.

◆ getSizeInMetersX()

def nav2_simple_commander.costmap_2d.PyCostmap2D.getSizeInMetersX (   self)

◆ getSizeInMetersY()

def nav2_simple_commander.costmap_2d.PyCostmap2D.getSizeInMetersY (   self)

◆ mapToWorld()

tuple[float, float] nav2_simple_commander.costmap_2d.PyCostmap2D.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 138 of file costmap_2d.py.

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

◆ setCost()

None nav2_simple_commander.costmap_2d.PyCostmap2D.setCost (   self,
int  mx,
int  my,
np.uint8  cost 
)
Set the cost of a cell in the costmap using map coordinate XY.

Args
----
    mx (int): map coordinate X to get cost
    my (int): map coordinate Y to get cost
    cost (np.uint8): The cost to set the cell

Returns
-------
    None

Definition at line 121 of file costmap_2d.py.

References nav2_simple_commander.costmap_2d.PyCostmap2D.costmap, nav2_voxel_grid::VoxelGrid.costmap, nav2_smac_planner::Node2D.getIndex(), nav2_smac_planner::NodeHybrid.getIndex(), nav2_smac_planner::NodeLattice.getIndex(), theta_star::ThetaStar.getIndex(), nav2_simple_commander.costmap_2d.PyCostmap2D.getIndex(), and nav2_costmap_2d::Costmap2D.getIndex().

Here is the call graph for this function:

◆ worldToMap()

tuple[int, int] nav2_simple_commander.costmap_2d.PyCostmap2D.worldToMap (   self,
float  wx,
float  wy 
)
Get the map coordinate XY using world coordinate XY.

Args
----
    wx (float) [m]: world coordinate X to get map coordinate
    wy (float) [m]: world coordinate Y to get map coordinate

Returns
-------
    tuple of int: mx, my
    mx (int): map coordinate X
    my (int): map coordinate Y

Definition at line 158 of file costmap_2d.py.

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


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