# WriteState.srv ## Overview `WriteState.srv` requests that the Cartographer node serialize its full state to a file. This is used to persist a completed map for later reuse. ## Request | Field | Type | Description | | --- | --- | --- | | `filename` | `string` | The path of the file to write the state to. | | `include_unfinished_submaps` | `bool` | Whether to include submaps that are still being mapped. | ## Response | Field | Type | Description | | --- | --- | --- | | `status` | `cartographer_ros_msgs/StatusResponse` | The outcome of the request; check `code` against `StatusCode.OK`. | ## Usage - A typical workflow finishes all trajectories first, then calls this service with `include_unfinished_submaps` set to false. - The written file can be reused to initialize subsequent mapping sessions.