diff --git a/cflib2/__init__.py b/cflib2/__init__.py
index ec86bea..5fa176a 100644
--- a/cflib2/__init__.py
+++ b/cflib2/__init__.py
@@ -22,51 +22,6 @@
# along with this program. If not, see .
"""Crazyflie Python Library"""
-from cflib2._rust import (
- Crazyflie,
- LinkContext,
- # TOC cache classes (passed to Crazyflie.connect_from_uri)
- NoTocCache,
- InMemoryTocCache,
- FileTocCache,
- # Exceptions
- CrazyflieError,
- ProtocolVersionNotSupportedError,
- ProtocolError,
- ParamError,
- LogError,
- ConversionError,
- LinkError,
- DisconnectedError,
- VariableNotFoundError,
- SystemError,
- AppchannelPacketTooLargeError,
- InvalidArgumentError,
- TimeoutError,
- MemoryError,
- InvalidParameterError,
-)
+from cflib2._rust import Crazyflie, LinkContext
-__all__ = [
- "Crazyflie",
- "LinkContext",
- "NoTocCache",
- "InMemoryTocCache",
- "FileTocCache",
- # Exceptions
- "CrazyflieError",
- "ProtocolVersionNotSupportedError",
- "ProtocolError",
- "ParamError",
- "LogError",
- "ConversionError",
- "LinkError",
- "DisconnectedError",
- "VariableNotFoundError",
- "SystemError",
- "AppchannelPacketTooLargeError",
- "InvalidArgumentError",
- "TimeoutError",
- "MemoryError",
- "InvalidParameterError",
-]
+__all__ = ["Crazyflie", "LinkContext"]
diff --git a/cflib2/trajectory.py b/cflib2/commander.py
similarity index 82%
rename from cflib2/trajectory.py
rename to cflib2/commander.py
index cc13cf8..03d06b2 100644
--- a/cflib2/trajectory.py
+++ b/cflib2/commander.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+#
# ,---------, ____ _ __
# | ,-^-, | / __ )(_) /_______________ _____ ___
# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
@@ -18,8 +20,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-"""Trajectory building primitives for the Crazyflie"""
+"""Commander subsystem types"""
-from cflib2._rust import Poly, Poly4D, CompressedStart, CompressedSegment
+from cflib2._rust import Commander
-__all__ = ["Poly", "Poly4D", "CompressedStart", "CompressedSegment"]
+__all__ = ["Commander"]
diff --git a/cflib2/console.py b/cflib2/console.py
new file mode 100644
index 0000000..59f7781
--- /dev/null
+++ b/cflib2/console.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+#
+# ,---------, ____ _ __
+# | ,-^-, | / __ )(_) /_______________ _____ ___
+# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
+# | / ,--' | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
+# +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/
+#
+# Copyright (C) 2025 Bitcraze AB
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+"""Console subsystem types"""
+
+from cflib2._rust import Console
+
+__all__ = ["Console"]
diff --git a/cflib2/error.py b/cflib2/error.py
new file mode 100644
index 0000000..0706496
--- /dev/null
+++ b/cflib2/error.py
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+#
+# ,---------, ____ _ __
+# | ,-^-, | / __ )(_) /_______________ _____ ___
+# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
+# | / ,--' | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
+# +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/
+#
+# Copyright (C) 2025 Bitcraze AB
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+"""Crazyflie exception types"""
+
+from cflib2._rust import (
+ AppchannelPacketTooLargeError,
+ ConversionError,
+ CrazyflieError,
+ DisconnectedError,
+ InvalidArgumentError,
+ InvalidParameterError,
+ LinkError,
+ LogError,
+ MemoryError,
+ ParamError,
+ ProtocolError,
+ ProtocolVersionNotSupportedError,
+ SystemError,
+ TimeoutError,
+ VariableNotFoundError,
+)
+
+__all__ = [
+ "AppchannelPacketTooLargeError",
+ "ConversionError",
+ "CrazyflieError",
+ "DisconnectedError",
+ "InvalidArgumentError",
+ "InvalidParameterError",
+ "LinkError",
+ "LogError",
+ "MemoryError",
+ "ParamError",
+ "ProtocolError",
+ "ProtocolVersionNotSupportedError",
+ "SystemError",
+ "TimeoutError",
+ "VariableNotFoundError",
+]
diff --git a/cflib2/high_level_commander.py b/cflib2/high_level_commander.py
new file mode 100644
index 0000000..25462e7
--- /dev/null
+++ b/cflib2/high_level_commander.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+#
+# ,---------, ____ _ __
+# | ,-^-, | / __ )(_) /_______________ _____ ___
+# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
+# | / ,--' | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
+# +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/
+#
+# Copyright (C) 2025 Bitcraze AB
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+"""High-level commander subsystem types"""
+
+from cflib2._rust import HighLevelCommander
+
+__all__ = ["HighLevelCommander"]
diff --git a/cflib2/localization.py b/cflib2/localization.py
new file mode 100644
index 0000000..a8a41d3
--- /dev/null
+++ b/cflib2/localization.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+#
+# ,---------, ____ _ __
+# | ,-^-, | / __ )(_) /_______________ _____ ___
+# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
+# | / ,--' | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
+# +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/
+#
+# Copyright (C) 2025 Bitcraze AB
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+"""Localization subsystem types"""
+
+from cflib2._rust import (
+ EmergencyControl,
+ ExternalPose,
+ Lighthouse,
+ LighthouseAngleData,
+ LighthouseAngles,
+ Localization,
+ LocoPositioning,
+)
+
+__all__ = [
+ "EmergencyControl",
+ "ExternalPose",
+ "Lighthouse",
+ "LighthouseAngleData",
+ "LighthouseAngles",
+ "Localization",
+ "LocoPositioning",
+]
diff --git a/cflib2/log.py b/cflib2/log.py
new file mode 100644
index 0000000..c30100f
--- /dev/null
+++ b/cflib2/log.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+#
+# ,---------, ____ _ __
+# | ,-^-, | / __ )(_) /_______________ _____ ___
+# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
+# | / ,--' | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
+# +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/
+#
+# Copyright (C) 2025 Bitcraze AB
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+"""Log subsystem types"""
+
+from cflib2._rust import Log, LogBlock, LogData, LogStream
+
+__all__ = ["Log", "LogBlock", "LogData", "LogStream"]
diff --git a/cflib2/memory.py b/cflib2/memory.py
new file mode 100644
index 0000000..5d4b1a4
--- /dev/null
+++ b/cflib2/memory.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+#
+# ,---------, ____ _ __
+# | ,-^-, | / __ )(_) /_______________ _____ ___
+# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
+# | / ,--' | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
+# +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/
+#
+# Copyright (C) 2025 Bitcraze AB
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+"""Memory subsystem types"""
+
+from cflib2._rust import CompressedSegment, CompressedStart, Memory, Poly, Poly4D
+
+__all__ = ["CompressedSegment", "CompressedStart", "Memory", "Poly", "Poly4D"]
diff --git a/cflib2/param.py b/cflib2/param.py
new file mode 100644
index 0000000..e7f0874
--- /dev/null
+++ b/cflib2/param.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+#
+# ,---------, ____ _ __
+# | ,-^-, | / __ )(_) /_______________ _____ ___
+# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
+# | / ,--' | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
+# +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/
+#
+# Copyright (C) 2025 Bitcraze AB
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+"""Parameter subsystem types"""
+
+from cflib2._rust import Param, PersistentParamState
+
+__all__ = ["Param", "PersistentParamState"]
diff --git a/cflib2/platform.py b/cflib2/platform.py
new file mode 100644
index 0000000..6e1fa33
--- /dev/null
+++ b/cflib2/platform.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+#
+# ,---------, ____ _ __
+# | ,-^-, | / __ )(_) /_______________ _____ ___
+# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
+# | / ,--' | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
+# +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/
+#
+# Copyright (C) 2025 Bitcraze AB
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+"""Platform subsystem types"""
+
+from cflib2._rust import AppChannel, Platform
+
+__all__ = ["AppChannel", "Platform"]
diff --git a/cflib2/toc_cache.py b/cflib2/toc_cache.py
new file mode 100644
index 0000000..88b0585
--- /dev/null
+++ b/cflib2/toc_cache.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+#
+# ,---------, ____ _ __
+# | ,-^-, | / __ )(_) /_______________ _____ ___
+# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
+# | / ,--' | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
+# +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/
+#
+# Copyright (C) 2025 Bitcraze AB
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+"""TOC cache types"""
+
+from cflib2._rust import FileTocCache, InMemoryTocCache, NoTocCache
+
+__all__ = ["FileTocCache", "InMemoryTocCache", "NoTocCache"]
diff --git a/examples/swarm.py b/examples/swarm.py
index b705bd7..20e7c7b 100644
--- a/examples/swarm.py
+++ b/examples/swarm.py
@@ -40,7 +40,8 @@
import tyro
-from cflib2 import Crazyflie, LinkContext, FileTocCache, NoTocCache
+from cflib2 import Crazyflie, LinkContext
+from cflib2.toc_cache import FileTocCache, NoTocCache
@dataclass
diff --git a/examples/toc_cache.py b/examples/toc_cache.py
index 5515cfc..6c5a93a 100644
--- a/examples/toc_cache.py
+++ b/examples/toc_cache.py
@@ -49,7 +49,8 @@
import tyro
-from cflib2 import Crazyflie, LinkContext, NoTocCache, InMemoryTocCache, FileTocCache
+from cflib2 import Crazyflie, LinkContext
+from cflib2.toc_cache import FileTocCache, InMemoryTocCache, NoTocCache
@dataclass
diff --git a/examples/trajectory.py b/examples/trajectory.py
index fa75f78..5c4b18d 100644
--- a/examples/trajectory.py
+++ b/examples/trajectory.py
@@ -41,7 +41,7 @@
import tyro
from cflib2 import Crazyflie, LinkContext
-from cflib2.trajectory import Poly, Poly4D
+from cflib2.memory import Poly, Poly4D
# The trajectory to fly
# See https://github.com/whoenig/uav_trajectories for a tool to generate
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
index bf861c9..54be729 100644
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -20,10 +20,10 @@
# along with this program. If not, see .
import pytest
-import cflib2
+from cflib2 import error
-EXCEPTION_NAMES = [name for name in cflib2.__all__ if name.endswith("Error")]
+EXCEPTION_NAMES = [name for name in error.__all__ if name.endswith("Error")]
class TestExceptionHierarchy:
@@ -31,5 +31,5 @@ class TestExceptionHierarchy:
@pytest.mark.parametrize("name", EXCEPTION_NAMES)
def test_exception_is_subclass_of_crazyflie_error(self, name: str) -> None:
- exc_class = getattr(cflib2, name)
- assert issubclass(exc_class, cflib2.CrazyflieError)
+ exc_class = getattr(error, name)
+ assert issubclass(exc_class, error.CrazyflieError)