Embeddd workspace into website
This commit is contained in:
parent
b4af86a563
commit
f23bc959ef
4 changed files with 20 additions and 79536 deletions
|
@ -25,10 +25,7 @@ The robot's forward and inverse kinematics were first implemented in a [jupyter
|
||||||
|
|
||||||
The forward and inverse kinematics were then implemented in C++ following the approach described on the Trossen Robotics forum [1]. Access to the kinematics lets us plan paths in the joint space significantly easier and safer since the workspace is irregular. Once a joint trajectory is planned, the path can be verified to stay in the workspace
|
The forward and inverse kinematics were then implemented in C++ following the approach described on the Trossen Robotics forum [1]. Access to the kinematics lets us plan paths in the joint space significantly easier and safer since the workspace is irregular. Once a joint trajectory is planned, the path can be verified to stay in the workspace
|
||||||
|
|
||||||
<div id="workspace-container"></div>
|
<div id="workspace-container" style="display: flex; width: 95%; justify-content: center; ">
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
<img src="workspace.png" alt="Delta Robot Workspace" style="border-radius: 15px; width: 50%; margin-left: 5px; display: inline-block;">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -84,25 +84,29 @@
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{{ if eq .Page.Title "Delta Robot ROS Package" }}
|
{{ if eq .Page.Title "Delta Robot ROS Package" }}
|
||||||
|
<!-- Hidden div containing the workspace content -->
|
||||||
|
<div id="hidden-workspace" style="display: none;">
|
||||||
|
{{ partial "workspace_plot.html" . }}
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const workspaceContainer = document.getElementById("workspace-container");
|
const workspaceContainer = document.getElementById("workspace-container");
|
||||||
|
const hiddenWorkspace = document.getElementById("hidden-workspace");
|
||||||
|
|
||||||
if (workspaceContainer) {
|
if (workspaceContainer && hiddenWorkspace) {
|
||||||
fetch("/workspace_plot.html") // Ensure this path is correct
|
// Move the content from the hidden div into the visible workspace container
|
||||||
.then(response => {
|
workspaceContainer.innerHTML = hiddenWorkspace.innerHTML;
|
||||||
if (!response.ok) {
|
hiddenWorkspace.remove(); // Remove the original hidden div
|
||||||
throw new Error("Failed to load workspace.html");
|
|
||||||
}
|
// Ensure scripts inside the moved content are executed
|
||||||
return response.text();
|
workspaceContainer.querySelectorAll("script").forEach(oldScript => {
|
||||||
})
|
const newScript = document.createElement("script");
|
||||||
.then(data => {
|
newScript.text = oldScript.textContent;
|
||||||
workspaceContainer.innerHTML = data; // Embed workspace.html content
|
document.body.appendChild(newScript);
|
||||||
})
|
});
|
||||||
.catch(error => console.error("Error loading workspace:", error));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
2
layouts/partials/workspace_plot.html
Normal file
2
layouts/partials/workspace_plot.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue