From ca439e097649eefcaa4a6a5c6fac853eee68b868 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Tue, 18 Jun 2024 10:58:20 +0200 Subject: [PATCH] Suggestions --- demo/compose.local.yaml | 1 + demo/compose.yaml | 1 + demo/foxglove-layout.json | 36 +++++++++------------ entrypoint.sh | 0 packages/studio-base/src/panels/Bar/Bar.tsx | 3 +- 5 files changed, 20 insertions(+), 21 deletions(-) mode change 100644 => 100755 entrypoint.sh diff --git a/demo/compose.local.yaml b/demo/compose.local.yaml index c90dc26..e634565 100644 --- a/demo/compose.local.yaml +++ b/demo/compose.local.yaml @@ -17,6 +17,7 @@ services: volumes: - ./foxglove-layout.json:/foxglove/default-layout.json environment: + - ROBOT_NAMESPACE=panther # - DS_HOST=foxglove-ds - DISABLE_CACHE=true - DISABLE_INTERACTION=false diff --git a/demo/compose.yaml b/demo/compose.yaml index b715e66..6be7907 100644 --- a/demo/compose.yaml +++ b/demo/compose.yaml @@ -11,6 +11,7 @@ services: volumes: - ./foxglove-layout.json:/foxglove/default-layout.json environment: + - ROBOT_NAMESPACE=panther - DS_HOST=foxglove-ds - DISABLE_CACHE=true - DISABLE_INTERACTION=false diff --git a/demo/foxglove-layout.json b/demo/foxglove-layout.json index 6958320..7732efe 100644 --- a/demo/foxglove-layout.json +++ b/demo/foxglove-layout.json @@ -4,27 +4,27 @@ "minLevel": 0, "pinnedIds": [], "hardwareIdFilter": "", - "topicToRender": "/panther/diagnostics", + "topicToRender": "/diagnostics", "sortByLevel": true }, "Plot!dg5ynj": { "paths": [ { "timestampMethod": "receiveTime", - "value": "/panther/imu/data.linear_acceleration.x", + "value": "/imu_sensor_broadcaster/imu.linear_acceleration.x", "enabled": true, "label": "x", "showLine": true }, { "timestampMethod": "receiveTime", - "value": "/panther/imu/data.linear_acceleration.y", + "value": "/imu_sensor_broadcaster/imu.linear_acceleration.y", "enabled": true, "label": "y" }, { "timestampMethod": "receiveTime", - "value": "/panther/imu/data.linear_acceleration.z", + "value": "/imu_sensor_broadcaster/imu.linear_acceleration.z", "enabled": true, "label": "z" } @@ -41,39 +41,35 @@ "followingViewWidth": 60 }, "Bar!3t52ye7": { - "path": "/panther/joint_states.effort[0]", - "minValue": -20, + "path": "/joint_states.effort[0]", "maxValue": 34.52, "colorMode": "colormap", "gradient": ["#0000ff", "#ff00ff"], - "reverse": true, + "reverse": false, "foxglovePanelTitle": "FL" }, "Bar!461hl59": { - "path": "/panther/joint_states.effort[1]", - "minValue": -20, + "path": "/joint_states.effort[1]", "maxValue": 34.52, "colorMode": "colormap", "gradient": ["#0000ff", "#ff00ff"], - "reverse": false, + "reverse": true, "foxglovePanelTitle": "FR" }, "Bar!1fzrnqw": { - "path": "/panther/joint_states.effort[2]", - "minValue": -20, + "path": "/joint_states.effort[2]", "maxValue": 34.52, "colorMode": "colormap", "gradient": ["#0000ff", "#ff00ff"], - "reverse": true, + "reverse": false, "foxglovePanelTitle": "RL" }, "Bar!1q5qffy": { - "path": "/panther/joint_states.effort[3]", - "minValue": -20, + "path": "/joint_states.effort[3]", "maxValue": 34.52, "colorMode": "colormap", "gradient": ["#0000ff", "#ff00ff"], - "reverse": false, + "reverse": true, "foxglovePanelTitle": "RR" }, "TriggerButton!2mhoc9g": { @@ -82,7 +78,7 @@ "advancedView": false, "foxglovePanelTitle": "E-stop", "buttonText": "STOP", - "serviceName": "/panther/hardware/e_stop_trigger", + "serviceName": "/hardware/e_stop_trigger", "buttonColor": "#bb0000" }, "TriggerButton!194be9": { @@ -92,10 +88,10 @@ "foxglovePanelTitle": "E-stop", "buttonText": "Enable", "buttonColor": "#009900", - "serviceName": "/panther/hardware/e_stop_reset" + "serviceName": "/hardware/e_stop_reset" }, "Battery!wppv5y": { - "path": "/panther/battery.percentage", + "path": "/battery.percentage", "minValue": 0, "maxValue": 1, "colorMap": "red-yellow-green", @@ -105,7 +101,7 @@ "foxglovePanelTitle": "" }, "Joy!3fmstz6": { - "topic": "/panther/cmd_vel", + "topic": "/cmd_vel", "publishRate": 5, "upButton": { "field": "linear-x", diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755 diff --git a/packages/studio-base/src/panels/Bar/Bar.tsx b/packages/studio-base/src/panels/Bar/Bar.tsx index 724cf4d..38b70a3 100644 --- a/packages/studio-base/src/panels/Bar/Bar.tsx +++ b/packages/studio-base/src/panels/Bar/Bar.tsx @@ -209,6 +209,7 @@ export function Bar({ context }: Props): JSX.Element { const { maxValue, reverse } = config; const barPercentage = Math.round((100 * rawValue) / maxValue) + const percentage = reverse ? -barPercentage : barPercentage; const levelHeight = Math.max(Math.min(Math.abs(barPercentage), 100), 0) / 2; // 50% is the max height const isPositive = reverse ? rawValue < 0 : rawValue >= 0; @@ -229,7 +230,7 @@ export function Bar({ context }: Props): JSX.Element { style={{ height: `${levelHeight}%`, top, bottom }} > -
{barPercentage}%
+
{percentage}%
); }