Closed geopimik closed 6 months ago
Almost, but need to fix the following:
self.lock
and assign the class variables to local variables. After that, you can check if the local variables are not None (this guarantees that they are not changed during the callback) and continue using them inside the callback.VehicleCmd()
in 2 places. I would leave that at the end. And in the if I would just set the steering_angle
and velocity
to 0
and remove the return. Then add an else block, where all the calculation is going on and at the end of callback the VehicleCmd()
will be created and published.OK
There are a couple of fundamental issues in the follower.
You can't stop vehicle form within
path_callback
- it is called only when new path arrives. It runs only when you receive empty path and it will come once to a latched topic.There should be no separate function for stopping the vehicle: https://github.com/jaak-peterson/autoware_mini_practice/blob/7df7b776cd80ca3a60784d6644eb98fbcd7ac4b5/practice_4/nodes/control/pure_pursuit_follower.py#L72-L78
You should always publish vehicle_cmd from
current_pose_callback
. When ever new pose arrives we need to publish new commandsCurrently you are not setting the
self.path_linestring
andself.distance_to_velocity_interpolator
to None in thepath_callback
.len(waypoints_xy) == 0
and then callstop_vehicle()
- but it should not be done like that.current_pose_callback
https://github.com/jaak-peterson/autoware_mini_practice/blob/7df7b776cd80ca3a60784d6644eb98fbcd7ac4b5/practice_4/nodes/control/pure_pursuit_follower.py#L29-L46