Skip to content

tesseract_robotics.tesseract_serialization

XML and binary serialization for root types. The backend switched from Boost.Serialization (0.33) to Cereal (0.34); the Python API is unchanged. See the Serialization User Guide for a walkthrough and the migration notes if you have 0.33 archives.

Free functions

Each supported type exposes paired to_* / from_* functions for the three archive formats:

Type XML Binary File (auto)
CompositeInstruction composite_instruction_to_xml / composite_instruction_from_xml composite_instruction_to_binary / composite_instruction_from_binary composite_instruction_to_file / composite_instruction_from_file
Environment environment_to_xml / environment_from_xml environment_to_binary / environment_from_binary environment_to_file / environment_from_file
SceneState scene_state_to_xml / scene_state_from_xml scene_state_to_binary / scene_state_from_binary scene_state_to_file / scene_state_from_file

The *_to_file / *_from_file helpers auto-detect the format from the path suffix (.xml vs .bin).

tesseract_robotics.tesseract_serialization

tesseract_serialization - persist motion programs and environments

Exposes Boost.Serialization for root types. Nested types (waypoints, instructions, geometry) are automatically handled by C++ recursive serialization.

Example

from tesseract_robotics.tesseract_serialization import ( composite_instruction_to_file, composite_instruction_from_file, )

Save planned trajectory

composite_instruction_to_file(program, "trajectory.xml")

Load next session

program = composite_instruction_from_file("trajectory.xml")

__all__ module-attribute

Python
__all__ = ['composite_instruction_to_xml', 'composite_instruction_from_xml', 'composite_instruction_to_file', 'composite_instruction_from_file', 'composite_instruction_to_binary', 'composite_instruction_from_binary', 'environment_to_xml', 'environment_from_xml', 'environment_to_file', 'environment_from_file', 'environment_to_binary', 'environment_from_binary', 'scene_state_to_xml', 'scene_state_from_xml', 'scene_state_to_file', 'scene_state_from_file', 'scene_state_to_binary', 'scene_state_from_binary']

composite_instruction_to_xml

Python
composite_instruction_to_xml(instruction: CompositeInstruction) -> str

Serialize CompositeInstruction to XML string. Recursively captures all waypoints, instructions, profiles, and nested composites.

composite_instruction_from_xml

Python
composite_instruction_from_xml(xml: str) -> tesseract_robotics.tesseract_command_language._tesseract_command_language.CompositeInstruction

Deserialize CompositeInstruction from XML string.

composite_instruction_to_file

Python
composite_instruction_to_file(instruction: CompositeInstruction, path: str) -> bool

Save CompositeInstruction to XML file.

composite_instruction_from_file

Python
composite_instruction_from_file(path: str) -> tesseract_robotics.tesseract_command_language._tesseract_command_language.CompositeInstruction

Load CompositeInstruction from XML file.

composite_instruction_to_binary

Python
composite_instruction_to_binary(instruction: CompositeInstruction) -> list[int]

Serialize CompositeInstruction to binary data (faster, smaller than XML).

composite_instruction_from_binary

Python
composite_instruction_from_binary(data: Sequence[int]) -> tesseract_robotics.tesseract_command_language._tesseract_command_language.CompositeInstruction

Deserialize CompositeInstruction from binary data.

environment_to_xml

Python
environment_to_xml(environment: Environment) -> str

Serialize Environment to XML string. Includes command history - on deserialize, commands are replayed to rebuild scene graph.

environment_from_xml

Python
environment_from_xml(xml: str) -> tesseract_robotics.tesseract_environment._tesseract_environment.Environment

Deserialize Environment from XML string. Returns shared_ptr.

environment_to_file

Python
environment_to_file(environment: Environment, path: str) -> bool

Save Environment to XML file.

environment_from_file

Python
environment_from_file(path: str) -> tesseract_robotics.tesseract_environment._tesseract_environment.Environment

Load Environment from XML file. Returns shared_ptr.

environment_to_binary

Python
environment_to_binary(environment: Environment) -> list[int]

Serialize Environment to binary data.

environment_from_binary

Python
environment_from_binary(data: Sequence[int]) -> tesseract_robotics.tesseract_environment._tesseract_environment.Environment

Deserialize Environment from binary data. Returns shared_ptr.

scene_state_to_xml

Python
scene_state_to_xml(state: SceneState) -> str

Serialize SceneState to XML string. Captures joint positions and link transforms.

scene_state_from_xml

Python
scene_state_from_xml(xml: str) -> tesseract_robotics.tesseract_state_solver._tesseract_state_solver.SceneState

Deserialize SceneState from XML string.

scene_state_to_file

Python
scene_state_to_file(state: SceneState, path: str) -> bool

Save SceneState to XML file.

scene_state_from_file

Python
scene_state_from_file(path: str) -> tesseract_robotics.tesseract_state_solver._tesseract_state_solver.SceneState

Load SceneState from XML file.

scene_state_to_binary

Python
scene_state_to_binary(state: SceneState) -> list[int]

Serialize SceneState to binary data.

scene_state_from_binary

Python
scene_state_from_binary(data: Sequence[int]) -> tesseract_robotics.tesseract_state_solver._tesseract_state_solver.SceneState

Deserialize SceneState from binary data.