Namespace jalansim::map

Namespace List > jalansim > map

Namespaces

Type Name
namespace collection

Classes

Type Name
struct Map <typename T>
2D occupancy grid map with distance field.
struct MapCell <typename T>
Individual cell in the occupancy grid map.
class MapCollection <typename T>
Collection of maps for random sampling in batch simulations.

Public Types

Type Name
enum Mode
Image processing modes for occupancy grid conversion.

Public Functions

Type Name
Map< T > * load_image (const std::string & path, T resolution, T origin_x, T origin_y, T yaw, bool negate=false, T occ_th=0.65, T free_th=0.196, int padding=0, int padding_val=0, Mode mode=Mode::Trinary)
Load an occupancy grid map from an image file.

Public Types Documentation

enum Mode

Image processing modes for occupancy grid conversion.

enum jalansim::map::Mode {
    Trinary,
    Scale,
    Raw
};

Public Functions Documentation

function load_image

Load an occupancy grid map from an image file.

template<typename T>
inline Map < T > * jalansim::map::load_image (
    const std::string & path,
    T resolution,
    T origin_x,
    T origin_y,
    T yaw,
    bool negate=false,
    T occ_th=0.65,
    T free_th=0.196,
    int padding=0,
    int padding_val=0,
    Mode mode=Mode::Trinary
) 

Converts an image file (PNG, JPG, etc.) into an occupancy grid map. Supports various processing modes for converting pixel intensities to occupancy values. Handles coordinate transformation from image space to world coordinates with configurable origin and resolution.

Template parameters:

  • T Numeric type for map coordinates and resolution (float, double)

Parameters:

  • path Path to image file to load
  • resolution Size of each grid cell in world units (meters/pixel)
  • origin_x World X coordinate of map origin (grid cell 0,0)
  • origin_y World Y coordinate of map origin (grid cell 0,0)
  • yaw Rotation angle of the map (currently unused)
  • negate Invert pixel intensities (dark=occupied becomes light=occupied)
  • occ_th Occupancy threshold for classifying cells as occupied (0.0-1.0)
  • free_th Free space threshold for classifying cells as free (0.0-1.0)
  • padding Number of border cells to add around the image
  • padding_val Occupancy value for padding cells
  • mode Processing mode for converting pixels to occupancy values

Returns:

Pointer to newly created Map with loaded occupancy data

Exception:

  • std::runtime_error if image loading fails


The documentation for this class was generated from the following file include/jalansim/map/map.hpp