diff --git a/src/components/panels/GasSensor.tsx b/src/components/panels/GasSensor.tsx deleted file mode 100644 index 60656ee..0000000 --- a/src/components/panels/GasSensor.tsx +++ /dev/null @@ -1,154 +0,0 @@ -'use client'; -import React, { useEffect, useState } from 'react'; -import ROSLIB from 'roslib'; -import { useROS } from '@/ros/ROSContext'; - -interface GasSensorReading { - temperature_c: number | null; - pressure_pa: number | null; - humidity_rh: number | null; - co2_ppm: number | null; - tvoc_ppb: number | null; - ozone_ppb: number | null; - hydrogen_ppb: number | null; - geiger: number | null; - } - -const SciencePanel: React.FC = () => { - const { ros } = useROS(); - const [data, setData] = useState ({ - temperature_c: null, - pressure_pa: null, - humidity_rh: null, - co2_ppm: null, - tvoc_ppb: null, - ozone_ppb: null, - hydrogen_ppb: null, - geiger: null, - }); - - useEffect(() => { - if (!ros) return; - - const gasSensorTopic = new ROSLIB.Topic({ - ros, - name: '/gas_sensor', - messageType: 'interfaces/msg/GasSensorReading', - }); - const ozoneTopic = new ROSLIB.Topic({ - ros, - name: '/ozone_sensor', - messageType: 'std_msgs/Float64', - }); - const hydrogenTopic = new ROSLIB.Topic({ - ros, - name: '/hydrogen_sensor', - messageType: 'std_msgs/Float64', - }); - const geigerTopic = new ROSLIB.Topic({ - ros, - name: '/geiger_counts', - messageType: 'std_msgs/Float32', - }); - - const handleGasReading = (msg: any) => { - setData(prev => ({ - ...prev, - temperature_c: msg.temperature_c, - pressure_pa: msg.pressure_pa, - humidity_rh: msg.humidity_rh, - co2_ppm: msg.co2_ppm, - tvoc_ppb: msg.tvoc_ppb, - })); - }; - - const handleOzoneReading = (msg: any) => { - setData(prev => ({ - ...prev, - ozone_ppb: msg.data, - })); - }; - - const handleHydrogenReading = (msg: any) => { - setData(prev => ({ - ...prev, - hydrogen_ppb: msg.data, - })); - }; - const handleGeigerReading = (msg: any) => { - setData(prev => ({ - ...prev, - geiger: msg.data, - })); - }; - - gasSensorTopic.subscribe(handleGasReading); - ozoneTopic.subscribe(handleOzoneReading); - hydrogenTopic.subscribe(handleHydrogenReading); - geigerTopic.subscribe(handleGeigerReading); - - return () => { - gasSensorTopic.unsubscribe(handleGasReading); - ozoneTopic.unsubscribe(handleOzoneReading); - hydrogenTopic.unsubscribe(handleHydrogenReading); - geigerTopic.unsubscribe(handleGeigerReading); - }; -}, [ros]); - -return ( -
- -
- ); -}; - export default SciencePanel; \ No newline at end of file diff --git a/src/components/panels/MosaicDashboard.tsx b/src/components/panels/MosaicDashboard.tsx index 176d44d..deddd80 100644 --- a/src/components/panels/MosaicDashboard.tsx +++ b/src/components/panels/MosaicDashboard.tsx @@ -14,7 +14,6 @@ import WaypointList from './WaypointList'; import SystemTelemetryPanel from './SystemTelemetryPanel'; import OrientationDisplayPanel from './OrientationDisplayPanel'; import GoalSetterPanel from './GoalSetterPanel'; -import GasSensor from './GasSensor'; import NetworkHealthTelemetryPanel from './NetworkHealthTelemetryPanel'; import VideoControls from './VideoControls'; import MotorStatusPanel from './MotorStatusPanel'; @@ -40,7 +39,6 @@ type TileType = | 'waypointList' | 'videoControls' | 'rtpStats' - | 'gasSensor' | 'orientationDisplay' | 'goalSetter' | 'networkHealthMonitor' @@ -68,7 +66,6 @@ const TILE_DISPLAY_NAMES: Record = { videoControls: 'Video Stream', rtpStats: 'RTP Statistics', driveThrottlePanel: 'Drive Throttle', - gasSensor: 'Science', orientationDisplay: 'Rover Orientation', goalSetter: 'Nav2', networkHealthMonitor: 'Connection Health', @@ -95,7 +92,6 @@ const ALL_TILE_TYPES: TileType[] = [ 'rtpStats', 'driveThrottlePanel', 'waypointList', - 'gasSensor', 'goalSetter', 'motorStatusPanel', 'nodeStatusPanel', @@ -417,13 +413,6 @@ const MosaicDashboard: React.FC = () => { ); - case 'gasSensor': - return ( - - - - ); - case 'goalSetter': return (