Ark
Loading...
Searching...
No Matches
spaces.ActionSpace Class Reference

A class representing a space where actions are taken. More...

Inheritance diagram for spaces.ActionSpace:
spaces.Space

Public Member Functions

 __init__ (self, List action_channels, Callable action_packing, LCM lcm_instance)
 Create an action space.
 pack_and_publish (self, Any action)
 Pack an action and publish it.
Dict[str, Any] pack_message (self, Any action)
 Abstract method to pack the action into a message format suitable for LCM.
Public Member Functions inherited from spaces.Space
None shutdown (self)
 Abstract method to shut down the space, ensuring any resources are released.

Public Attributes

 action_space_publisher = MultiChannelPublisher(action_channels, lcm_instance)
 action_packing = action_packing
 messages_to_publish = None

Detailed Description

A class representing a space where actions are taken.

This space handles publishing of actions to a given LCM channel.

Parameters
actionchannels: Channel names where actions will be published. @type action_channels: List
action_packingA function that converts any types of action into dictionary @type action_packing: Callable
lcm_instanceCommunication variable @type lcm_instance: LCM

Constructor & Destructor Documentation

◆ __init__()

spaces.ActionSpace.__init__ ( self,
List action_channels,
Callable action_packing,
LCM lcm_instance )

Create an action space.

Parameters
action_channelsChannels to publish actions on.
action_packingCallback used to serialize actions.
lcm_instanceLCM instance used for communication.

Member Function Documentation

◆ pack_and_publish()

spaces.ActionSpace.pack_and_publish ( self,
Any action )

Pack an action and publish it.

◆ pack_message()

Dict[str, Any] spaces.ActionSpace.pack_message ( self,
Any action )

Abstract method to pack the action into a message format suitable for LCM.

Parameters
actionThe action to be packed into a message. @type action: Any
Returns
: The packed LCM message. @type: Dict

Member Data Documentation

◆ action_packing

spaces.ActionSpace.action_packing = action_packing

◆ action_space_publisher

spaces.ActionSpace.action_space_publisher = MultiChannelPublisher(action_channels, lcm_instance)

◆ messages_to_publish

spaces.ActionSpace.messages_to_publish = None

The documentation for this class was generated from the following file: