Class: OccupancyGrid

OccupancyGrid(options)

new OccupancyGrid(options)

An OccupancyGrid can convert a ROS occupancy grid message into a THREE object.

Parameters:
Name Type Description
options

object with following keys:

  • message - the occupancy grid message
  • color (optional) - color of the visualized grid
  • opacity (optional) - opacity of the visualized grid (0.0 == fully transparent, 1.0 == opaque)
Source:

Methods

getColor(index, row, col, value)

Returns a color value given parameters of the position in the grid; the default implementation scales the default color value by the grid value. Subclasses can extend this functionality (e.g. lookup a color in a color map).

Parameters:
Name Type Description
index int

the current index of the cell

row int

the row of the cell

col int

the column of the cell

value float

the value of the cell

Source:
Returns:

r,g,b,a array of values from 0 to 255 representing the color values for each channel

getValue(index, row, col, data)

Returns the value for a given grid cell

Parameters:
Name Type Description
index int

the current index of the cell

row int

the row of the cell

col int

the column of the cell

data object

the data buffer

Source: