Skip to content

Commit bba3df9

Browse files
committed
Allow for unbounded control signals
1 parent 3a70c2c commit bba3df9

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

avstack/environment/objects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class ObjectState:
127127
_ids = itertools.count()
128128

129129
def __init__(self, obj_type, ID=None, score: float = 1.0):
130+
"""TODO: consider that position may be center or bottom..."""
130131
self.ID = ID if ID is not None else next(self._ids)
131132
self.obj_type = obj_type
132133
self.score = score

avstack/modules/control/types.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ def __init__(
88
hand_brake=False,
99
reverse=False,
1010
manual_gear_shift=False,
11+
bounded=True,
1112
):
1213
"""Define the vehicle control signal"""
13-
14+
self.bounded = bounded
1415
self.timestamp = timestamp
1516
self.throttle = throttle
1617
self.brake = brake
@@ -25,7 +26,8 @@ def throttle(self):
2526

2627
@throttle.setter
2728
def throttle(self, throttle):
28-
assert 0 <= throttle <= 1.0, throttle
29+
if self.bounded:
30+
assert 0 <= throttle <= 1.0, throttle
2931
self._throttle = throttle
3032

3133
@property
@@ -34,7 +36,8 @@ def brake(self):
3436

3537
@brake.setter
3638
def brake(self, brake):
37-
assert 0.0 <= brake <= 1.0, brake
39+
if self.bounded:
40+
assert 0.0 <= brake <= 1.0, brake
3841
self._brake = brake
3942

4043
@property
@@ -43,7 +46,8 @@ def steer(self):
4346

4447
@steer.setter
4548
def steer(self, steer):
46-
assert -1.0 <= steer <= 1.0, steer
49+
if self.bounded:
50+
assert -1.0 <= steer <= 1.0, steer
4751
self._steer = steer
4852

4953
def __repr__(self):

0 commit comments

Comments
 (0)