offworld_gym.envs.real.core package

Submodules

offworld_gym.envs.real.core.request module

class offworld_gym.envs.real.core.request.DisconnectRequest(web_token, channel_type)[source]

Bases: offworld_gym.envs.real.core.request.Request

Server Disconnect request

URI

String constant containing uri to access disconnet api.

web_token

String with the server’s web token.

URI = '/owgym/disconnect'
class offworld_gym.envs.real.core.request.MonolithContinousResetRequest(web_token, channel_type=<Channels.DEPTH_ONLY: 1>)[source]

Bases: offworld_gym.envs.real.core.request.Request

Environment reset request model

URI

String constant containing uri to access reset api.

web_token

String with the server’s web token.

channel_type

Channels type value indicating type of channel for observation.

no_value

Boolean value to determine if action is to be taken during reset.

URI = '/owgym/monolithcontinous/reset'
class offworld_gym.envs.real.core.request.MonolithDiscreteActionRequest(web_token, action_type=<FourDiscreteMotionActions.FORWARD: 2>, channel_type=<Channels.DEPTH_ONLY: 1>, algorithm_mode=<AlgorithmMode.TRAIN: 'train'>)[source]

Bases: offworld_gym.envs.real.core.request.Request

Environment action request model

URI

String constant containing uri to access action api.

web_token

String with the server’s web token.

channel_type

Channels type indicating type of channel for observation.

action_type

FourDiscreteMotionActions type value indicating type of action.

URI = '/owgym/monolithdiscrete/action'
class offworld_gym.envs.real.core.request.MonolithDiscreteResetRequest(web_token, channel_type=<Channels.DEPTH_ONLY: 1>)[source]

Bases: offworld_gym.envs.real.core.request.Request

Environment reset request model

URI

String constant containing uri to access reset api.

web_token

String with the server’s web token.

channel_type

Channels type value indicating type of channel for observation.

no_value

Boolean value to determine if action is to be taken during reset.

URI = '/owgym/monolithdiscrete/reset'
class offworld_gym.envs.real.core.request.Request(web_token)[source]

Bases: object

Base class for backend api requests

web_token

String with the server’s web token.

to_dict()[source]

Returns the class properties encapsulated in a dictionary

to_json()[source]

Returns a JSON representation of the request object

class offworld_gym.envs.real.core.request.SetUpRequest(web_token, experiment_name, resume_experiment, learning_type, algorithm_mode, environment_name)[source]

Bases: offworld_gym.envs.real.core.request.Request

Robot heartbeat request model

URI

String constant containing uri to access setup api.

web_token

String with the server’s web token.

experiment_name

String containing the experiment name.

resume_experiment

Boolean indicating whether existing experiment is to be resumed.

learning_type

String value indicating whether type is end2end, humandemos or sim2real.

STATUS_RUNNING = 'STATUS_RUNNING'
URI = '/owgym/setup'
class offworld_gym.envs.real.core.request.TokenRequest(api_token)[source]

Bases: object

Request model for getting a web token from the server

URI

String constant containing uri to access initiate api.

api_token

String with the user’s api token.

URI = '/owgym/initiate'
to_dict()[source]
to_json()[source]

offworld_gym.envs.real.core.secured_bridge module

class offworld_gym.envs.real.core.secured_bridge.SecuredBridge[source]

Bases: object

Secured rest-based communication over HTTPS.

This securely sends/recieves content to/from the OffWorld Gym server.

disconnect(channel_type)[source]

Disconnect from the backend.

monolith_continous_perform_action(action, channel_type, algorithm_mode)[source]

Perform an action on the robot

Parameters
  • action_type – FourDiscreteMotionActions type value with the action to execute.

  • channel_type – Channels type value, determines observation’s channel.

  • algorithm_mode – Whether algorithm is being run in train or test modde.

Returns

A numpy array as the observation. An integer value represeting reward from the environment. A boolean value that indicates whether episode is done or not.

monolith_continous_perform_reset(channel_type=<Channels.DEPTH_ONLY: 1>)[source]

Requests server to reset the environment.

Parameters

channel_type – Channels type value, determines observation’s channel.

Returns

A numpy array as the observation.

monolith_discrete_perform_action(action_type, channel_type, algorithm_mode)[source]

Perform an action on the robot

Parameters
  • action_type – FourDiscreteMotionActions type value with the action to execute.

  • channel_type – Channels type value, determines observation’s channel.

  • algorithm_mode – Whether algorithm is being run in train or test modde.

Returns

A numpy array as the observation. An integer value represeting reward from the environment. A boolean value that indicates whether episode is done or not.

monolith_discrete_perform_reset(channel_type=<Channels.DEPTH_ONLY: 1>)[source]

Requests server to reset the environment.

Parameters

channel_type – Channels type value, determines observation’s channel.

Returns

A numpy array as the observation.

perform_handshake(experiment_name, resume_experiment, learning_type, algorithm_mode, environment_name)[source]

Perform handshake with the gym server.

To perform a handshake: initiate communication with the server, get the robot’s heartbeat, send experiment details to the server.

Parameters
  • experiment_name – String value as the experiment name.

  • resume_experiment – Boolean value to indicate if existing experiment is to be resumed.

  • learning_type – String value indicating whether type is end2end, humandemos or sim2real.

Returns

A string value with the heartbeat status. A boolean value to indicate whether experiment was registered or not. A string containing message from the server.

settings_dict = {'debug': False, 'gym_server': {'protocol': 'https', 'secured_port': 8443, 'server_ip': '137.27.196.190'}, 'log': {'disable_file_log_stream': True, 'log_folder': 'logs'}, 'user': {'api_token': 'OFFWORLD_GYM_ACCESS_TOKEN'}}

Module contents