# arghyachatterjee/autonomous-docking-for-mobile-robots architecture

> Architecture diagram of the GitHub repository arghyachatterjee/autonomous-docking-for-mobile-robots, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arghyachatterjee/autonomous-docking-for-mobile-robots
- Repository: https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots

## Overview

##### Project type and purpose
- This is an open-source ROS (Robot Operating System) software suite for autonomous docking of differential-drive robots.
- It comprises three ROS packages:
- autodock_core – the core docking logic implemented as a state machine and action-server.
- autodock_sim – Gazebo simulation worlds, models, and plugins to simulate the robot and charger.
- autodock_examples – demonstration scripts, RViz configurations, and test cases.

##### File structure
Top level
- Dockerfile – containerizes the ROS workspace.
autodock_core
- action/AutoDocking.action – defines the docking goal/result action interface.
- launch/autodock_server.launch – brings up the core docking action server.
- scripts/autodock_core/*.py – Python ROS nodes (server, utilities, simple CLI).
- src/*.cpp – C++ components (e.g., ObstacleObserver).
- setup.py, package.xml, CMakeLists.txt – build and packaging.
autodock_sim
- launch/*.launch – Gazebo worlds (charging.world, tb3_charging.world).
- models/ – URDF/SDF models, textures, charger, robot meshes.
- src/ChargingStationPlugin.cpp – Gazebo plugin publishing charger pose / fiducial.
autodock_examples
- configs/*.yaml – example docking server configurations per robot.
- rviz/ – camera/fiducial visualization presets.
- scripts/*.py – scripted docking tests (mock robot, Turtlebot3).

##### README for additional insights
- Core logic uses ROS actionlib and a state machine to drive docking steps (approach, align, dock).
- Fiducial marker detection is performed by an external node (UbiquityRobotics/fiducials).
- Can integrate with the Turtlebot3 Navigation Stack or operate standalone.
- Provides Docker deployment for reproducible builds.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Sensors Layer
    subgraph "Sensors" 
        direction TB
        Camera["Camera"]:::external
        Camera -->|"image_raw"| Fiducial["Fiducial Detection Node"]:::external
    end

    %% ROS Core
    ROSMaster["ROS Master"]:::external

    %% Processing Layer
    subgraph "autodock_core Package" 
        direction TB
        AD_Action["AutoDocking.action"]:::core
        AD_Launch["autodock_server.launch"]:::core
        AD_Server["autodock_server.py\n(Action Server)"]:::core
        StateMachine["State Machine"]:::core
        ObstacleObs["ObstacleObserver.cpp"]:::core
        Utils["autodock_utils.py"]:::core
        CLI["simple_autodock.py"]:::core
        AD_Server -->|uses| StateMachine
        StateMachine -->|monitors| ObstacleObs
        AD_Server -->|calls| Utils
        CLI -->|action client| AD_Server
        AD_Launch -->|launches| AD_Server
        AD_Launch -->|launches| AD_Action
    end

    Fiducial -->|"/fiducial_marker/pose"| AD_Server
    ROSMaster --> AD_Server

    %% Actuation / Simulation Layer
    subgraph "Actuation & Simulation"
        direction TB
        RobotCtrl["Robot Control Node"]:::core
        RobotCtrl -->|"/cmd_vel"| RobotBase["Robot Base"]:::external

        subgraph "Gazebo Simulation" 
            direction TB
            GZ_Launch1["dock_sim.launch"]:::sim
            GZ_Launch2["tb3_dock_sim.launch"]:::sim
            GZ_Launch3["tb3_nav_dock_sim.launch"]:::sim
            ChargingPlugin["ChargingStationPlugin.cpp"]:::sim
            Worlds["Worlds"]:::sim
            Models["Models"]:::sim

            GZ_Launch1 --> ChargingPlugin
            GZ_Launch1 --> Worlds
            GZ_Launch1 --> Models
            GZ_Launch2 --> ChargingPlugin
            GZ_Launch2 --> Worlds
            GZ_Launch3 --> ChargingPlugin
            GZ_Launch3 --> Worlds
            GZ_Launch3 --> Models

            ChargingPlugin -->|publishes TF| ROSMaster
        end

        AD_Server -->|"/cmd_vel"| RobotCtrl
    end

    %% Optional Navigation Stack
    subgraph "Optional External Systems"
        direction TB
        NavStack["move_base / amcl"]:::optional
        NavStack -->|"/move_base_simple/goal"| AD_Server
    end

    %% Visualization & Examples
    subgraph "autodock_examples Package"
        direction TB
        Config1["mock_robot.yaml"]:::core
        Config2["turtlebot3.yaml"]:::core
        RViz1["default.rviz"]:::core
        RViz2["tb3_nav.rviz"]:::core
        Test1["dock_robot_test.py"]:::core
        Test2["dock_sim_test.py"]:::core

        Test2 -->|action client| AD_Server
        Test1 -->|action client| AD_Server
        RViz1 -->|visualizes| ROSMaster
        RViz2 -->|visualizes| ROSMaster
    end

    %% Docker & Docs
    subgraph "Deployment & Documentation"
        direction TB
        Docker["Dockerfile"]:::optional
        Docs["docs/"]:::optional
        Docker --> ROSMaster
    end

    %% Click Events
    click autodock_core/ "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/tree/main/autodock_core/"
    click AD_Action "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_core/action/AutoDocking.action"
    click AD_Launch "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_core/launch/autodock_server.launch"
    click AD_Server "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_core/scripts/autodock_core/autodock_server.py"
    click Utils "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_core/scripts/autodock_core/autodock_utils.py"
    click CLI "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_core/scripts/simple_autodock.py"
    click ObstacleObs "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_core/src/ObstacleObserver.cpp"
    click autodock_core/setup.py "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_core/setup.py"
    click autodock_core/CMakeLists.txt "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_core/CMakeLists.txt"
    click autodock_core/package.xml "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_core/package.xml"

    click autodock_sim/ "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/tree/main/autodock_sim/"
    click GZ_Launch1 "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_sim/launch/dock_sim.launch"
    click GZ_Launch2 "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_sim/launch/tb3_dock_sim.launch"
    click GZ_Launch3 "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_sim/launch/tb3_nav_dock_sim.launch"
    click ChargingPlugin "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_sim/src/ChargingStationPlugin.cpp"
    click autodock_sim/worlds/charging.world "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_sim/worlds/charging.world"
    click autodock_sim/worlds/tb3_charging.world "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_sim/worlds/tb3_charging.world"
    click Models "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/tree/main/autodock_sim/models/"

    click autodock_examples/ "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/tree/main/autodock_examples/"
    click Config1 "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_examples/configs/mock_robot.yaml"
    click Config2 "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_examples/configs/turtlebot3.yaml"
    click RViz1 "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_examples/rviz/default.rviz"
    click RViz2 "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_examples/rviz/tb3_nav.rviz"
    click Test1 "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_examples/scripts/dock_robot_test.py"
    click Test2 "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/blob/main/autodock_examples/scripts/dock_sim_test.py"

    click Dockerfile "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/tree/main/Dockerfile"
    click Docs "https://github.com/arghyachatterjee/autonomous-docking-for-mobile-robots/tree/main/docs/"

    %% Styles
    classDef core fill:#D0E6FF,stroke:#0366d6,color:#0366d6
    classDef sim fill:#DFFFE0,stroke:#28a745,color:#22863a
    classDef external fill:#FFE6CC,stroke:#d73a49,color:#bd2c00
    classDef optional fill:#F0F0F0,stroke:#6a737d,color:#586069
```
