Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified demos/moveit_pick_place/arm-self-test.sh
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@

set -eu

# ROS setup.bash dereferences AMENT_TRACE_SETUP_FILES; relax nounset around it.
set +u
# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash
# shellcheck source=/dev/null
source /root/demo_ws/install/setup.bash
set -u

echo "Injecting COLLISION fault..."
echo " Spawning surprise obstacle in robot workspace"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@

set -eu

# ROS setup.bash dereferences AMENT_TRACE_SETUP_FILES; relax nounset around it.
set +u
# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash
# shellcheck source=/dev/null
source /root/demo_ws/install/setup.bash
set -u

echo "Injecting PLANNING FAILURE fault..."
echo " Adding collision wall between pick and place positions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

set -eu

# ROS setup.bash dereferences AMENT_TRACE_SETUP_FILES; relax nounset around it.
set +u
# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash
# shellcheck source=/dev/null
source /root/demo_ws/install/setup.bash
set -u

GATEWAY_URL="${GATEWAY_URL:-http://localhost:8080}"
API_BASE="${GATEWAY_URL}/api/v1"
Expand Down
Empty file modified demos/moveit_pick_place/planning-benchmark.sh
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions demos/moveit_pick_place/setup-triggers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Create fault-monitoring trigger for moveit pick-and-place demo
# Alerts on any fault change reported by the manipulation monitor
export ENTITY_TYPE="apps"
# Uses ROS node name (underscore) - must match reporting_sources in FaultEvent
export ENTITY_ID="manipulation_monitor"
# Gateway normalises entity IDs with hyphens (matches the registered apps id).
export ENTITY_ID="manipulation-monitor"
export INJECT_HINT="./inject-planning-failure.sh"
# shellcheck disable=SC1091
source "$(cd "$(dirname "$0")" && pwd)/../../lib/setup-trigger.sh"
2 changes: 1 addition & 1 deletion demos/moveit_pick_place/watch-triggers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Watch trigger events for moveit pick-and-place demo
# Connects to SSE stream and prints fault events in real time
export ENTITY_TYPE="apps"
export ENTITY_ID="manipulation_monitor"
export ENTITY_ID="manipulation-monitor"
# shellcheck disable=SC1091
source "$(cd "$(dirname "$0")" && pwd)/../../lib/watch-trigger.sh" "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Inject gripper jam - gripper controller stuck
set -eu

# ROS setup.bash dereferences AMENT_TRACE_SETUP_FILES; relax nounset around it.
set +u
# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash
# shellcheck source=/dev/null
source /root/demo_ws/install/setup.bash
set -u

ros2 param set /actuation/gripper_controller inject_jam true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Reset all actuation node parameters to defaults
set -eu

# ROS setup.bash dereferences AMENT_TRACE_SETUP_FILES; relax nounset around it.
set +u
# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash
# shellcheck source=/dev/null
source /root/demo_ws/install/setup.bash
set -u

ERRORS=0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Inject LiDAR sensor failure - high failure probability
set -eu

# ROS setup.bash dereferences AMENT_TRACE_SETUP_FILES; relax nounset around it.
set +u
# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash
# shellcheck source=/dev/null
source /root/demo_ws/install/setup.bash
set -u

ros2 param set /perception/lidar_driver failure_probability 0.8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Reset all perception node parameters to defaults
set -eu

# ROS setup.bash dereferences AMENT_TRACE_SETUP_FILES; relax nounset around it.
set +u
# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash
# shellcheck source=/dev/null
source /root/demo_ws/install/setup.bash
set -u

ERRORS=0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Inject path planning delay - 5000ms processing time
set -eu

# ROS setup.bash dereferences AMENT_TRACE_SETUP_FILES; relax nounset around it.
set +u
# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash
# shellcheck source=/dev/null
source /root/demo_ws/install/setup.bash
set -u

ros2 param set /planning/path_planner planning_delay_ms 5000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Reset all planning node parameters to defaults
set -eu

# ROS setup.bash dereferences AMENT_TRACE_SETUP_FILES; relax nounset around it.
set +u
# shellcheck source=/dev/null
source /opt/ros/jazzy/setup.bash
# shellcheck source=/dev/null
source /root/demo_ws/install/setup.bash
set -u

ERRORS=0

Expand Down
Empty file modified demos/sensor_diagnostics/inject-fault-scenario.sh
100644 → 100755
Empty file.
Empty file modified demos/sensor_diagnostics/run-diagnostics.sh
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions demos/sensor_diagnostics/setup-triggers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Create fault-monitoring trigger for sensor diagnostics demo
# Alerts on any new fault reported via the diagnostic bridge
export ENTITY_TYPE="apps"
# Uses ROS node name (underscore) - must match reporting_sources in FaultEvent
export ENTITY_ID="diagnostic_bridge"
# Gateway normalises entity IDs with hyphens (matches the registered apps id).
export ENTITY_ID="diagnostic-bridge"
export INJECT_HINT="./inject-nan.sh"
# shellcheck disable=SC1091
source "$(cd "$(dirname "$0")" && pwd)/../../lib/setup-trigger.sh"
2 changes: 1 addition & 1 deletion demos/sensor_diagnostics/watch-triggers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Watch trigger events for sensor diagnostics demo
# Connects to SSE stream and prints fault events in real time
export ENTITY_TYPE="apps"
export ENTITY_ID="diagnostic_bridge"
export ENTITY_ID="diagnostic-bridge"
# shellcheck disable=SC1091
source "$(cd "$(dirname "$0")" && pwd)/../../lib/watch-trigger.sh" "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ echo "Waiting for particles to scatter..."
sleep 2

