tbp.monty.frameworks.config_utils#

tbp.monty.frameworks.config_utils.make_env_interface_configs#

class DefaultObjectInitializer[source]#

Bases: object

post_episode()[source]#
post_epoch()[source]#
class PredefinedObjectInitializer(positions=None, rotations=None, scales=None, change_every_episode=None)[source]#

Bases: DefaultObjectInitializer

__init__(positions=None, rotations=None, scales=None, change_every_episode=None)[source]#
all_combinations_of_params()[source]#
post_episode()[source]#
post_epoch()[source]#
class RandomRotationObjectInitializer(position=None, scale=None)[source]#

Bases: DefaultObjectInitializer

__init__(position=None, scale=None)[source]#
make_sensor_positions_on_grid(n_sensors: int, delta: Number = 0.01, order_by: str = 'distance', add_view_finder: bool = True) numpy.ndarray[source]#

Generate sensor positions on a 2D grid.

Create mounting positions for an arbitrary number of sensors, where the sensors lie on an imaginary grid on the xy plane (and z = 0). Sensor position 0 is always centered at (0, 0, 0), and all other sensors are clustered around it. The method for selecting which grid points around the center to assign each sensor is determined by the order_by argument (see below).

By default, n_sensors + 1 positions are returned; the first n_sensors positions are for regular sensors, and an additional position is appended by default to accommodate a view finder. The view finder position (if used) is the same as sensor position 0 (i.e., (0, 0, 0)).

Parameters:
  • n_sensors (int) – Number of sensors. Count should not include a view finder.

  • delta (Number) – The grid spacing length. By default, sensors will be placed every centimeter (units are in meters).

  • order_by (str) –

    How to select points on the grid that will contain sensors.

    • ”spiral”: sensors are numbered along a counter-clockwise spiral

      spreading outwards from the center.

    • ”distance”: sensors are ordered by their distance from the center.

      This can result in a more jagged pattern along the edges but results in sensors generally more packed towards the center. Positions that are equidistant from the center are ordered counterclockwise starting at 3 o’clock.

  • add_view_finder (bool) – Whether to include an extra position module at the origin to serve as a view finder. Defaults to True.

Return type:

ndarray

Returns:

A 2D array of sensor positions where each row is an array of (x, y, z) positions. If add_view_finder is True, the array has n_sensors + 1 rows, where the last row corresponds to the view finder’s position and is identical to row 0. Otherwise, the array has n_sensors rows. row 0 is always centered at (0, 0, 0), and all other rows are offset relative to it.