ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.06k stars 9.68k forks source link

How can I use Python code or terminal command to reset backend data just like in the DreamView? #15497

Closed AOOOOOA closed 1 month ago

AOOOOOA commented 1 month ago

Hi, Is there any way to use code or terminal command to reset the backend data just like the button does in the DreamView? Thanks!

daohu527 commented 1 month ago

Currently, DreamView adopts front-end and back-end architecture and is submitted through Websocket.

interface

There is no standard interface yet, but if necessary we may consider adding one. The following code shows the websocket registering the "HMIAction" message handler

https://github.com/ApolloAuto/apollo/blob/ba32187d4f1879fb0a9b941ca501cd5717c680df/modules/dreamview/backend/hmi/hmi.cc#L81-L84

another solution

Kill all processes started with cyber_launch

ps -eLo pid,cmd | grep cyber_launch | awk '{print $1}' | xargs ps -T | awk '$1 != "PID" {print $2}' | xargs sudo kill -9
YuqiHuai commented 1 month ago

You can check this out as well. https://github.com/lgsvl/PythonAPI/blob/master/lgsvl/dreamview/dreamview.py

daohu527 commented 1 month ago

The lgsvl mock the communication to Apollo, it looks like it works.

YuqiHuai commented 1 month ago

The lgsvl mock the communication to Apollo, it looks like it works.

I think this implements works for Apollo 7.0 but not for 8.0 because the web socket messages changed slightly. Anyone can use the developer tool from the browser to extract the appropriate messages to be sent to the backend.