Skip to content

Commit 25ca050

Browse files
Merge pull request #893 from dimensionalOS/command_center_stop_home
command center stop and home Former-commit-id: d4bf711
2 parents 8494a01 + 3c37be5 commit 25ca050

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:6f31d3e1d3fc5695a8d445708996224734fd8bc1e2e2f01860e2313d876daf0f
3-
size 1229022
2+
oid sha256:98a2a2154b102e8d889bb83305163ead388016377b8e8a56c8f42034443f9be4
3+
size 1229315

dimos/web/command-center-extension/src/App.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as React from "react";
33
import Connection from "./Connection";
44
import ExplorePanel from "./ExplorePanel";
55
import GpsButton from "./GpsButton";
6+
import Button from "./Button";
67
import KeyboardControlPanel from "./KeyboardControlPanel";
78
import VisualizerWrapper from "./components/VisualizerWrapper";
89
import LeafletMap from "./components/LeafletMap";
@@ -77,6 +78,16 @@ export default function App(): React.ReactElement {
7778
connectionRef.current?.stopMoveCommand();
7879
}, []);
7980

81+
const handleReturnHome = React.useCallback(() => {
82+
connectionRef.current?.worldClick(0, 0);
83+
}, []);
84+
85+
const handleStop = React.useCallback(() => {
86+
if (state.robotPose) {
87+
connectionRef.current?.worldClick(state.robotPose.coords[0]!, state.robotPose.coords[1]!);
88+
}
89+
}, [state.robotPose]);
90+
8091
return (
8192
<div style={{ position: "relative", width: "100%", height: "100%" }}>
8293
{isGpsMode ? (
@@ -105,6 +116,8 @@ export default function App(): React.ReactElement {
105116
onUseCostmap={() => setIsGpsMode(false)}
106117
></GpsButton>
107118
<ExplorePanel onStartExplore={handleStartExplore} onStopExplore={handleStopExplore} />
119+
<Button onClick={handleReturnHome} isActive={false}>Go Home</Button>
120+
<Button onClick={handleStop} isActive={false}>Stop</Button>
108121
<KeyboardControlPanel
109122
onSendMoveCommand={handleSendMoveCommand}
110123
onStopMoveCommand={handleStopMoveCommand}

0 commit comments

Comments
 (0)