# lar-unibo/dlo_manipulation_online_params architecture

> Architecture diagram of the GitHub repository lar-unibo/dlo_manipulation_online_params, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lar-unibo/dlo_manipulation_online_params
- Repository: https://github.com/lar-unibo/dlo_manipulation_online_params

## Overview

This repository implements a learned dynamics model for deformable linear object (DLO) manipulation. Its principal workflow is to provide an initial and target shape to a planner, which uses the model to optimize a manipulative action. In parallel, model parameters can be estimated by gradient optimization or grid search. Training preprocesses datasets and fits the model; prediction evaluates a saved checkpoint. The README documents analytical-model-generated training data and online shape control. Some subsystem links below are supported by imports in the source index rather than fully shown call sites.

Main entry points: [`dlo_manipulation/model.py`](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/model.py) (FCMul dynamics), [`dlo_manipulation/dataset.py`](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/dataset.py) (Dataset and samples), [`train.py`](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/train.py) (Model training), [`predict.py`](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/predict.py) (Prediction evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and normalization"]
  node_dataset["Dataset and samples<br/>[dataset.py]"]
end

subgraph group_modeling["Dynamics model"]
  node_training["Model training<br/>[train.py]"]
  node_dynamics["FCMul dynamics<br/>[model.py]"]
  node_model_utils["Action-centric scaling<br/>[utils.py]"]
  node_checkpoint["Model checkpoint<br/>[fcmul.pth]"]
  node_prediction["Prediction evaluation<br/>[predict.py]"]
end

subgraph group_control["Shape control"]
  node_planner["Shape planner<br/>[planner.py]"]
  node_action_finder["Gradient action search<br/>[action.py]"]
  node_params_planner["Action-parameter planner<br/>[planner_params.py]"]
  node_action_params["Parameter-aware action search<br/>[action_params.py]"]
end

subgraph group_estimation["Parameter estimation"]
  node_gradient_estimator["Gradient parameter estimation<br/>[params_gradient.py]"]
  node_grid_estimator["Grid parameter search<br/>[params_grid.py]"]
end

node_operator(("Researcher / operator"))
node_analytical["Analytical DLO data"]

node_analytical -->|"generates training data"| node_dataset
node_operator -.->|"provides dataset"| node_training
node_training -->|"loads samples"| node_dataset
node_training -->|"trains model"| node_dynamics
node_training -.->|"saves best model"| node_checkpoint
node_operator -.->|"provides shapes"| node_planner
node_planner -->|"requests action search"| node_action_finder
node_action_finder -->|"predicts shapes"| node_dynamics
node_action_finder -->|"loads and normalizes samples"| node_dataset
node_dynamics -->|"scales predictions"| node_model_utils
node_operator -.->|"requests parameterized plan"| node_params_planner
node_params_planner -->|"delegates action search"| node_action_params
node_action_params -->|"predicts shapes"| node_dynamics
node_action_params -->|"loads samples"| node_dataset
node_operator -.->|"requests online estimation"| node_gradient_estimator
node_gradient_estimator -->|"evaluates parameter candidates"| node_dynamics
node_gradient_estimator -->|"normalizes samples"| node_dataset
node_operator -.->|"requests parameter search"| node_grid_estimator
node_grid_estimator -->|"scores grid candidates"| node_dynamics
node_grid_estimator -->|"loads samples"| node_dataset
node_operator -.->|"requests evaluation"| node_prediction
node_prediction -->|"loads evaluation data"| node_dataset
node_prediction -->|"predicts shapes"| node_dynamics
node_prediction -->|"loads weights"| node_checkpoint

click node_dataset "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/dataset.py"
click node_training "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/train.py"
click node_dynamics "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/model.py"
click node_model_utils "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/utils.py"
click node_checkpoint "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/fcmul.pth"
click node_prediction "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/predict.py"
click node_planner "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/planner.py"
click node_action_finder "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/action.py"
click node_params_planner "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/planner_params.py"
click node_action_params "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/action_params.py"
click node_gradient_estimator "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/params_gradient.py"
click node_grid_estimator "https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/params_grid.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dataset toneBlue
class node_training,node_dynamics,node_model_utils,node_checkpoint,node_prediction toneAmber
class node_planner,node_action_finder,node_params_planner,node_action_params toneMint
class node_gradient_estimator,node_grid_estimator toneRose
class node_operator,node_analytical toneIndigo
```

## Components

### Data and normalization

- [Dataset and samples](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/dataset.py): `dlo_manipulation/dataset.py`

### Dynamics model

- [Model training](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/train.py): `train.py`
- [FCMul dynamics](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/model.py): `dlo_manipulation/model.py`
- [Action-centric scaling](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/utils.py): `dlo_manipulation/utils.py`
- [Model checkpoint](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/fcmul.pth): `fcmul.pth`
- [Prediction evaluation](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/predict.py): `predict.py`

### Shape control

- [Shape planner](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/planner.py): `dlo_manipulation/planner.py`
- [Gradient action search](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/action.py): `dlo_manipulation/action.py`
- [Action-parameter planner](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/planner_params.py): `dlo_manipulation/planner_params.py`
- [Parameter-aware action search](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/action_params.py): `dlo_manipulation/action_params.py`

### Parameter estimation

- [Gradient parameter estimation](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/params_gradient.py): `dlo_manipulation/params_gradient.py`
- [Grid parameter search](https://github.com/lar-unibo/dlo_manipulation_online_params/blob/main/dlo_manipulation/params_grid.py): `dlo_manipulation/params_grid.py`

### Other components

- **Researcher / operator**
- **Analytical DLO data**

## Connections

- Analytical DLO data → Dataset and samples: generates training data (evidence: `README.md`)
- Researcher / operator → Model training: provides dataset
- Model training → Dataset and samples: loads samples (evidence: `train.py`)
- Model training → FCMul dynamics: trains model (evidence: `train.py`)
- Model training → Model checkpoint: saves best model
- Researcher / operator → Shape planner: provides shapes
- Shape planner → Gradient action search: requests action search (evidence: `dlo_manipulation/planner.py`)
- Gradient action search → FCMul dynamics: predicts shapes (evidence: `dlo_manipulation/action.py`)
- Gradient action search → Dataset and samples: loads and normalizes samples (evidence: `dlo_manipulation/action.py`)
- FCMul dynamics → Action-centric scaling: scales predictions (evidence: `dlo_manipulation/model.py`)
- Researcher / operator → Action-parameter planner: requests parameterized plan
- Action-parameter planner → Parameter-aware action search: delegates action search (evidence: `dlo_manipulation/planner_params.py`)
- Parameter-aware action search → FCMul dynamics: predicts shapes (evidence: `dlo_manipulation/action_params.py`)
- Parameter-aware action search → Dataset and samples: loads samples (evidence: `dlo_manipulation/action_params.py`)
- Researcher / operator → Gradient parameter estimation: requests online estimation
- Gradient parameter estimation → FCMul dynamics: evaluates parameter candidates (evidence: `dlo_manipulation/params_gradient.py`)
- Gradient parameter estimation → Dataset and samples: normalizes samples (evidence: `dlo_manipulation/params_gradient.py`)
- Researcher / operator → Grid parameter search: requests parameter search
- Grid parameter search → FCMul dynamics: scores grid candidates (evidence: `dlo_manipulation/params_grid.py`)
- Grid parameter search → Dataset and samples: loads samples (evidence: `dlo_manipulation/params_grid.py`)
- Researcher / operator → Prediction evaluation: requests evaluation
- Prediction evaluation → Dataset and samples: loads evaluation data (evidence: `predict.py`)
- Prediction evaluation → FCMul dynamics: predicts shapes (evidence: `predict.py`)
- Prediction evaluation → Model checkpoint: loads weights (evidence: `predict.py`)
