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.
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)
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.
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.
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’.
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.