Skip to content

Commit e85d1bf

Browse files
committed
fix issues for build
1 parent e138431 commit e85d1bf

6 files changed

Lines changed: 20 additions & 17 deletions

File tree

GEMstack/onboard/visualization/sr_viz/threeD/package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GEMstack/onboard/visualization/sr_viz/threeD/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"react-icons": "^5.5.0",
2424
"react-resizable-panels": "^3.0.1",
2525
"three": "^0.175.0",
26+
"three-stdlib": "^2.36.0",
2627
"urdf-loader": "^0.12.4"
2728
},
2829
"devDependencies": {

GEMstack/onboard/visualization/sr_viz/threeD/src/app/rosbagViewer/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import React from "react";
34
import RosbagViewer from "@/components/RosbagViewer";
45
import { useRouter } from "next/navigation";
56
import Button from "@mui/material/Button";

GEMstack/onboard/visualization/sr_viz/threeD/src/components/PanelManager.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const PanelManager = ({
4242
}) => {
4343
const [rootPanel, setRootPanel] = useState<PanelNode>(createPanel("video"));
4444

45-
const renderPanelNode = (node: PanelNode): JSX.Element => {
45+
const renderPanelNode = (node: PanelNode) => {
4646
if ("split" in node) {
4747
return (
4848
<Panel>
@@ -94,12 +94,12 @@ export const PanelManager = ({
9494
rootPanel={rootPanel}
9595
/>
9696
{node.type === "video" && (
97-
<VideoPanel messages={messageMap["video"]} initialTopic={Object.keys(messageMap["video"])[0]} />
97+
<VideoPanel messages={messageMap["video"] as Record<string, any[]>} initialTopic={Object.keys(messageMap["video"])[0]} />
9898
)}
9999
{node.type === "pointcloud" && (
100100
<PointCloudPanel
101-
messages={messageMap["pointcloud"]}
102-
tfMessages={messageMap["tf"]}
101+
messages={messageMap["pointcloud"] as Record<string, any[]>}
102+
tfMessages={messageMap["tf"] as any[]}
103103
initialTopic={Object.keys(messageMap["pointcloud"])[0]}
104104
/>
105105
)}
@@ -152,7 +152,7 @@ function closePanel(
152152
return node;
153153
}
154154
const newRoot = helper(root);
155-
setRoot(newRoot);
155+
if (newRoot) setRoot(newRoot);
156156
}
157157

158158
function changePanelType(

GEMstack/onboard/visualization/sr_viz/threeD/src/components/PointCloudPanel.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import React, { useEffect, useRef, useState } from "react";
44
import { useScrubber } from "./ScrubberContext";
55
import * as THREE from "three";
6-
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
6+
import { OrbitControls } from "three-stdlib";
77
import { Select, SelectChangeEvent, MenuItem } from "@mui/material";
88

99
function parsePointCloud2(msg: any): THREE.Points {
@@ -116,10 +116,10 @@ export const PointCloudPanel = ({
116116
const mountRef = useRef<HTMLDivElement>(null);
117117
const { startTime, currentTime } = useScrubber();
118118
const rendererRef = useRef<THREE.WebGLRenderer | null>(null);
119-
const cameraRef = useRef<THREE.PerspectiveCamera>();
120-
const sceneRef = useRef<THREE.Scene>();
121-
const controlsRef = useRef<OrbitControls>();
122-
const pointCloudRef = useRef<THREE.Points>();
119+
const cameraRef = useRef<THREE.PerspectiveCamera | null>(null);
120+
const sceneRef = useRef<THREE.Scene | null>(null);
121+
const controlsRef = useRef<OrbitControls | null>(null);
122+
const pointCloudRef = useRef<THREE.Points | null>(null);
123123
const [selectedTopic, setSelectedTopic] = useState(
124124
initialTopic || Object.keys(messages)[0] || ""
125125
);

GEMstack/onboard/visualization/sr_viz/threeD/src/components/RosbagViewer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export default function RosbagViewer() {
5656
if (!file) return;
5757

5858
setMessageMap({
59-
video: [],
60-
pointcloud: [],
59+
video: {},
60+
pointcloud: {},
6161
tf: [],
6262
});
6363
setLoading(true);
@@ -72,7 +72,7 @@ export default function RosbagViewer() {
7272
(conn) => conn.type
7373
);
7474
setTopics(topicNames);
75-
setTypes(topicTypes);
75+
setTypes(topicTypes as string[]);
7676
// console.log("Topics:", topicNames, topicTypes);
7777

7878
const videoMessages: Record<string, any[]> = {};
@@ -84,7 +84,7 @@ export default function RosbagViewer() {
8484
topic: msg.topic,
8585
data: msg.message,
8686
};
87-
const type = topicTypes[topicNames.indexOf(msg.topic)];
87+
const type = topicTypes[topicNames.indexOf(msg.topic)] as string;
8888
if (type.includes("Image")) {
8989
if (!videoMessages[msg.topic]) videoMessages[msg.topic] = [];
9090
videoMessages[msg.topic].push(entry);

0 commit comments

Comments
 (0)