Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· openaiHugging Face Suzhen/CodeChat

想要修改dreamview,让前端显示的六张图片改为右下角显示一张组件传来的图片并且删除其他五张图片,怎么修改,修改dreamview/frontendlane,还是dreamv…

  1. User

    想要修改dreamview,让前端显示的六张图片改为右下角显示一张组件传来的图片并且删除其他五张图片,怎么修改,修改dreamview/frontend_lane,还是dreamview/backend。如果能将lane_marker展示为想要的图片,那就最好了。 下面是modules/dreamview的文件目录: modules

    • dreamview --backend ---common ----BUILD ----dreamview_gflags.cc ----dreamview_gflags.h ---fuel_monitor ----BUILD ----data_collection_monitor_test.cc ----data_collection_monitor.cc ----data_collection_monitor.h ----fuel_monitor_gflags.cc ----fuel_monitor_gflags.h ----fuel_monitor_manager.cc ----fuel_monitor_manager.h ----fuel_monitor.h ----preprocess_monitor.cc ----preprocess_monitor.h ---handles ----BUILD ----image_handler.cc ----image_handler.h ----websocket_handler_test.cc ----websocket_handler.cc ----websocket_handler.h ---hmi ----testdata/vehicle/vehicle_data.pb.txt ----BUILD ----hmi_worker_test.cc ----hmi_worker.cc ----hmi_worker.h ----hmi.cc ----hmi.h ----vehicle_manager_main.cc ----vehicle_manager_test.cc ----vehicle_manager.cc ----vehicle_manager.h ---map ----BUILD ----map_service_test.cc ----map_service.cc ----map_service.h ---perception_camera_updater ----BUILD ----perception_camera_updater.cc ----perception_camera_updater.h ---point_cloud ----BUILD ----point_cloud_updater.cc ----point_cloud_updater.h ---sim_control ----BUILD ----sim_control_interface.h ----sim_control_test.cc ----sim_control.cc ----sim_control.h ---simulation_world ----BUILD ----simulation_world_service_test.cc ----simulation_world_service.cc ----simulation_world_service.h ----simulation_world_updater.cc ----simulation_world_updater.h ---teleop ----images ----proto -----BUILD -----daemon_cmd.proto -----daemon_rpt.proto -----modem_info.proto ----BUILD ----teleop_test.cc ----teleop.cc ----teleop.h ---testdata ----BUILD ----data_collection_tabe_test.pb.txt ----garage.bin ----routing.pb.txt ---BUILD ---dreamview.cc ---dreamview.h

    -- frontend_lane ---asserts ----images ----models ---config ----parameters.js ---dist ----assets ----fonts ----icons ----app_bundle.js ----app.bundle.js.LICENSE.txt ----app.bundle.js.map ----componets_Navigation_BaiduMapAdapter_js.bundle.js ----componets_Navigation_GoogleMapAdapter_js.bundle.js ----componets_Navigation_index_js.bundle.js ----index.html ----parameters.bundle.js ----parameters.json ----worker.bundle.js ----worker.bundle.js.map ---proto_bundle ----point_cloud_proto_bundle.json ----sim_world_proto_bundle.json ---src ----components -----ApplicationGuideModal -----CameraParam -----common -----DataCollectionMonitor -----DataProfile -----DataRecorder -----DefaultRouting -----FuelClient -----Header -----Layouts -----ModuleController -----Navigation -----PlaybackControls -----PNCMonitor -----RouteEditingBar -----Scene -----SideBar -----StatusBar -----Tasks -----TeleopMonitor -----Dreamview.js -----Offlineview.js ----fonts ----renderer -----traffic_controls -----adc.js -----check_points.js -----coordinates.js -----decision.js -----gnss.js -----ground.js -----index.js -----map.js -----obstacles.js -----point_cloud.js -----prediction.js -----routing_editor.js -----routing.js -----status.js -----text3d.js -----tileground.js -----trajectory.js ----store -----config ------ControlGraph.yml ------hotkeys.yml ------LatencyGraph.yml ------MenuData.js ------parameters.yml ------PlanningGraph.yml -----websocker ------index.js ------websocket_camera.js ------websocket_map.js ------websocket_offline.js ------websocket_plugin.js ------websocket_point_cloud.js ------websocket_realtime.js ------websocket_teleop.js -----camera_data.js -----control_data.js -----dimension.js -----hmi.js -----index.js -----latency.js -----meters.js -----monitor.js -----planning_data.js -----playback.js -----route_editing_manager.js -----story_tellers.js -----studio_connector.js -----teleop.js -----traffic_signal.js -----utterance.js ----styles ----utils -----chart.js -----constant.js -----coordinate_converter.js -----draw.js -----JSON.js -----misc.js -----models.js -----script_loader.js -----vehicleInfoMap.js -----webworker.js ----app.js ----index.hbs ----offline.js ---.airbnd.eslintrc ---.babelrc.js ---.eslintrc ---.gitignore ---.nvmrc ---gen_pbjs.sh ---jsconfig.json ---package.json ---setup.sh ---webpack.config.js ---webpack.offline.config.js ---yarn.lock ---launch ----dreamview_lane.launch ----dreamview.launch ---proto ----BUILD ----camera_update.proto ----chart.proto ----data_collection_table.proto ----hmi_config.proto ----hmi_mode.proto ----hmi_status.proto ----point_cloud.proto ----preprocess_table.proto ----simulation_world.proto ---BUILD ---main.cc

  2. Assistant

    要修改Dreamview前端界面,需要修改dreamview/frontend_lane目录下的相关文件。具体来说,你需要修改以下文件:

    1. dreamview/frontend_lane/dist/index.html :在该文件中,可以将显示六张图片的代码删除,并添加显示右下角图片的代码。

    2. dreamview/frontend_lane/src/components/Dreamview.js :在该文件中,可以根据需要修改如何接收并显示组件传来的图片。

    3. dreamview/frontend_lane/src/store/websocket_plugin.js :在该文件中,可以修改如何接收并处理图片数据。

    需要注意的是,还需要对应修改逻辑,确保接收并处理图片数据的代码能够正确运行。

    如果想要将lane_marker展示为想要的图片,可能还需要在其他相关文件中做相应的修改。

    请注意备份相关文件,以免修改出错。修改完成后,重新编译并部署Dreamview,使修改生效。

  3. User

    那么如何dreamview/frontend_lane/dist/index.html :在该文件中,可以将显示六张图片的代码删除,并添加显示右下角图片的代码。 这是dreamview/frontend_lane/dist/index.html 文件,

        window.PARAMETERS = JSON.parse(response);
      });
      function loadJSON(jsonFilePath, callback) {
        console.log("Loading Json file:", jsonFilePath);
        const xobj = new XMLHttpRequest();
        xobj.overrideMimeType('application/json');
        xobj.open('GET', jsonFilePath, false /* synchronous */);
        xobj.onreadystatechange = () => {
          if (xobj.readyState === 4 && xobj.status === 200) {
            // Required use of an anonymous callback as .open will NOT
            // return a value but simply returns undefined in asynchronous mode
            callback(xobj.responseText);
          }
        };
        xobj.send(null);
      }</script><link rel="shortcut icon" href="icons/favicon.ico"><link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="48x48" href="icons/favicon-48x48.png"><link rel="manifest" href="icons/manifest.json"><meta name="mobile-web-app-capable" content="yes"><meta name="theme-color" content="#fff"><meta name="application-name" content="dreamview"><link rel="apple-touch-icon" sizes="57x57" href="icons/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="icons/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="icons/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="icons/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="icons/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="icons/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="icons/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="icons/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="167x167" href="icons/apple-touch-icon-167x167.png"><link rel="apple-touch-icon" sizes="180x180" href="icons/apple-touch-icon-180x180.png"><link rel="apple-touch-icon" sizes="1024x1024" href="icons/apple-touch-icon-1024x1024.png"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-title" content="dreamview"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="icons/apple-touch-startup-image-640x1136.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="icons/apple-touch-startup-image-750x1334.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="icons/apple-touch-startup-image-828x1792.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="icons/apple-touch-startup-image-1125x2436.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="icons/apple-touch-startup-image-1242x2208.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="icons/apple-touch-startup-image-1242x2688.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="icons/apple-touch-startup-image-1536x2048.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="icons/apple-touch-startup-image-1668x2224.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="icons/apple-touch-startup-image-1668x2388.png"><link rel="apple-touch-startup-image" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="icons/apple-touch-startup-image-2048x2732.png"><link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="icons/apple-touch-startup-image-1620x2160.png"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="icons/apple-touch-startup-image-1136x640.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="icons/apple-touch-startup-image-1334x750.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="icons/apple-touch-startup-image-1792x828.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="icons/apple-touch-startup-image-2436x1125.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="icons/apple-touch-startup-image-2208x1242.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="icons/apple-touch-startup-image-2688x1242.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="icons/apple-touch-startup-image-2048x1536.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="icons/apple-touch-startup-image-2224x1668.png"><link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="icons/apple-touch-startup-image-2388x1668.png"><link rel="apple-touch-startup-image" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="icons/apple-touch-startup-image-2732x2048.png"><link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="icons/apple-touch-startup-image-2160x1620.png"><link rel="icon" type="image/png" sizes="228x228" href="icons/coast-228x228.png"><meta name="msapplication-TileColor" content="#fff"><meta name="msapplication-TileImage" content="icons/mstile-144x144.png"><meta name="msapplication-config" content="icons/browserconfig.xml"><link rel="yandex-tableau-widget" href="icons/yandex-browser-manifest.json"><script defer="defer" src="./app.bundle.js"></script></head><body><div id="root"></div></body></html>
    
  4. Assistant

    要在dreamview/frontend_lane/dist/index.html中修改显示图片的代码,你需要做以下几步:

    1. 找到显示六张图片的代码,并将其删除。

    2. 添加一个新的元素或组件来显示右下角的图片。

    下面是一个例子,展示了如何修改index.html文件以显示右下角的图片:

    <!doctype html>
    <html lang="en">
    
    <head>
      <!-- 省略其他代码 -->
      <script defer="defer" src="./app.bundle.js"></script>
    
      <style>
        #root {
          position: relative;
        }
    
        #component-image {
          position: absolute;
          bottom: 10px;
          right: 10px;
          width: 200px;
          height: 200px;
        }
      </style>
    </head>
    
    <body>
      <div id="root">
        <!-- 原始显示图片的代码已被删除 -->
      </div>
    
      <img id="component-image" src="[图片路径]" alt="Component Image">
    </body>
    
    </html>
    

    在上述代码中,我们添加了一个新的<img>元素,并使用CSS样式将其定位到右下角。你需要将[图片路径]替换为你的组件传来的图片的路径。

    请注意,这只是一种修改方式,具体的实现方式可能因你的需求和代码结构而有所不同。你可能还需要根据实际情况进行一些调整。

    修改完成后,保存文件,并重新编译和部署Dreamview,使修改生效。