I might have given you the wrong hint in the practice. Here you check if self.current_position is not None. And later you use it in the callback (line 102).
what if, during the checking, it was not None, but then was changed to None then we would have an error in the callback
In our simplified code, it currently can't go to None, but it is possible.
Please fix following:
I might have given you the wrong hint in the practice. Here you check if
self.current_position
is not None. And later you use it in the callback (line 102).You could move transforming velocities after the next if. Do it only for those objects that intersect our path. Will gain some milliseconds https://github.com/Karljohan99/autoware_mini_practice/blob/a09abb4acfa7dc931d7fc454a4906f6bcbae5884/practice_6/nodes/planning/local/simple_local_planner.py#L133-L143
It can be done like this, but it seems a bit weird. It is like the
object_distances
is boolean. https://github.com/Karljohan99/autoware_mini_practice/blob/a09abb4acfa7dc931d7fc454a4906f6bcbae5884/practice_6/nodes/planning/local/simple_local_planner.py#L171-L172