Where is "position_desired" not None?

In SearchBaseClass a variable called self.position_desired is declared and initialized with None.
In the heuristic function of the BestFirstClass, we check wether it’s None and some part of the calculation happens after that. How can it ever not be None? During debugging I didn’t notice a single occurence and can’t find any setting to a new value anywhere in the code.

What am I missing here?

Found an instance of it being set here: SMP/motion_planner/search_algorithms/base_class.py

Line 121

        if hasattr(self.planningProblem.goal.state_list[0], 'position'):
            if hasattr(self.planningProblem.goal.state_list[0].position, 'vertices'):
                self.position_desired = self.calc_goal_interval(self.planningProblem.goal.state_list[0].position.vertices)
      

Hopefully this helps you.

1 Like

Hi, we have some survival scenarios in which the goal state does not contain any specific goal position, i.e., you are good as long as you find a collision-free trajectory up to the time step given in the goal. In these scenarios, the attribute is None.

Hi, what about such scenarios:

DEU_Flensburg-10_1_T-1
DEU_Flensburg-11_1_T-1
DEU_Flensburg-12_1_T-1

and many more, where self.position_desired is None, but there is a goal region, e.g. for DEU_Flensburg-12_1_T-1:

planning_problem.goal.lanelets_of_goal_position -> defaultdict(list, {0: [56]})
self.planningProblem.goal.state_list[0].position.center -> [ 52.07521623 224.48659768]

Both of which indicate, that there is a goal region, and indeed there is a yellow rectangle on the plot too.

Am I missing something here, can there be a goal region, but it is still a survival scenario?

I would say no, as I am getting timeouts for these scenarios, and then certainly surviving is not enough.

Though they are treated as survival scenarios by my code, and the helper functions which are using the goal state from SearchBaseClass are not working, because to them there is no goal.

1 Like

Hi,
these are not survival scenarios. As you mentioned, there are goal states defined, which should be reached by the vehicle.

I have had the same issues and I think the code block made a mistakes at the reference. I implemented it again in the student.py and changed position to position.shapes[0], ‘vertices’.

After that it worked.

1 Like

position desired is also none, if the target is a goal lanelet instead of a goal position.

What you can do is calculate the distance from the ego to the closest point on any of the goal lanelets (ventrices).
In the StudentMotionPlanner Class you can create a function to do this.