env.py 946 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. """
  2. Environment for rrt_2D
  3. @author: huiming zhou
  4. """
  5. class Env:
  6. def __init__(self):
  7. self.x_range = (0, 50)
  8. self.y_range = (0, 30)
  9. self.obs_boundary = self.obs_boundary()
  10. self.obs_circle = self.obs_circle()
  11. self.obs_rectangle = self.obs_rectangle()
  12. @staticmethod
  13. def obs_boundary():
  14. obs_boundary = [
  15. [0, 0, 1, 30],
  16. [0, 30, 50, 1],
  17. [1, 0, 50, 1],
  18. [50, 1, 1, 30]
  19. ]
  20. return obs_boundary
  21. @staticmethod
  22. def obs_rectangle():
  23. obs_rectangle = [
  24. [14, 12, 8, 2],
  25. [18, 22, 8, 3],
  26. [26, 7, 2, 12],
  27. [32, 14, 10, 2]
  28. ]
  29. return obs_rectangle
  30. @staticmethod
  31. def obs_circle():
  32. obs_cir = [
  33. [7, 12, 3],
  34. [46, 20, 2],
  35. [15, 5, 2],
  36. [37, 7, 3],
  37. [37, 23, 3]
  38. ]
  39. return obs_cir