Error of using function

In this path (anaconda3/lib/python3.9/site-packages/commonroad/scenario/scenario.py) there is a function ‘obstacles_by_position_intervals’, there is a little error in ‘contains’ in line 884. Because 'list ’ doesn’t have a ‘contains’ attribute, so this function may fail. How should I use this function? What type is the first parameter of this function? Can you give an example of how to use this function?

The first parameter is a list of Interval objects (you should provide a list with two Interval objects for x- and y-coordinates as mentioned in the docstring of the function):

        interval_x = Interval(-10, 10)
        interval_y = Interval(-10, 10)

        obstacles_in_interval = self.scenario.obstacles_by_position_intervals([interval_x, interval_y])
2 Likes