rtd.planner.reachsets.ReachSetGenerator

class rtd.planner.reachsets.ReachSetGenerator[source]

Bases: object

Base class for the generation of reacheable sets for the planner

The ReachSetGenerator class interfaces out the generation of reachable sets for the RTD planner. It contains a built-in cache which is enabled if cache_max_size > 0. Caching is based on the id of the robot’s state and any extra arguments passed through the getReachableSet method. This class can be used to encapsulate reachable sets generated offline, or the online computation of reachable sets. It acts as a generator for a single instance of ReachableSet

__init__()[source]

Methods

__init__()

generateReachableSet(robotState, **options)

Generate a new reachable set given a robot state and extra arguments if desired

getReachableSet(robotState[, ignore_cache])

Get a reachable set instance for the given robot state and passthrough arguments

abstract generateReachableSet(robotState: EntityState, **options) dict[int, rtd.planner.reachsets.ReachSetInstance.ReachSetInstance][source]

Generate a new reachable set given a robot state and extra arguments if desired

This method generates the relevant reachable set for the robotState provided and outputs the singular instance of some reachable set. It should always create a new instance of a ReachableSetInstance

Parameters:

robotState – EntityState: Some entity state which the ReachableSetInstance is generated for.

Returns:

A dict of problem id to ReachSetInstance pairs

Return type:

dict

getReachableSet(robotState: EntityState, ignore_cache: bool = False, **options) dict[int, rtd.planner.reachsets.ReachSetInstance.ReachSetInstance][source]

Get a reachable set instance for the given robot state and passthrough arguments

This function handles how to actually get the reachable set with built in caching of already generated instances. It will call generateReachableSet as needed. This is useful if we need to use one reachable set in another reachable set and we don’t want to regenerate it online. It performs caching based on the id of the provided robotState and and the string cast of any additional arguments. If we don’t want to use the cache on one call, setting ignore_cache to true will bypass caching altogether

Parameters:
  • robotState – EntityState: Some state of used for generation / keying

  • ignore_cache – bool: If set true, the cache is completely ignored

Returns:

A dict of problem id to ReachSetInstance pairs

Return type:

dict