diff --git a/PythonAPI/examples/rss/rss_sensor.py b/PythonAPI/examples/rss/rss_sensor.py index 0226607189..e3622bdb31 100644 --- a/PythonAPI/examples/rss/rss_sensor.py +++ b/PythonAPI/examples/rss/rss_sensor.py @@ -21,6 +21,7 @@ import math from rss_visualization import RssDebugVisualizer # pylint: disable=relative-import +EVALUATOR_NONE_STATE = ad.rss.state.RssStateEvaluator.names["None"] # ============================================================================== # -- RssSensor ----------------------------------------------------------------- @@ -52,14 +53,14 @@ def __init__(self, rss_state, ego_dynamics_on_route, world_model): self.longitudinal_margin = float(rss_state.longitudinalState.rssStateInformation.currentDistance - rss_state.longitudinalState.rssStateInformation.safeDistance) self.margin = max(0, self.longitudinal_margin) self.lateral_margin = None - if rss_state.lateralStateLeft.rssStateInformation.evaluator != "None": + if rss_state.lateralStateLeft.rssStateInformation.evaluator != EVALUATOR_NONE_STATE: self.lateral_margin = rss_state.lateralStateLeft.rssStateInformation.currentDistance - rss_state.lateralStateLeft.rssStateInformation.safeDistance - if rss_state.lateralStateRight.rssStateInformation.evaluator != "None": + if rss_state.lateralStateRight.rssStateInformation.evaluator != EVALUATOR_NONE_STATE: lateral_margin_right = rss_state.lateralStateRight.rssStateInformation.currentDistance - rss_state.lateralStateRight.rssStateInformation.safeDistance if self.lateral_margin==None or self.lateral_margin > lateral_margin_right: self.lateral_margin=lateral_margin_right if self.lateral_margin!=None and self.lateral_margin>0: - self.margin += self.lateral_margin + self.margin += float(self.lateral_margin) def get_actor(self, world): if self.rss_state.objectId == 18446744073709551614: