Skip to content

Commit 0ec5681

Browse files
committed
Add type checking for robot_type
1 parent 457b408 commit 0ec5681

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

PathPlanning/DynamicWindowApproach/dynamic_window_approach.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ def __init__(self):
5959
self.robot_width = 0.5 # [m] for collision check
6060
self.robot_length = 1.2 # [m] for collision check
6161

62+
@property
63+
def robot_type(self):
64+
return self._robot_type
65+
66+
@robot_type.setter
67+
def robot_type(self, value):
68+
if not isinstance(value, RobotType):
69+
raise TypeError("robot_type must be an instance of RobotType")
70+
self._robot_type = value
6271

6372
def motion(x, u, dt):
6473
"""

0 commit comments

Comments
 (0)