RobResilience: Implementing and Evaluating a Resilience Framework for Cyber-Physical Embodied Systems
cd ~/ros2_ws
colcon build --packages-select my_attack_interfaces
source install/setup.bash
colcon build --packages-select attack_pkg
source install/setup.bashInstead of the manual multi-terminal flow above, run_scenario.sh automates a full
run: it launches Webots, starts the PR2 controller after a delay, injects an attack,
waits for the experiment to finish, records the result CSV, and shuts Webots down.
cd ~/ros2_ws && source install/setup.bash # ensure ROS 2 is sourced
./run_scenario.sh [config] [attack] [result]All arguments are optional and have defaults (experiment_1 + left_gripper:GRIP_WEAK):
cd autoruns
# scenario_num= 1, 2a, 2b, 3a, 3b, 3c, 4a, 4b
chmod +x data_exp_{scenario_num}.sh
./data_exp_{scenario_num}.sh
Open 3 separate terminals and run one command in each.
Terminal 1: Webots simulation without PR2 controller:
cd ~/ros2_ws && source install/setup.bash
webots ~/my_webot_project/worlds/my_project_world.wbtTerminal 2: Run PR2 controller using JSON configuration file:
python3 ~/my_webot_project/controllers/manual_run.pyor
python3 ~/my_webot_project/controllers/pr2_controller/pr2_controller.py ~/my_webot_project/controllers/pr2_controller/configs/experiment2.jsonTerminal 3: Attack node:
cd ~/ros2_ws && source install/setup.bash
ros2 run attack_pkg attack_nodeTerminal 4: Trigger an attack:
cd ~/ros2_ws && source install/setup.bash
ros2 topic pub --once /active_attacks my_attack_interfaces/msg/AttackState \
"{compromised_devices: ['right_wheels:STOP']}"Terminal 5: Stop all attacks:
ros2 topic pub --once /active_attacks my_attack_interfaces/msg/AttackState \
"{compromised_devices: []}"| Component | Attack Types |
|---|---|
left_wheels, right_wheels |
STOP, OVERSPEED, UNDERSPEED, BACKWARD |
left_arm, right_arm |
STOP, OVERSPEED, UNDERSPEED, BACKWARD |
left_gripper, right_gripper |
STOP, OVERSPEED, UNDERSPEED, BACKWARD, GRIP_WEAK |
torso, head |
STOP, OVERSPEED, UNDERSPEED, BACKWARD |
Unit tests live in my_webot_project/controllers/tests/tests.py and cover the degradation metric (metrics.Metrics.compute_degradation), including the
edge cases where task execution time is negative (a task finishing faster than its baseline, or halting before completion).
Run them with pytest from the tests directory:
cd ~/my_webot_project/controllers/tests
pytest tests.py -v
This project is funded by Wallenberg AI, Autonomous Systems and Software Program (WASP).
This version of project is automation and deployment of ros2-based simulation for resilience-aware robotics cyber-physical system developed by Gysella Imrell. All experiments are fully available. Link to initial version: https://github.com/GysellaImrell/examensarbete
