Custom Environment that follows gym interface.
More...
|
| None | __init__ (self, str env_path, str urdf, bool use_graphics, int worker_id=0) |
| | The SimEnv class initializer. More...
|
| |
| None | set_goal (self, tuple goal) |
| | Set the coordinates of the goal visualization. More...
|
| |
| None | set_workspace (self, tuple workspace) |
| | Set the coordinates and size of the workspace visualization. More...
|
| |
| None | build_wall (self, List[List[bool]] wall) |
| | Build a new wall The first wall will be built on a certain distance from the anchor. More...
|
| |
|
None | remove_walls (self) |
| | Remove all walls.
|
| |
| None | replace_walls (self, List[List[bool]] wall) |
| | Replace all the walls, build 1 new one See build_wall for how a wall is represented. More...
|
| |
| np.ndarray | step (self, np.ndarray action, return_observations=True) |
| | Do 1 step in the unity environment. More...
|
| |
| np.ndarray | reset (self) |
| | Reset the Unity Environment, essentially starting a new episode. More...
|
| |
| None | pause (self, steps=200) |
| | For a certain amount of steps, take no action. More...
|
| |
|
None | close (self) |
| | Gym interface function to close the environment.
|
| |
| np.ndarray | get_current_state (self) |
| | Get the observations from the Unity environment. More...
|
| |
|
|
| env_path |
| |
|
| urdf |
| |
|
| use_graphics |
| |
|
| worker_id |
| |
|
| joint_amount |
| |
|
| u_env |
| |
|
| behavior_name |
| |
|
| behavior_spec |
| |
|
|
dictionary | metadata = {'render.modes': ['human']} |
| |
|
int | MAX_N_MODULES = 10 |
| |
|
int | JOINT_ANGLE_STEP = 10 |
| |
Custom Environment that follows gym interface.
◆ __init__()
| None environment.environment.SimEnv.__init__ |
( |
|
self, |
|
|
str |
env_path, |
|
|
str |
urdf, |
|
|
bool |
use_graphics, |
|
|
int |
worker_id = 0 |
|
) |
| |
The SimEnv class initializer.
- Parameters
-
| env_path | Path of the environment executable. |
| urdf | Instance that represents the robot urdf. |
| use_graphics | Boolean that turns graphics on or off. |
- Returns
- An instance of the SimEnv class.
◆ build_wall()
| None environment.environment.SimEnv.build_wall |
( |
|
self, |
|
|
List[List[bool]] |
wall |
|
) |
| |
Build a new wall The first wall will be built on a certain distance from the anchor.
Every subsequent wall will be built on a certain distance from the previous wall.
Walls are represented by a 2D array of booleans True means there is a tile on that 'coordinate/index' and False meaning there is not
- Parameters
-
◆ get_current_state()
| np.ndarray environment.environment.SimEnv.get_current_state |
( |
|
self | ) |
|
Get the observations from the Unity environment.
- Returns
- The observations.
◆ pause()
| None environment.environment.SimEnv.pause |
( |
|
self, |
|
|
|
steps = 200 |
|
) |
| |
For a certain amount of steps, take no action.
Achieved by taking "zero" actions.
◆ replace_walls()
| None environment.environment.SimEnv.replace_walls |
( |
|
self, |
|
|
List[List[bool]] |
wall |
|
) |
| |
Replace all the walls, build 1 new one See build_wall for how a wall is represented.
- Parameters
-
◆ reset()
| np.ndarray environment.environment.SimEnv.reset |
( |
|
self | ) |
|
Reset the Unity Environment, essentially starting a new episode.
The effect is that OnEpisodeBegin is called in Unity.
- Returns
- Observations obtained after the reset.
◆ set_goal()
| None environment.environment.SimEnv.set_goal |
( |
|
self, |
|
|
tuple |
goal |
|
) |
| |
Set the coordinates of the goal visualization.
- Parameters
-
| goal | The coordinates: (x, y, z). |
◆ set_workspace()
| None environment.environment.SimEnv.set_workspace |
( |
|
self, |
|
|
tuple |
workspace |
|
) |
| |
Set the coordinates and size of the workspace visualization.
- Parameters
-
| workspace | The coordinates and size: (x, y, z, sideLength). |
◆ step()
| np.ndarray environment.environment.SimEnv.step |
( |
|
self, |
|
|
np.ndarray |
action, |
|
|
|
return_observations = True |
|
) |
| |
Do 1 step in the unity environment.
- Parameters
-
| action | The action for this step. |
| return_observations | Whether to return observations after the step is taken. |
- Returns
- Observations after the step is taken.
The documentation for this class was generated from the following file: