# team-jax/jax_v2 architecture

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

- Interactive diagram: https://gitdiagram.com/team-jax/jax_v2
- Repository: https://github.com/team-jax/jax_v2

## Overview

JAX v2 is a ROS 2 robot-arm stack for locating, grasping, lifting, and placing a desk cube, with simulation and real-hardware modes controlled through a browser dashboard. The user selects an action in the dashboard; robot services initialize the arm or run the grasp action, which uses vision and the ROS-free motion policy before sending targets through device nodes and CAN. The README documents the major subsystems and workflow; several internal links below are therefore documented relationships, not claims that unsampled source was inspected.

Main entry points: [`src/jax_policy/jax_policy/chain.py`](https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/chain.py) (Grasp motion chain), [`src/jax_robot/jax_robot/robot_service.py`](https://github.com/team-jax/jax_v2/blob/main/src/jax_robot/jax_robot/robot_service.py) (Grasp action), [`src/jax_devices/jax_devices/device_node.py`](https://github.com/team-jax/jax_v2/blob/main/src/jax_devices/jax_devices/device_node.py) (Motor device nodes), [`src/jax_vision/jax_vision/vision_node.py`](https://github.com/team-jax/jax_v2/blob/main/src/jax_vision/jax_vision/vision_node.py) (Cube vision)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Operator interface"]
  node_dashboard["Web dashboard<br/>[app.js]"]
  node_web_backend["Web server<br/>[web_node.py]"]
  node_web_actions["Commands and state<br/>[commands.py]"]
  node_web_views["3D and reach views<br/>[view3d.js]"]
end

subgraph group_perception["Perception and models"]
  node_vision["Cube vision<br/>[vision_node.py]"]
  node_vision_detect["Marker detection<br/>[detect.py]"]
  node_description["Robot description"]
  node_camera["RealSense camera"]
end

subgraph group_motion["Robot control"]
  node_init_service["Arm initialization<br/>[init_service.py]"]
  node_robot_service["Grasp action<br/>[robot_service.py]"]
  node_grasp_logic["Grasp coordination<br/>[grasp_logic.py]"]
  node_policy_chain["Grasp motion chain<br/>[chain.py]"]
  node_policy_grasp["Grasp and lift IK<br/>[grasp.py]"]
  node_policy_raise["Raise path<br/>[raise_path.py]"]
  node_policy_table["Table-height shift<br/>[table_shift.py]"]
  node_policy_tables[("Deployment tables<br/>[tables.py]")]
  node_policy_policy["Learned policy<br/>[policy.py]"]
end

subgraph group_hardware["Hardware and simulation"]
  node_devices["Motor device nodes<br/>[device_node.py]"]
  node_device_core["Device conversion<br/>[core.py]"]
  node_can["CAN transport<br/>[can_node.cpp]"]
  node_protocol["CAN protocol<br/>[protocol.hpp]"]
  node_sim["MuJoCo simulator<br/>[sim_node.py]"]
  node_sim_world["Physics world<br/>[world.py]"]
  node_real_robot[("Real robot")]
end

subgraph group_platform["ROS platform"]
  node_joint_table["Joint mapping<br/>[joints.py]"]
  node_preset["Servo presets<br/>[preset.py]"]
  node_bringup["Mode launch<br/>[robot.launch.py]"]
end

node_operator(("Operator"))

node_operator -->|"selects actions"| node_dashboard
node_dashboard -->|"sends commands"| node_web_backend
node_web_backend -->|"uses command handlers"| node_web_actions
node_web_backend -->|"starts grasp action"| node_robot_service
node_web_backend -->|"calls Init"| node_init_service
node_dashboard -->|"renders view"| node_web_views
node_init_service -->|"loads mappings"| node_joint_table
node_init_service -->|"sets presets"| node_preset
node_init_service -->|"checks devices"| node_devices
node_robot_service -->|"delegates grasp"| node_grasp_logic
node_robot_service -->|"steps chain"| node_policy_chain
node_robot_service -->|"sends targets"| node_devices
node_robot_service -->|"uses cube pose"| node_vision
node_policy_chain -->|"uses grasp motion"| node_policy_grasp
node_policy_chain -->|"uses raise path"| node_policy_raise
node_policy_chain -->|"wraps for table height"| node_policy_table
node_policy_chain -->|"queries reach tables"| node_policy_tables
node_policy_chain -->|"uses learned policy"| node_policy_policy
node_vision -->|"detects markers"| node_vision_detect
node_vision -->|"receives images"| node_camera
node_vision -->|"publishes cube pose"| node_robot_service
node_description -->|"reads mount arguments"| node_joint_table
node_devices -->|"converts commands"| node_device_core
node_devices -->|"loads mappings"| node_joint_table
node_devices -->|"reads servo zeros"| node_preset
node_devices -->|"sends motor commands"| node_can
node_can -->|"encodes frames"| node_protocol
node_can -->|"controls over SocketCAN"| node_real_robot
node_bringup -->|"starts real CAN mode"| node_can
node_bringup -->|"starts camera driver"| node_camera
node_bringup -->|"starts simulation mode"| node_sim
node_sim -->|"steps physics"| node_sim_world
node_sim -->|"feeds virtual CAN"| node_can
node_sim -->|"publishes camera topics"| node_vision

click node_dashboard "https://github.com/team-jax/jax_v2/blob/main/src/jax_web/jax_web/static/app.js"
click node_web_backend "https://github.com/team-jax/jax_v2/blob/main/src/jax_web/jax_web/web_node.py"
click node_web_actions "https://github.com/team-jax/jax_v2/blob/main/src/jax_web/jax_web/commands.py"
click node_web_views "https://github.com/team-jax/jax_v2/blob/main/src/jax_web/jax_web/static/view3d.js"
click node_init_service "https://github.com/team-jax/jax_v2/blob/main/src/jax_robot/jax_robot/init_service.py"
click node_robot_service "https://github.com/team-jax/jax_v2/blob/main/src/jax_robot/jax_robot/robot_service.py"
click node_grasp_logic "https://github.com/team-jax/jax_v2/blob/main/src/jax_robot/jax_robot/grasp_logic.py"
click node_policy_chain "https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/chain.py"
click node_policy_grasp "https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/grasp.py"
click node_policy_raise "https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/raise_path.py"
click node_policy_table "https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/table_shift.py"
click node_policy_tables "https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/tables.py"
click node_policy_policy "https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/policy.py"
click node_vision "https://github.com/team-jax/jax_v2/blob/main/src/jax_vision/jax_vision/vision_node.py"
click node_vision_detect "https://github.com/team-jax/jax_v2/blob/main/src/jax_vision/jax_vision/detect.py"
click node_description "https://github.com/team-jax/jax_v2/blob/main/src/jax_description/launch/description.launch.py"
click node_joint_table "https://github.com/team-jax/jax_v2/blob/main/src/jax_common/jax_common/joints.py"
click node_preset "https://github.com/team-jax/jax_v2/blob/main/src/jax_common/jax_common/preset.py"
click node_devices "https://github.com/team-jax/jax_v2/blob/main/src/jax_devices/jax_devices/device_node.py"
click node_device_core "https://github.com/team-jax/jax_v2/blob/main/src/jax_devices/jax_devices/core.py"
click node_can "https://github.com/team-jax/jax_v2/blob/main/src/jax_can/src/can_node.cpp"
click node_protocol "https://github.com/team-jax/jax_v2/blob/main/src/jax_can/include/jax_can/protocol.hpp"
click node_sim "https://github.com/team-jax/jax_v2/blob/main/src/jax_sim/jax_sim/sim_node.py"
click node_sim_world "https://github.com/team-jax/jax_v2/blob/main/src/jax_sim/jax_sim/world.py"
click node_bringup "https://github.com/team-jax/jax_v2/blob/main/src/jax_bringup/launch/robot.launch.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_dashboard,node_web_backend,node_web_actions,node_web_views toneBlue
class node_vision,node_vision_detect,node_description,node_camera toneAmber
class node_init_service,node_robot_service,node_grasp_logic,node_policy_chain,node_policy_grasp,node_policy_raise,node_policy_table,node_policy_tables,node_policy_policy toneMint
class node_devices,node_device_core,node_can,node_protocol,node_sim,node_sim_world,node_real_robot toneRose
class node_joint_table,node_preset,node_bringup,node_operator toneIndigo
```

## Components

### Operator interface

- [Web dashboard](https://github.com/team-jax/jax_v2/blob/main/src/jax_web/jax_web/static/app.js): `src/jax_web/jax_web/static/app.js`
- [Web server](https://github.com/team-jax/jax_v2/blob/main/src/jax_web/jax_web/web_node.py): `src/jax_web/jax_web/web_node.py`
- [Commands and state](https://github.com/team-jax/jax_v2/blob/main/src/jax_web/jax_web/commands.py): `src/jax_web/jax_web/commands.py`
- [3D and reach views](https://github.com/team-jax/jax_v2/blob/main/src/jax_web/jax_web/static/view3d.js): `src/jax_web/jax_web/static/view3d.js`

### Perception and models

- [Cube vision](https://github.com/team-jax/jax_v2/blob/main/src/jax_vision/jax_vision/vision_node.py): `src/jax_vision/jax_vision/vision_node.py`
- [Marker detection](https://github.com/team-jax/jax_v2/blob/main/src/jax_vision/jax_vision/detect.py): `src/jax_vision/jax_vision/detect.py`
- [Robot description](https://github.com/team-jax/jax_v2/blob/main/src/jax_description/launch/description.launch.py): `src/jax_description/launch/description.launch.py`
- **RealSense camera**

### Robot control

- [Arm initialization](https://github.com/team-jax/jax_v2/blob/main/src/jax_robot/jax_robot/init_service.py): `src/jax_robot/jax_robot/init_service.py`
- [Grasp action](https://github.com/team-jax/jax_v2/blob/main/src/jax_robot/jax_robot/robot_service.py): `src/jax_robot/jax_robot/robot_service.py`
- [Grasp coordination](https://github.com/team-jax/jax_v2/blob/main/src/jax_robot/jax_robot/grasp_logic.py): `src/jax_robot/jax_robot/grasp_logic.py`
- [Grasp motion chain](https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/chain.py): `src/jax_policy/jax_policy/chain.py`
- [Grasp and lift IK](https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/grasp.py): `src/jax_policy/jax_policy/grasp.py`
- [Raise path](https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/raise_path.py): `src/jax_policy/jax_policy/raise_path.py`
- [Table-height shift](https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/table_shift.py): `src/jax_policy/jax_policy/table_shift.py`
- [Deployment tables](https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/tables.py): `src/jax_policy/jax_policy/tables.py`
- [Learned policy](https://github.com/team-jax/jax_v2/blob/main/src/jax_policy/jax_policy/policy.py): `src/jax_policy/jax_policy/policy.py`

### Hardware and simulation

- [Motor device nodes](https://github.com/team-jax/jax_v2/blob/main/src/jax_devices/jax_devices/device_node.py): `src/jax_devices/jax_devices/device_node.py`
- [Device conversion](https://github.com/team-jax/jax_v2/blob/main/src/jax_devices/jax_devices/core.py): `src/jax_devices/jax_devices/core.py`
- [CAN transport](https://github.com/team-jax/jax_v2/blob/main/src/jax_can/src/can_node.cpp): `src/jax_can/src/can_node.cpp`
- [CAN protocol](https://github.com/team-jax/jax_v2/blob/main/src/jax_can/include/jax_can/protocol.hpp): `src/jax_can/include/jax_can/protocol.hpp`
- [MuJoCo simulator](https://github.com/team-jax/jax_v2/blob/main/src/jax_sim/jax_sim/sim_node.py): `src/jax_sim/jax_sim/sim_node.py`
- [Physics world](https://github.com/team-jax/jax_v2/blob/main/src/jax_sim/jax_sim/world.py): `src/jax_sim/jax_sim/world.py`
- **Real robot**

### ROS platform

- [Joint mapping](https://github.com/team-jax/jax_v2/blob/main/src/jax_common/jax_common/joints.py): `src/jax_common/jax_common/joints.py`
- [Servo presets](https://github.com/team-jax/jax_v2/blob/main/src/jax_common/jax_common/preset.py): `src/jax_common/jax_common/preset.py`
- [Mode launch](https://github.com/team-jax/jax_v2/blob/main/src/jax_bringup/launch/robot.launch.py): `src/jax_bringup/launch/robot.launch.py`

### Other components

- **Operator**

## Connections

- Operator → Web dashboard: selects actions (evidence: `README.md`)
- Web dashboard → Web server: sends commands (evidence: `src/jax_web/jax_web/static/app.js`)
- Web server → Commands and state: uses command handlers (evidence: `src/jax_web/jax_web/web_node.py`)
- Web server → Grasp action: starts grasp action (evidence: `src/jax_web/jax_web/web_node.py`)
- Web server → Arm initialization: calls Init (evidence: `README.md`)
- Web dashboard → 3D and reach views: renders view (evidence: `src/jax_web/jax_web/static/app.js`)
- Arm initialization → Joint mapping: loads mappings (evidence: `src/jax_robot/jax_robot/init_service.py`)
- Arm initialization → Servo presets: sets presets (evidence: `README.md`)
- Arm initialization → Motor device nodes: checks devices (evidence: `src/jax_robot/jax_robot/init_service.py`)
- Grasp action → Grasp coordination: delegates grasp (evidence: `src/jax_robot/jax_robot/robot_service.py`)
- Grasp action → Grasp motion chain: steps chain (evidence: `src/jax_robot/jax_robot/robot_service.py`)
- Grasp action → Motor device nodes: sends targets (evidence: `src/jax_robot/jax_robot/robot_service.py`)
- Grasp action → Cube vision: uses cube pose (evidence: `README.md`)
- Grasp motion chain → Grasp and lift IK: uses grasp motion (evidence: `src/jax_policy/jax_policy/chain.py`)
- Grasp motion chain → Raise path: uses raise path (evidence: `src/jax_policy/jax_policy/chain.py`)
- Grasp motion chain → Table-height shift: wraps for table height (evidence: `src/jax_policy/jax_policy/table_shift.py`)
- Grasp motion chain → Deployment tables: queries reach tables (evidence: `src/jax_policy/jax_policy/chain.py`)
- Grasp motion chain → Learned policy: uses learned policy (evidence: `src/jax_policy/jax_policy/chain.py`)
- Cube vision → Marker detection: detects markers
- Cube vision → RealSense camera: receives images (evidence: `README.md`)
- Cube vision → Grasp action: publishes cube pose (evidence: `README.md`)
- Robot description → Joint mapping: reads mount arguments (evidence: `src/jax_description/launch/description.launch.py`)
- Motor device nodes → Device conversion: converts commands (evidence: `src/jax_devices/jax_devices/device_node.py`)
- Motor device nodes → Joint mapping: loads mappings (evidence: `src/jax_devices/jax_devices/device_node.py`)
- Motor device nodes → Servo presets: reads servo zeros (evidence: `src/jax_devices/jax_devices/device_node.py`)
- Motor device nodes → CAN transport: sends motor commands (evidence: `src/jax_devices/jax_devices/device_node.py`)
- CAN transport → CAN protocol: encodes frames (evidence: `src/jax_can/src/can_node.cpp`)
- CAN transport → Real robot: controls over SocketCAN (evidence: `README.md`)
- Mode launch → CAN transport: starts real CAN mode (evidence: `README.md`)
- Mode launch → RealSense camera: starts camera driver (evidence: `README.md`)
- Mode launch → MuJoCo simulator: starts simulation mode (evidence: `README.md`)
- MuJoCo simulator → Physics world: steps physics (evidence: `src/jax_sim/jax_sim/sim_node.py`)
- MuJoCo simulator → CAN transport: feeds virtual CAN (evidence: `src/jax_sim/jax_sim/sim_node.py`)
- MuJoCo simulator → Cube vision: publishes camera topics (evidence: `src/jax_sim/jax_sim/sim_node.py`)
