apollo icon indicating copy to clipboard operation
apollo copied to clipboard

How to stop a vehicle normally with the RTKReplayPlanner?

Open davidhopper2003 opened this issue 8 years ago • 4 comments

I used RTKReplayPlanner to test the normal stop ability in a closed area without a high-definition map. When I made a MainStop decision,the vehicle kept moving on if the output trajectory wasn't stopped. In other words, the MainStop decision didn't work (If an emergency stop decision is made, the car will stop immediately). If an empty trajectory is output at this time, the planning module will exit at once because it cannot find the correct reference line, and the vehicle will keep moving on at the current speed. What can I do to make the vehicle stop normally? Thank you.

davidhopper2003 avatar Mar 13 '18 11:03 davidhopper2003

I think there is no stop decisions for rtk planner. It can only follow a pre-recorded planning trajectory.

lianglia-apollo avatar Mar 13 '18 23:03 lianglia-apollo

@lianglia-apollo I think I can calculate the stop trajectory and output it. Let me try it first and tell you the result.

davidhopper2003 avatar Mar 14 '18 02:03 davidhopper2003

I have figured it out for the straight-line case. First, I registered a callback function: AdapterManager::AddPerceptionObstaclesCallback( &RTKReplayPlanner::OnPerceptionObstacles, this); to fetch all obstacles. Second, I determined the threat level based on the distance between every obstacle and the vehicle. If the distance is within the specified distance, a stop decision is made and the corresponding trajectory sequence is calculated. The generation of the stopping trajectory sequence is a stop problem within a constant distance. It can be solved by using simple calculus. Third, if the obstacle disappears, the RTK trajectory sequence will be used again to guide the vehicle to keep moving on.

davidhopper2003 avatar Mar 15 '18 13:03 davidhopper2003

It looks good to me. As long as you can pre-record a stop trajectory, the RTK planner would work.

lianglia-apollo avatar Mar 15 '18 20:03 lianglia-apollo