lucav76 / CarND-Capstone

Fork of the Udacity project to complete the System Integration task, for the "total-recall-dryvers"
3 stars 2 forks source link

Ta/waypoint step4 #1

Closed TimSoft77 closed 6 years ago

TimSoft77 commented 6 years ago

Completed step 4 - waypoint_updater node (partial). Used a dot product approach to find out if a waypoint was ahead of the car. Based on the logging messages created by line 75 while running the simulator on manual, it appears to be working.

jocmom commented 6 years ago

Hi Tim, looks good. I like the dot product approach. I'm not so familar with ROS yet but I think the callbacks are blocking therefore I would just save the message in the pose_cb callback and do all the calculation in some kind of main loop. Jochen

TimSoft77 commented 6 years ago

I can't find a clear answer to this. http://wiki.ros.org/rospy_tutorials/Tutorials/WritingPublisherSubscriber states that the subscriber callbacks have their own threads, but doesn't say they don't block anything.

I understand the approach you're suggesting. If the rate wasn't very high, it would also stop final_waypoints from updating so fast. However, it might increase the likelihood of the current car position being ahead of the first waypoint.

I'll do the refactor, and design it so final_waypoints should get published at the same frequency as they do now.

TimSoft77 commented 6 years ago

Refactored the final_waypoints derivation logic into a loop. Set the rate to that used in waypoint_follower.

Removed all logic to check if the next waypoint is ahead of the car. The car navigated the road fine on my machine with that logic left in, but it doesn't seem to be necessary.

Once merged with the controller, the car navigates the road fine (at least on my machine).

jocmom commented 6 years ago

Looks good :) I think we can merge waypoint and controller branch into master.