ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.25k stars 9.72k forks source link

Is there an interface in dreamview plus that can display the vehicle SOC on the page? #15503

Open leizi111 opened 3 months ago

leizi111 commented 3 months ago

I want to display the vehicle soc value on the dreamview plus page, is there an interface in dreamview plus that can display the vehicle SOC on the page?

daohu527 commented 3 months ago

do you mean Vehicle Security Operations Center? Dreamview already has an event monitor to display multi-level messages about the module, like warning, error, delay so on.

we're adding more functional security monitor, and maybe you can explain your requirements in detail, or give a design document

leizi111 commented 3 months ago

I mean soc(State-of-Charge) value of vehicle battery, it can be read on the chassis via canbus, I want to display it on dreamview plus page, is there an interface I can use? Looking forward to your reply.

do you mean Vehicle Security Operations Center? Dreamview already has an event monitor to display multi-level messages about the module, like warning, error, delay so on.

we're adding more functional security monitor, and maybe you can explain your requirements in detail, or give a design document

daohu527 commented 3 months ago

autoDrivingCar

Vehicle related information is in autoDrivingCar, which is a Object message, the proto type you can find in https://github.com/ApolloAuto/apollo/blob/0026d7ee9ebdb772818c741e6b9220f9412a94ff/modules/common_msgs/dreamview_msgs/simulation_world.proto#L77

how to get the battery_percentage

  1. Here is an example about how to get speed. https://github.com/ApolloAuto/apollo/blob/0026d7ee9ebdb772818c741e6b9220f9412a94ff/modules/dreamview_plus/frontend/packages/dreamview-core/src/components/panels/DashBoard/index.tsx#L71-L77

so you can add below method to get battery_percentage,

            <SignalAndGear
                color={dashBoardState?.trafficSignal?.currentSignal}
                gearPosition={dashBoardState?.autoDrivingCar?.gearLocation}
                batteryPercentage={dashBoardState?.autoDrivingCar?.batteryPercentage}  #-------> add
            />
  1. Next, display info in below code https://github.com/ApolloAuto/apollo/blob/0026d7ee9ebdb772818c741e6b9220f9412a94ff/modules/dreamview_plus/frontend/packages/dreamview-core/src/components/panels/DashBoard/SignalAndGear/index.tsx#L12-L21
    <div className={classes['dash-board-signal-gear']}>
        <Signal signal={props?.color as SignalEnum} />
        <Gear gearPosition={props?.gearPosition} />
        <Battery percentage={props?.batteryPercentage} />  #-------> add
    </div>
leizi111 commented 2 months ago

Thanks for your reply! I will try it in my project.