Skip to content

Latest commit

 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RobResilience: Implementing and Evaluating a Resilience Framework for Cyber-Physical Embodied Systems

Architecture

System Architecture

Installation

cd ~/ros2_ws
colcon build --packages-select my_attack_interfaces
source install/setup.bash
colcon build --packages-select attack_pkg
source install/setup.bash

Automated Execution

Instead 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):

Experiments in paper

cd autoruns
# scenario_num= 1, 2a, 2b, 3a, 3b, 3c, 4a, 4b
chmod +x data_exp_{scenario_num}.sh
./data_exp_{scenario_num}.sh

Manual Execution

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.wbt

Terminal 2: Run PR2 controller using JSON configuration file:

python3 ~/my_webot_project/controllers/manual_run.py

or

python3 ~/my_webot_project/controllers/pr2_controller/pr2_controller.py  ~/my_webot_project/controllers/pr2_controller/configs/experiment2.json

Terminal 3: Attack node:

cd ~/ros2_ws && source install/setup.bash
ros2 run attack_pkg attack_node

Terminal 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: []}"

Available Attacks

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

Testing

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

Acknowledgment

WASP 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

Releases

Packages

Contributors

Languages