-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name all parameters in the UI Add translation and rotation scale params Add host parameter to make real-robot demos easier Add button change events Bump dependencies
- Loading branch information
1 parent
6a13c5e
commit de378c9
Showing
6 changed files
with
138 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,9 @@ | |
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"three": "https://unpkg.com/three@0.156.1/build/three.module.js", | ||
"three/addons/": "https://unpkg.com/three@0.156.1/examples/jsm/", | ||
"tweakpane": "https://cdn.jsdelivr.net/npm/[email protected].1/dist/tweakpane.min.js" | ||
"three": "https://unpkg.com/three@0.162.0/build/three.module.js", | ||
"three/addons/": "https://unpkg.com/three@0.162.0/examples/jsm/", | ||
"tweakpane": "https://cdn.jsdelivr.net/npm/[email protected].3/dist/tweakpane.min.js" | ||
} | ||
} | ||
</script> | ||
|
@@ -125,6 +125,9 @@ | |
|
||
let ros = null; | ||
let robot = null; | ||
const hostParam = { | ||
host: "ws://127.0.0.1:9090" | ||
}; | ||
let threeDMouse = null; | ||
let filter = new SmoothingDeadbandFilter({ smoothing: 0.5, deadband: 0.1 }); | ||
let twistVizOverlays = null; | ||
|
@@ -142,6 +145,8 @@ | |
deadbandWeight: 0.4, | ||
translationEnabled: true, | ||
rotationEnabled: true, | ||
translationScale: 1.0, | ||
rotationScale: 1.0, | ||
deadbandSize: 0.1, | ||
}; | ||
const lastValue = { | ||
|
@@ -217,6 +222,7 @@ | |
let ui = createConfigurationPane({ | ||
container: document.getElementById("configuration"), | ||
status: status, | ||
hostParam: hostParam, | ||
filter: filter, | ||
filterParams: filterParams, | ||
lastValue: lastValue, | ||
|
@@ -241,7 +247,7 @@ | |
if (!device) { | ||
return; | ||
} | ||
initializeRos() | ||
initializeRos(hostParam["host"]) | ||
.then((rosConnection) => { | ||
ros = rosConnection; | ||
instructionsContainer.style.display = "none"; | ||
|
@@ -276,6 +282,12 @@ | |
status["message"] = "Error: ROS webbridge connection failed"; | ||
}); | ||
|
||
window.addEventListener("3dmousebuttonup", (event) => { | ||
robot.forwardButtonChange(event.detail.name, "up"); | ||
}); | ||
window.addEventListener("3dmousebuttondown", (event) => { | ||
robot.forwardButtonChange(event.detail.name, "down"); | ||
}); | ||
window.addEventListener("3dmouseinput", (event) => { | ||
let values = event.detail.filteredInput; | ||
if (twistVizOverlays) { | ||
|
@@ -289,6 +301,7 @@ | |
} | ||
} | ||
} | ||
robot.forwardButtonStates(event.detail.buttons); | ||
updateLastValues(event, lastValue); | ||
uiFolders["values"].refresh(); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.