The Fault Injection Toolbox is a simulation-based, extensible framework designed for fault injection, faulty data generation, and scenario-based evaluation of robotic manipulation tasks using the Franka Emika Panda robotic manipulator.
It is built on ROS Noetic, Gazebo, and Python, and includes all required packages and versions for full reproducibility.
Normal Operation vs Fault-Injected Operation
First: Normal pick-and-place task; Second: Task execution with fault injection
Figure 1: Normal (noise-free) joint state trajectories during a pick-and-place task.
Figure 2: Joint state trajectories with injected Gaussian noise (mean = 0, standard deviation = 0.5).
The noise is visible on the affected joint, and the Fault_Flag line indicates the duration of injection.
This toolbox provides:
- Real-time fault injection on joint states
- Dataset generation (ROS β CSV) for ML and fault detection research
- End-to-end task pipeline (Gazebo β Faults β Data β Controller β Logging)
- Ready-made scenarios via
scenario_pipeline.sh - Ability to run custom robots, custom controllers, and custom fault profiles
This repository focuses exclusively on fault injection and faulty data generation.
It does not include the motion controllers, scenario logic, or custom Gazebo world files required to reproduce specific pick-and-place tasks.
All default pick-and-place scenarios, controllers, MoveIt configurations, and world files used in the examples are maintained separately in the companion repository:
π Franka Emika Pick & Place: https://github.com/adnanmk-1999/FrankaEmika_Pick_Place
This separation allows users to:
- Use the Fault Injection Toolbox with any robot, any controller, or any scenario
- Integrate fault injection into their own simulation setups
- Keep world files and task logic modular and independent
Modern robotic systems operate in environments where sensor reliability, state estimation, and controller feedback are critical for safe operation. Even small faultsβsuch as drift, noise, or sudden spikesβcan propagate through the system and eventually cause unsafe behavior or complete system failure.
Figure 3: Fault activation, error propagation, and potential system failure in safety-critical systems.
As illustrated above:
- A fault may activate in a low-risk (green) region
- It can propagate into an error state (yellow) if unmitigated
- If the system cannot compensate, it may escalate into a failure (red)
In safety-critical domains such as:
- Industrial robot manipulation
- Autonomous systems
- Medical robots
- Transportation and aerospace systems
- Collaborative robots (cobots)
even minor sensor errors can lead to:
- Unstable control
- Unpredictable behavior
- Collisions
- Damage to equipment
- Human safety hazards
This toolbox enables researchers and engineers to simulate these faults before they occur in real systems, helping them:
- Develop fault-tolerant controllers
- Validate robust perception algorithms
- Generate faulty datasets for ML-based anomaly detection
- Explore how faults propagate during different tasks
- Improve safety and reliability in real deployments
The toolbox is developed and tested on Ubuntu 20.04 LTS, the recommended operating system for ROS Noetic and Gazebo integration.
Download:
https://releases.ubuntu.com/20.04/
ROS Noetic is the core middleware used for communication, motion planning, controller management, and running all nodes in this toolbox.
Install from ROS Wiki:
http://wiki.ros.org/noetic
MoveIt is used for motion planning, kinematics, controllers, and executing pick-and-place tasks for the Franka Panda robot.
Installation Guide:
https://ros-planning.github.io/moveit_tutorials/doc/getting_started/getting_started.html
The official ROS integration for the Franka Emika Panda robot.
Note: Do not clone libfranka from Franka Research 3.
Installation Guide:
https://frankaemika.github.io/docs/installation_linux.html
This provides:
- Panda robot description (URDF/XACRO)
- Controllers
- ROS interfaces for simulation
- Gazebo compatibility
Gazebo is used to simulate the physics-based environment, robot dynamics, and interactions required for fault injection experiments.
Python is used for implementing:
- The real-time fault injector
- Custom scenarios
- Data logging logic
- High-level control utilities
It integrates natively with ROS Noetic using rospy.
The Franka Emika Panda robot is a widely-used collaborative 7βDoF manipulator, ideal for simulationβbased research.
- 7 Degrees of Freedom (Revolute joints)
- 3 kg payload
- 855 mm reach
- Highβprecision torque sensing
- Designed for safety and compliance
- Standard model available in ROS/Gazebo
Figure 4: Franka Emika Panda Manipulator with links and joints.
Figure 5: Block diagram of the proposed system.
Location:
src/joint_state_publisher/joint_state_publisher/scripts/fault_injector
Figure 6: Common sensor error patterns observed in robotic and cyber-physical systems.
These fault patterns represent the most frequently occurring disturbances in real-world sensing systems:
- Spike β Sudden high-amplitude jump in signal
- Offset β Constant shift added to the real signal
- Drift β Gradually increasing or decreasing bias over time
- Stuck-at β Sensor value freezes at a constant reading
- Noise β High-frequency random variations
These faults are representative of sensor degradation, EMI noise, connection issues, hardware wear, and calibration drift commonly observed in robotics and industrial automation.
- Noise (Gaussian)
- Spike
- Offset
- Drift
- Stuck-at
- Corrupted / Missing data (zero/random)
- Joint positions
- Joint velocities
Tested on Franka Emika Panda.
Location:
faulty_data_generation/src/data_generation.cpp
β Subscribes to faulty joint states
β Converts ROS messages to CSV
β Publishes custom messages
β Generates datasets per run
β Timestamps used for file naming
- New CSV is created for each run
- Filename includes timestamp
- Suitable for ML pipelines, dataset labeling, anomaly detection
The faulty_data_generation package publishes a custom ROS message named FaultyData, which contains:
- Header information
- Fault flag (active/inactive)
- Affected joint index
- Joint names
- Joint position, velocity, and effort arrays
The message structure (from rosmsg show faulty_data_generation/FaultyData) is shown below:
Figure 7: Custom FaultyData message definition used for dataset generation.
Fault_Injection_Toolbox/
β
βββ drift_config.yaml
βββ noise_config.yaml
βββ spike_config.yaml
βββ off_set_config.yaml
βββ stuck_at_config.yaml
β
βββ scenario_pipeline.sh # Full endβtoβend scenario execution
βββ scenario_stuck_at.sh # Example scenario
βββ bag2csv.sh # Bagfile conversion
β
βββ faulty_data_generation/
β βββ CMakeLists.txt
β βββ msg/
β βββ package.xml
β βββ src/
β βββ data_generation.cpp
β
βββ joint_state_publisher/ # Modified publisher w/ fault injector
βββ franka_ros-0.9.1/
βββ moveit/
βββ panda_gazebo/
βββ panda_moveit_config-noetic-devel/
If everything is set up:
./scenario_pipeline.shThis automatically runs predefined scenarios and controllers:
- Starts Gazebo world
- Spawns Franka
- Begins rosbag logging
- Injects configured faults
- Starts dataset generator
- Runs the controller
This is the fastest way to reproduce results.
Below is a screenshot of the terminal interface when running a complete scenario using the built-in pipeline script.
This interface allows you to:
- Select a fault type
- Select a predefined scenario
- Choose number of runs
- Automatically launch Gazebo, MoveIt, fault injection, data generation, and logging
Figure 8: User interface of scenario_pipeline.sh during automated multi-run execution.
roslaunch panda_gazebo start-pick-and-place-world_$world.launch
roslaunch panda_gazebo put_robot_in_world.launch
rosbag record -O $timestamp.bag /faulty_data
rosrun joint_state_publisher fault_injector.$fault_node
rosrun faulty_data_generation data_generation
rosrun moveit_tutorials own_pick_place_yc_$controller
Available configurations:
noise_config.yamlspike_config.yamloff_set_config.yamldrift_config.yamlstuck_at_config.yaml
Example:
fault_location: 3
fault_magnitude: 0.20
fault_duration: 2.5
fault_start_time: 4.0Each scenario can load different configs.
- Additional fault types
- Real-robot integration
- GUI for fault configuration
- Advanced analytics for fault detection
Developed by Adnan
Software Developer & Robotics Engineer









