Spaces:
Sleeping
Sleeping
Create environment.py
Browse files- environment.py +11 -0
environment.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
class RobotEnv:
|
| 4 |
+
def __init__(self, num_dof=6):
|
| 5 |
+
self.num_dof = num_dof
|
| 6 |
+
|
| 7 |
+
def get_random_start_state(self):
|
| 8 |
+
return np.random.uniform(-1, 1, self.num_dof) # Random start state
|
| 9 |
+
|
| 10 |
+
def get_random_goal_state(self):
|
| 11 |
+
return np.random.uniform(-1, 1, self.num_dof) # Random goal state
|