diff --git a/app/src/lib/components/Lidar.svelte b/app/src/lib/components/Lidar.svelte
index fdeed2a..8f05a4f 100644
--- a/app/src/lib/components/Lidar.svelte
+++ b/app/src/lib/components/Lidar.svelte
@@ -1,5 +1,6 @@
diff --git a/app/src/lib/stores/lidar.ts b/app/src/lib/stores/lidar.ts
new file mode 100644
index 0000000..424f723
--- /dev/null
+++ b/app/src/lib/stores/lidar.ts
@@ -0,0 +1,29 @@
+import { writable } from 'svelte/store';
+
+export type LidarPoint = {
+ distance: number;
+ angle: number;
+ quality: number;
+};
+
+let lidar_data = {
+ points: []
+};
+
+const maxLidarData = 600;
+
+function createLidar() {
+ const { subscribe, update } = writable(lidar_data);
+
+ return {
+ subscribe,
+ addData: (lidarPoint: LidarPoint) => {
+ update((lidar_data) => ({
+ ...lidar_data,
+ points: [...lidar_data.points, lidarPoint].slice(-maxLidarData)
+ }));
+ }
+ };
+}
+
+export const lidar = createLidar();
diff --git a/app/src/routes/menu.svelte b/app/src/routes/menu.svelte
index 89e305c..42f041e 100644
--- a/app/src/routes/menu.svelte
+++ b/app/src/routes/menu.svelte
@@ -8,6 +8,7 @@
import Devices from '~icons/mdi/devices'
import Camera from '~icons/mdi/camera-outline';
import Rotate3d from '~icons/mdi/rotate-3d';
+ import MdiLandslideOutline from '~icons/mdi/landslide-outline';
import MotorOutline from '~icons/mdi/motor-outline';
import Health from '~icons/mdi/stethoscope';
import Folder from '~icons/mdi/folder-outline';
@@ -83,6 +84,12 @@
icon: Rotate3d,
href: '/peripherals/imu',
feature: $page.data.features.imu || $page.data.features.mag || $page.data.features.bmp,
+ },
+ {
+ title: 'Lidar',
+ icon: MdiLandslideOutline,
+ href: '/peripherals/lidar',
+ feature: true//$page.data.features.lidar,
}
]
},
diff --git a/app/src/routes/peripherals/lidar/+page.svelte b/app/src/routes/peripherals/lidar/+page.svelte
new file mode 100644
index 0000000..22c6c5c
--- /dev/null
+++ b/app/src/routes/peripherals/lidar/+page.svelte
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/app/src/routes/peripherals/lidar/lidar.svelte b/app/src/routes/peripherals/lidar/lidar.svelte
new file mode 100644
index 0000000..84ab5c2
--- /dev/null
+++ b/app/src/routes/peripherals/lidar/lidar.svelte
@@ -0,0 +1,95 @@
+
+
+
+
+ Lidar
+
+
+
+
+
+
\ No newline at end of file