Replication package for the paper RobEthiChor: automated context-aware ethics-based negotiation for autonomous robots
This study has been designed, developed, and reported by the following investigators:
- Mashal Afzal Memon (University of L'Aquila, Italy)
- Gianluca Filippone (Gran Sasso Science Institute, Italy)
- Gian Luca Scoccia (Gran Sasso Science Institute, Italy)
- Marco Autili (University of L'Aquila, Italy)
- Paola Inverardi (Gran Sasso Science Institute, Italy)
Memon, M. A., Filippone, G., Scoccia, G. L., Autili, M., & Inverardi, P. (2026). RobEthiChor: Automated context-aware ethics-based negotiation for autonomous robots. Journal of Systems and Software, 232, 112692. doi:10.1016/j.jss.2025.112692
@article{robethichor,
title = {RobEthiChor: Automated context-aware ethics-based negotiation for autonomous robots},
author = {Mashal Afzal Memon and Gianluca Filippone and Gian Luca Scoccia and Marco Autili and Paola Inverardi},
journal = {Journal of Systems and Software},
volume = {232},
pages = {112692},
year = {2026},
issn = {0164-1212},
doi = {https://doi.org/10.1016/j.jss.2025.112692}
}
towards-uncertainty-aware-bts
| README.md # This file
| LICENSE # License file
├---analysis # Jupyter Notebook files for the results analyis
├---results # Raw log files from the experimentation
└---ros_ws # ROS 2 workspace with RobEthiChor
| └---src
| ├---robethichor # RobEthiChor ROS 2 package
| └---robethichor_interfaces # ROS 2 package for RobEthiChor services interfaces
└---run # Experimental settings and experiment running facilities
├---scalability_experiments
| | run_experiment.bash # Script for running scalability experiments
| | generate_test_cases.py # Test cases generation script
| └---test_cases # Test cases used in the paper
└---simulation
| disposition_activation.json # Scenario-related disposition activation configuration
| echical_implications.json # Scenario-related task ethical implication model
| run_usecase.bash # Script for running airport negotiation scenarios
├---airport
├---hospital
└---personas
| personas.pdf # Personas description
| ground_truth.xlsx # Ground thruth expected data and negotiations outcome observation
└---[A-J] # Personas profiles and status implementation
Raw data obtained from experiments are contained in the results/ folder as a set of log files:
ping_results.txtcontains the results of ping messages sent during the experimentation to monitor the network latency for robot-to-robot messagingscalability-offrobot.logcontains the logged negotiation results for the scalability experiments in the off-robot settingscalability-onrobot.logcontains the logged negotiation results for the scalability experiments in the on-robot settingsimulation-[airport/hospital]-offrobot.logcontains the logged negotiation results for the negotiation scenarios in the airport and hospital context in the off-robot settingsimulation-[airport/hospital]-onrobot.logcontains the logged negotiation results for the negotiation scenarios in the airport and hospital context in the on-robot setting
More info in the results README file.
Log analysis and results are contained in the analysis/ folder as a set of Jupyter Notebook files:
deployment-comparison.ipynbcontains a comparative analysis of the negotiation times measured for the scalability experiments in the on-robot and off-robot with profiles containing up to 100 dispositions.log_comparison.ipynbcompares the logs obtained in the simulated scenarios for results consistency.ping_analysis.pyextracts overall stats for the network latency.scalability-offrobot-analysis.ipynbandscalability-onrobot-analysis.ipynbcontain the analysis on the performance scalability of the negotiation approach.simulation_analysis.ipynbcontains the analysis of the results of the negotiation scenarios.
More info in the analysis README file.
Note
More info on the implementation in the RobEthiChor-ROS repository
- Ubuntu 22.04
- ROS 2 Humble
- ROS dev-tools
- Rosdep
Download the repository:
git clone https://github.com/RoboChor/robethichor-ethics-based-negotiation.git
Build the ROS package:
Note
Rosdep must be installed and initialized before building the ROS package. Install Rosdep:
sudo apt-get update
sudo apt-get install python3-rosdep
Initialize Rosdep:
sudo rosdep init
rosdep update
cd robethichor-ethics-based-negotiation/ros_ws
rosdep install --from-paths src -y --ignore-src
colcon build
Important
RobEthiChor must be deployed on the machine that will execute it. To test the on-robot deployment, clone the repository or move the ros_ws/ folder on the robot before installing dependencies and building the ROS packages.
Alternatively, RobEthiChor can be built locally and then moved on the target machine (e.g., if dev-tools are not available). In this case, move the whole workspace folder after running colcon build locally:
scp . user@host:/path/to/ros_ws
Then, cd into the moved ros_ws/ folder in the target machine and reinstall the dependencies using Rosdep (install and init if required as shown above):
sudo apt-get update
rosdep install --from-paths src -y --ignore-src
The run/ folder contains the experimental settings and the scripts required to run them. They must be run outside of the robots despite of the chosen deployment setting.
The files run_usecase.bash and run_experiment.bash provides support for launching the experiments. Documentation on the parameters can be found within them.
Configuration and running facilities can be found in the simulation/ folder.
cd ../run/simulation
chmod +x run_usecase.bash
./run_usecase.bash --launch true --context <airport/hospital>
Two terminals will open, each for one of the two robots. Log files will be stored inside the newly created simulation/results/ folder.
Deploy RobEthiChor on the two negotiating robots as explained above, and copy the usecases/disposition_activation.json and usecases/ethical_implications.json files inside the robot's ros_ws/ folder:
cd ../run/simulation
scp disposition_activation.json user@host:/path/to/ros_ws
scp ethical_implications.json user@host:/path/to/ros_ws
Then, from the robot's ros_ws/ folder, run:
. install/setup.bash
ros2 launch robethichor robethichor_launch.py ns:=[ROBOT_NAME] port:=[ROBOT_PORT] ethical_implication_file:=/path/to/ros_ws/ethical_implications.json disposition_activation_file:=/path/to/ros_ws/disposition_activation.json log_output_file:=/path/to/ros_ws/negotiation_results.log
Important
Substitute ROBOT_NAME and ROBOT_PORT with the name of each of the robots (e.g., robassistant_1 and robassistant_2) and the robot's connector port (e.g., 5000 and 5001)
Finally, run the scenarios from the computer:
chmod +x run_usecase.bash
./run_usecase.bash --names <robot1_name> <robot2_name> --hosts <robot1_host> <robot2_host> --ports <robot1_port> <robot2_port>
Important
Substitute parameters according to the configurations provided to the launched robots. robot1_host and robot2_host must contain the IP addresses of the two robots.
Log files will be stored inside the newly created results/ folder within the robot's ros_ws/ folder.
Configuration and running facilities can be found in the scalability_experiments/ folder.
Note
Test cases used for running experiments are already contained into the repository.
To generate new test cases, use the generate_test_cases.py python script:
python3 generate_test_cases --n <N> --p <P> --c <NUMBER_OF_CASES>
cd ../run/scalability_experiments
chmod +x run_experiment.bash
./run_experiment.bash --launch true
Two terminals will open, each for one of the two robots. Log files will be stored inside the newly created scalability_experiments/results/ folder.
Note
The script run_experiment.bash will prompt, before running each configuration, the wait times between each negotiation so to avoid overlapping different negotiations.
Deploy RobEthiChor on the two negotiating robots as explained above, and copy the test_cases/disposition_activation.json and test_cases/ethical_implications.json files inside the robot's ros_ws/ folder:
cd ../run/simulation
scp scalability_experiments/test_cases/disposition_activation.json user@host:/path/to/ros_ws
scp scalability_experiments/test_cases/ethical_implications.json user@host:/path/to/ros_ws
Then, from the robot's ros_ws/ folder, run:
. install/setup.bash
ros2 launch robethichor robethichor_launch.py ns:=[ROBOT_NAME] port:=[ROBOT_PORT] ethical_implication_file:=/path/to/ros_ws/ethical_implications.json disposition_activation_file:=/path/to/ros_ws/disposition_activation.json log_output_file:=/path/to/ros_ws/negotiation_results.log
Important
Substitute ROBOT_NAME and ROBOT_PORT with the name of each of the robots (e.g., robassistant_1 and robassistant_2) and the robot's connector port (e.g., 5000 and 5001)
Finally, run the scenarios from the computer:
chmod +x run_experiment.bash
./run_experiment.bash --names <robot1_name> <robot2_name> --hosts <robot1_host> <robot2_host> --ports <robot1_port> <robot2_port>
Important
Substitute parameters according to the configurations provided to the launched robots. robot1_host and robot2_host must contain the IP addresses of the two robots.
Log files will be stored inside the newly created results/ folder within the robot's ros_ws/ folder.