From 097e562865744714a753219b21d1de3d0ea4a502 Mon Sep 17 00:00:00 2001 From: Tianshun Gao Date: Sun, 27 Apr 2025 01:02:14 -0700 Subject: [PATCH 1/6] correct gitignore --- .../visualization/sr_viz/threeD/.gitignore | 61 ++++++++++++------- .../sr_viz/threeD/legacy/.gitignore | 24 ++++++++ 2 files changed, 63 insertions(+), 22 deletions(-) create mode 100644 GEMstack/onboard/visualization/sr_viz/threeD/legacy/.gitignore diff --git a/GEMstack/onboard/visualization/sr_viz/threeD/.gitignore b/GEMstack/onboard/visualization/sr_viz/threeD/.gitignore index 4a7f73a2e..5ef6a5207 100644 --- a/GEMstack/onboard/visualization/sr_viz/threeD/.gitignore +++ b/GEMstack/onboard/visualization/sr_viz/threeD/.gitignore @@ -1,24 +1,41 @@ -# Nuxt dev/build outputs -.output -.data -.nuxt -.nitro -.cache -dist - -# Node dependencies -node_modules - -# Logs -logs -*.log - -# Misc +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc .DS_Store -.fleet -.idea +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel -# Local env files -.env -.env.* -!.env.example +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/GEMstack/onboard/visualization/sr_viz/threeD/legacy/.gitignore b/GEMstack/onboard/visualization/sr_viz/threeD/legacy/.gitignore new file mode 100644 index 000000000..4a7f73a2e --- /dev/null +++ b/GEMstack/onboard/visualization/sr_viz/threeD/legacy/.gitignore @@ -0,0 +1,24 @@ +# Nuxt dev/build outputs +.output +.data +.nuxt +.nitro +.cache +dist + +# Node dependencies +node_modules + +# Logs +logs +*.log + +# Misc +.DS_Store +.fleet +.idea + +# Local env files +.env +.env.* +!.env.example From 41da4337e35e791258d1d47630b274dc3964525a Mon Sep 17 00:00:00 2001 From: Tianshun Gao Date: Sun, 27 Apr 2025 01:54:34 -0700 Subject: [PATCH 2/6] style changes on scrubber --- .../sr_viz/threeD/src/components/Scrubber.tsx | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx b/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx index 459984bf2..57e70c2dc 100644 --- a/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx +++ b/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx @@ -13,7 +13,7 @@ export default function Scrubber({ restart, setPlaybackSpeed, moveToTime, - duration + duration, }: { time: number; play: boolean; @@ -46,24 +46,38 @@ export default function Scrubber({ const formatDuration = (time: number) => { const minutes = Math.floor(time / 60); const seconds = Math.floor(time % 60); - return `${minutes < 10 ? "0" : ""}${minutes}:${seconds < 10 ? "0" : ""}${seconds}`; - } + return `${minutes < 10 ? "0" : ""}${minutes}:${ + seconds < 10 ? "0" : "" + }${seconds}`; + }; return (
- + {play ? ( ) : ( )} -
-
{time < duration ? formatDuration(time) : formatDuration(duration)}
- +
+
+ {time < duration + ? formatDuration(time) + : formatDuration(duration)} +
+
{formatDuration(duration)}
-
- +
+ ))} - +
From 222da49205073a4b635a1dea0c8b977b56448b17 Mon Sep 17 00:00:00 2001 From: Tianshun Gao Date: Sun, 27 Apr 2025 02:18:00 -0700 Subject: [PATCH 3/6] disable context menu --- .../threeD/src/components/ControlPanel.tsx | 10 ++++++++ .../sr_viz/threeD/src/components/Scrubber.tsx | 25 ++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/GEMstack/onboard/visualization/sr_viz/threeD/src/components/ControlPanel.tsx b/GEMstack/onboard/visualization/sr_viz/threeD/src/components/ControlPanel.tsx index c2b62df99..97122e70c 100644 --- a/GEMstack/onboard/visualization/sr_viz/threeD/src/components/ControlPanel.tsx +++ b/GEMstack/onboard/visualization/sr_viz/threeD/src/components/ControlPanel.tsx @@ -31,6 +31,14 @@ export default function ControlPanel({ reset }: { reset: () => void }) { console.error("❌ Failed to parse log file:", err); } }; + const handleContextMenu = (event: React.MouseEvent) => { + event.preventDefault(); + if (isOpen) { + setIsOpen(false); + } else { + setIsOpen(true); + } + } return ( <> @@ -38,6 +46,7 @@ export default function ControlPanel({ reset }: { reset: () => void }) { className={`fixed top-0 left-0 h-full w-64 bg-black/80 text-white shadow-lg transform transition-transform duration-500 ease-in-out z-40 ${ isOpen ? "translate-x-0" : "-translate-x-full" }`} + onContextMenu={handleContextMenu} > {isOpen && ( <> @@ -80,6 +89,7 @@ export default function ControlPanel({ reset }: { reset: () => void }) { onClick={() => setIsOpen(true)} className="fixed top-1/2 left-0 -translate-y-1/2 z-50 bg-black/80 text-white w-3 h-8 flex items-center justify-center rounded-r hover:bg-black border-l border-white/20" title="Open Panel" + onContextMenu={(e) => e.preventDefault()} > diff --git a/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx b/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx index 57e70c2dc..af6a398f6 100644 --- a/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx +++ b/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx @@ -50,9 +50,19 @@ export default function Scrubber({ seconds < 10 ? "0" : "" }${seconds}`; }; + const handleContextMenu = (event: React.MouseEvent) => { + event.preventDefault(); + }; return ( -
- +
+ {play ? ( ) : ( @@ -77,7 +87,11 @@ export default function Scrubber({
{formatDuration(duration)}
- + ))} - +
From c6c19ae7a58207c3b051f27de98df2787a764dd6 Mon Sep 17 00:00:00 2001 From: Jason717717 <1354471825@qq.com> Date: Sun, 27 Apr 2025 06:42:42 -0500 Subject: [PATCH 4/6] fix: make slider responsive --- .../sr_viz/threeD/src/components/Scrubber.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx b/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx index af6a398f6..a1a15b6ae 100644 --- a/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx +++ b/GEMstack/onboard/visualization/sr_viz/threeD/src/components/Scrubber.tsx @@ -1,5 +1,5 @@ "use client"; -import React, { useState, useRef } from "react"; +import React, { useState } from "react"; import { IconButton, Slider, Menu, MenuItem } from "@mui/material"; import PlayArrowIcon from "@mui/icons-material/PlayArrow"; import PauseIcon from "@mui/icons-material/Pause"; @@ -27,6 +27,7 @@ export default function Scrubber({ const [selectedSpeed, setSelectedSpeed] = useState(1); const speedOptions = [0.5, 1, 1.5, 2, 3]; const open = Boolean(anchorEl); + const [isDragging, setIsDragging] = useState(false); const handleClick = (event: React.MouseEvent) => { setAnchorEl(event.currentTarget); }; @@ -38,11 +39,12 @@ export default function Scrubber({ setPlaybackSpeed(speed); handleClose(); }; - const handleSliderChange = (_: Event, newValue: number | number[]) => { - if (typeof newValue === "number") { - moveToTime(newValue); - } + const handleSliderChange = (_: Event, newValue: number) => { + moveToTime(newValue); }; + const handleSliderChangeCommitted = () => { + setIsDragging(false); + } const formatDuration = (time: number) => { const minutes = Math.floor(time / 60); const seconds = Math.floor(time % 60); @@ -76,12 +78,15 @@ export default function Scrubber({ : formatDuration(duration)}
setIsDragging(true)} + onChangeCommitted={handleSliderChangeCommitted} value={time} />
{formatDuration(duration)}
From 657bbccad8dec7945b42c2278b9777a986b2ad89 Mon Sep 17 00:00:00 2001 From: Jason717717 <1354471825@qq.com> Date: Sun, 27 Apr 2025 06:43:30 -0500 Subject: [PATCH 5/6] fix: fix ground lines flickering --- .../visualization/sr_viz/threeD/src/config/groundConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEMstack/onboard/visualization/sr_viz/threeD/src/config/groundConfig.ts b/GEMstack/onboard/visualization/sr_viz/threeD/src/config/groundConfig.ts index d3c653c9f..751a789f7 100644 --- a/GEMstack/onboard/visualization/sr_viz/threeD/src/config/groundConfig.ts +++ b/GEMstack/onboard/visualization/sr_viz/threeD/src/config/groundConfig.ts @@ -14,7 +14,7 @@ export interface GroundConfig { } const groundConfig: GroundConfig = { - size: [20000, 20000], + size: [1000, 1000], position: [0, 0, 0], rotation: [0, 0, 0], cellSize: 1, From 7640f03171bf06acefd7a133a553729a2d66b02e Mon Sep 17 00:00:00 2001 From: Jason717717 <1354471825@qq.com> Date: Sun, 27 Apr 2025 06:44:25 -0500 Subject: [PATCH 6/6] a little tweak on camera position --- .../visualization/sr_viz/threeD/src/config/cameraConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEMstack/onboard/visualization/sr_viz/threeD/src/config/cameraConfig.ts b/GEMstack/onboard/visualization/sr_viz/threeD/src/config/cameraConfig.ts index 6de374087..b235ede20 100644 --- a/GEMstack/onboard/visualization/sr_viz/threeD/src/config/cameraConfig.ts +++ b/GEMstack/onboard/visualization/sr_viz/threeD/src/config/cameraConfig.ts @@ -10,7 +10,7 @@ type CameraConfigMap = { const cameraConfig: CameraConfigMap = { first: { - position: [0, 1.5, -0.3], // on top of vehicle + position: [0.2, 1.5, -0.3], // on top of vehicle lookAt: [2, 1.5, 0], // looking forward (+Z) damping: 0.1, },