echo "Sending navigation goal with high localization uncertainty..."
curl -sf -X POST "${API_BASE}/apps/bt-navigator/operations/navigate_to_pose/executions" \
# Drop -f: action server typically rejects the goal under scattered particles,
# which is the demo's intended failure mode - treat HTTP 400 as expected.
RESPONSE=$(curl -s -X POST "${API_BASE}/apps/bt-navigator/operations/navigate_to_pose/executions" \
-H "Content-Type: application/json" \
Comment thread
mfaferek93 marked this conversation as resolved.
-d '{
"goal": {
Expand All @@ -27,7 +29,8 @@ curl -sf -X POST "${API_BASE}/apps/bt-navigator/operations/navigate_to_pose/exec
}
}
}
}'
}')
echo "${RESPONSE}" | jq '.' 2>/dev/null || echo "${RESPONSE}"

echo ""
echo "Localization failure injected."
Expand Down
7 changes: 4 additions & 3 deletions demos/turtlebot3_integration/setup-triggers.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
# Create fault-monitoring trigger for turtlebot3 integration demo
# Alerts on any fault change reported by the anomaly detector
# Alerts on any fault change reported via the diagnostic bridge - the
# anomaly-detector app has no faults of its own, faults arrive from
# /diagnostics through the bridge.
export ENTITY_TYPE="apps"
# Uses ROS node name (underscore) - must match reporting_sources in FaultEvent
export ENTITY_ID="anomaly_detector"
export ENTITY_ID="diagnostic-bridge"
export INJECT_HINT="./inject-nav-failure.sh"
# shellcheck disable=SC1091
source "$(cd "$(dirname "$0")" && pwd)/../../lib/setup-trigger.sh"
2 changes: 1 addition & 1 deletion demos/turtlebot3_integration/watch-triggers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Watch trigger events for turtlebot3 integration demo
# Connects to SSE stream and prints fault events in real time
export ENTITY_TYPE="apps"
export ENTITY_ID="anomaly_detector"
export ENTITY_ID="diagnostic-bridge"
# shellcheck disable=SC1091
source "$(cd "$(dirname "$0")" && pwd)/../../lib/watch-trigger.sh" "$@"
2 changes: 1 addition & 1 deletion lib/setup-trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ -z "${ENTITY_TYPE:-}" ] || [ -z "${ENTITY_ID:-}" ]; then
exit 1
fi

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck disable=SC1091
source "${SCRIPT_DIR}/triggers-api.sh"

Expand Down
2 changes: 1 addition & 1 deletion lib/watch-trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ -z "${ENTITY_TYPE:-}" ] || [ -z "${ENTITY_ID:-}" ]; then
exit 1
fi

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck disable=SC1091
source "${SCRIPT_DIR}/triggers-api.sh"

Expand Down
27 changes: 19 additions & 8 deletions tests/smoke_test_multi_ecu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,25 @@ wait_for_gateway 120
# Wait for runtime node linking (perception ECU local nodes)
wait_for_runtime_linking "/apps/lidar-driver/data" 90

# Wait for aggregation to discover peer ECUs
echo " Waiting for aggregated entities from planning ECU (max 60s)..."
if poll_until "/apps" '.items[] | select(.id == "path-planner")' 60; then
echo -e " ${GREEN}Aggregation discovery complete${NC}"
else
echo -e " ${RED}Aggregation discovery did not complete within 60s${NC}"
exit 1
fi
# Wait for aggregation to discover peer ECUs.
# The aggregator pulls each peer independently, so a single peer's marker app is
# not a sufficient readiness gate: we must see a representative app from EACH
# peer ECU before the discovery assertions run. Otherwise a slower peer
# (typically the actuation ECU) races the checks and surfaces as missing apps
# ("found 7" instead of >=10).
# planning ECU -> path-planner
# actuation ECU -> motor-controller
echo " Waiting for aggregated entities from planning + actuation ECUs (max 60s each)..."
for peer in "planning ECU:path-planner" "actuation ECU:motor-controller"; do
peer_name="${peer%%:*}"
peer_app="${peer##*:}"
if poll_until "/apps" ".items[] | select(.id == \"${peer_app}\")" 60; then
echo -e " ${GREEN}${peer_name} aggregated (${peer_app})${NC}"
else
echo -e " ${RED}${peer_name} not aggregated within 60s (${peer_app} missing)${NC}"
exit 1
fi
done

# --- Tests ---

Expand Down
Loading