apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Sim Control Not Functioning Properly

Open LunaAmour opened this issue 8 years ago • 5 comments

I have been working with Apollo for a few months now, and appreciated the release of the sim control function in Dreamview. Up to now it seems to have been functioning normally, and I have been able to have the vehicle navigate many different maps in simulation.

Today I found that the vehicle would not respond when given a new route. It shows the message that the routing request was sent, but the planner does not show a trajectory and the car does not move. I booted up a few modules including the planner, and upon looking at the log files noticed that the planning cycle was being skipped due to localization not being ready. This seems odd given that after starting sim control Dreamview shows localization messages with a low latency. Is there a reason that the planner would think there is no localization information?

I rolled back all changes from the master branch, and even removed and redownloaded the Docker image to ensure I'm using the original unmodified version. Can you provide some advice on how to get the sim control function working again?

LunaAmour avatar Mar 29 '18 16:03 LunaAmour

One thing you can do is to run a rostopic echo /apollo/localization/pose to see if the messages are actually being published, but since you can see a low latency on Dreamview, likely SimControl is working well publishing localization/chassis messages: https://github.com/ApolloAuto/apollo/blob/master/modules/dreamview/backend/sim_control/sim_control.cc#L273.

It could be the case that planning module is having trouble receiving/processing the localization message, @lianglia-apollo, thoughts?

siyangy avatar Mar 29 '18 18:03 siyangy

I also suggest echo the localization msg to see if it really published. It seems not a planning issue as the msg were passed into planning by an adapter that is beyond of planning's control.

lianglia-apollo avatar Mar 29 '18 21:03 lianglia-apollo

Well I logged in this morning to check the /apollo/localization/pose message, and it seems everything is working again. So really I'm not sure why it suddenly stopped (for all versions of apollo that I run). Since my computer powered down overnight, the only thing I can think of is maybe the roscore/topics/modules did not shut down properly in between tests and therefore were not truly refreshed. I would have thought replacing the docker image and doing clean builds of everything would have fixed that, but perhaps it was still being held by my local machine.

I have noticed (and did notice again this morning) that "bash bootstrap.sh stop" does not fully stop all of the processes related to Dreamview. For example, I can go into Dreamview, turn on the routing, planning, and control modules, drive in sim a bit, then close the dreamview window and run the stop command (it says it's shutting down roscore, etc). When I then run "bash boostrap.sh" and bring up Dreamview, I notice that the routing and planning modules are still on, and a trajectory is being generated. Clearly things didn't close as thoroughly as I had hoped. Again, maybe it's possible that I had a roscore session running on my local machine that would have kept these things going?

Any thoughts? Just glad it is working now...

LunaAmour avatar Mar 30 '18 14:03 LunaAmour

Yeah, that definitely sounds like something went wrong in your local ROS environment that prevented your planning module receiving localization message, which simControl module did publish.

I don't think bootstraop.sh stop is responsible for closing the other processes for you, see: https://github.com/ApolloAuto/apollo/blob/master/scripts/bootstrap.sh#L45. If you want to kill all the module processes, there's a 'Reset All' button in Dreamview that does exactly that.

siyangy avatar Mar 30 '18 18:03 siyangy

Great, I will try the "reset all" button next time I see such a case. Thank you for the help.

LunaAmour avatar Mar 30 '18 19:03 LunaAmour