dm_robotics.panda.utils module¶
Utility module for the Panda MoMa model.
- class dm_robotics.panda.utils.ActionPlot(runtime: Runtime, maxlen: int = 500)[source]¶
Bases:
Plot
A plotting component for
dm_control.viewer.application.Application
that plots the agent’s actions.
- class dm_robotics.panda.utils.ApplicationWithPlot(title='Explorer', width=1024, height=768)[source]¶
Bases:
Application
Extends the
dm_control
viewer to show live plots.
- class dm_robotics.panda.utils.Formatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]¶
Bases:
Formatter
Logging formatter for the Panda MoMa model.
- format(record: LogRecord) str [source]¶
Format the specified record as text.
The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
- class dm_robotics.panda.utils.ObservationPlot(runtime: Runtime, maxlen: int = 500)[source]¶
Bases:
Plot
Plotting component for
dm_control.viewer.application.Application
that allows you to browse through the observations.
- class dm_robotics.panda.utils.Plot(runtime: Runtime, maxlen: int)[source]¶
Bases:
Component
,ABC
Abstract base class for plotting components.
- class dm_robotics.panda.utils.PlotHelp[source]¶
Bases:
ColumnTextModel
Displays help for navigating observation plots.
- class dm_robotics.panda.utils.RewardPlot(runtime: Runtime, maxlen: int = 500)[source]¶
Bases:
Plot
A plotting component for
dm_control.viewer.application.Application
that plots the environment’s reward.
- class dm_robotics.panda.utils.TimeSensor[source]¶
Bases:
Sensor
MoMa sensor measuring simulation time.
- initialize_episode(physics: Physics, random_state: RandomState) None [source]¶
Called on a new episode, after the environment has been reset.
This is called before the agent has got a timestep in the episode that is about to start. Sensors can reset any state they may have.
- Parameters:
physics – The MuJoCo physics the environment uses.
random_state – A PRNG seed.
- property name: str¶
- property observables: Dict[str, Observable]¶
Get the observables for this Sensor.
This will be called after initialize_for_task.
It’s expected that the keys in this dict are values from self.get_obs_key(SOME_ENUM_VALUE), the values are Observables. See the class docstring for more information about Observable.
subclassing dm_control.composer.observation.observable.Generic is a simple way to create an Observable. Observables have many properties that are used by composer to alter how the values it produces are processed.
See the code dm_control.composer.observation for more information.
- dm_robotics.panda.utils.default_arg_parser(desc: str = 'dm_robotics_panda', dual_arm: bool = False) ArgumentParser [source]¶
Create an ArgumentParser with default parameters. :param desc: Description shown in the help screen. :param dual_arm: Create parameters for a dual-arm setup.
- dm_robotics.panda.utils.full_spec(env: Environment)[source]¶
Prints the full specification of the environment, i.e. action, observation and reward spec.