Closed geopimik closed 4 months ago
1&2. Put only relevant variables inside the self.lock
block
https://github.com/AnishShr/autoware_mini_practice/blob/db7de2e51eb2ac93c232ab33cd755905c6f50521/practice_6/nodes/planning/local/simple_local_planner.py#L93-L98
local_path
is None before returningreturn
line an later assigned zero velocity if transform is not there
https://github.com/AnishShr/autoware_mini_practice/blob/db7de2e51eb2ac93c232ab33cd755905c6f50521/practice_6/nodes/planning/local/simple_local_planner.py#L153-L161
https://github.com/AnishShr/autoware_mini_practice/blob/db7de2e51eb2ac93c232ab33cd755905c6f50521/practice_6/nodes/planning/local/simple_local_planner.py#L181-L185OK
Please fix the following:
No need to assign parameter values that are not about to change to local variables. You can use them directly in the callback using the class (global) variable name https://github.com/AnishShr/autoware_mini_practice/blob/21d92c582d289c5f9fc24b477ca34f7889b10b66/practice_6/nodes/planning/local/simple_local_planner.py#L102-L116
I would bring these out of the self.lock group. Important is that all the things coming from path callback stay consistent, so they are in the lock group. But current pose and velocity come from separate topics and with different frequency, so no point having them in that group. https://github.com/AnishShr/autoware_mini_practice/blob/21d92c582d289c5f9fc24b477ca34f7889b10b66/practice_6/nodes/planning/local/simple_local_planner.py#L95-L100
This is wrong and it is not used in this callback later. Not necessary! https://github.com/AnishShr/autoware_mini_practice/blob/21d92c582d289c5f9fc24b477ca34f7889b10b66/practice_6/nodes/planning/local/simple_local_planner.py#L134
Important is to publish empty local path! Then follower will get it empty and will stop the go vehicle if it is not stopped already! https://github.com/AnishShr/autoware_mini_practice/blob/21d92c582d289c5f9fc24b477ca34f7889b10b66/practice_6/nodes/planning/local/simple_local_planner.py#L141-L143
You should not return from here! If we don't get the transform, then we set it to None and we still need to detect the obstacles publish the local path and calculate the target velocity. Now we will just assume that objects have 0 velocity since we don't have a reliable transform. https://github.com/AnishShr/autoware_mini_practice/blob/21d92c582d289c5f9fc24b477ca34f7889b10b66/practice_6/nodes/planning/local/simple_local_planner.py#L154-L163