Skip to content

Commit

Permalink
Suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Jun 18, 2024
1 parent 4eb41fd commit ca439e0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
1 change: 1 addition & 0 deletions demo/compose.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions demo/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 16 additions & 20 deletions demo/foxglove-layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
"minLevel": 0,
"pinnedIds": [],
"hardwareIdFilter": "",
"topicToRender": "/panther/diagnostics",
"topicToRender": "<robot_namespace>/diagnostics",
"sortByLevel": true
},
"Plot!dg5ynj": {
"paths": [
{
"timestampMethod": "receiveTime",
"value": "/panther/imu/data.linear_acceleration.x",
"value": "<robot_namespace>/imu_sensor_broadcaster/imu.linear_acceleration.x",
"enabled": true,
"label": "x",
"showLine": true
},
{
"timestampMethod": "receiveTime",
"value": "/panther/imu/data.linear_acceleration.y",
"value": "<robot_namespace>/imu_sensor_broadcaster/imu.linear_acceleration.y",
"enabled": true,
"label": "y"
},
{
"timestampMethod": "receiveTime",
"value": "/panther/imu/data.linear_acceleration.z",
"value": "<robot_namespace>/imu_sensor_broadcaster/imu.linear_acceleration.z",
"enabled": true,
"label": "z"
}
Expand All @@ -41,39 +41,35 @@
"followingViewWidth": 60
},
"Bar!3t52ye7": {
"path": "/panther/joint_states.effort[0]",
"minValue": -20,
"path": "<robot_namespace>/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": "<robot_namespace>/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": "<robot_namespace>/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": "<robot_namespace>/joint_states.effort[3]",
"maxValue": 34.52,
"colorMode": "colormap",
"gradient": ["#0000ff", "#ff00ff"],
"reverse": false,
"reverse": true,
"foxglovePanelTitle": "RR"
},
"TriggerButton!2mhoc9g": {
Expand All @@ -82,7 +78,7 @@
"advancedView": false,
"foxglovePanelTitle": "E-stop",
"buttonText": "STOP",
"serviceName": "/panther/hardware/e_stop_trigger",
"serviceName": "<robot_namespace>/hardware/e_stop_trigger",
"buttonColor": "#bb0000"
},
"TriggerButton!194be9": {
Expand All @@ -92,10 +88,10 @@
"foxglovePanelTitle": "E-stop",
"buttonText": "Enable",
"buttonColor": "#009900",
"serviceName": "/panther/hardware/e_stop_reset"
"serviceName": "<robot_namespace>/hardware/e_stop_reset"
},
"Battery!wppv5y": {
"path": "/panther/battery.percentage",
"path": "<robot_namespace>/battery.percentage",
"minValue": 0,
"maxValue": 1,
"colorMap": "red-yellow-green",
Expand All @@ -105,7 +101,7 @@
"foxglovePanelTitle": ""
},
"Joy!3fmstz6": {
"topic": "/panther/cmd_vel",
"topic": "<robot_namespace>/cmd_vel",
"publishRate": 5,
"upButton": {
"field": "linear-x",
Expand Down
Empty file modified entrypoint.sh
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion packages/studio-base/src/panels/Bar/Bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -229,7 +230,7 @@ export function Bar({ context }: Props): JSX.Element {
style={{ height: `${levelHeight}%`, top, bottom }}
></div>
</div>
<div className="percentage">{barPercentage}%</div>
<div className="percentage">{percentage}%</div>
</Stack>
);
}

0 comments on commit ca439e0

Please sign in to comment.