Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 2 additions & 47 deletions cflib2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,51 +22,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""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"]
8 changes: 5 additions & 3 deletions cflib2/trajectory.py → cflib2/commander.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
#
# ,---------, ____ _ __
# | ,-^-, | / __ )(_) /_______________ _____ ___
# | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \
Expand All @@ -18,8 +20,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""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"]
27 changes: 27 additions & 0 deletions cflib2/console.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""Console subsystem types"""

from cflib2._rust import Console

__all__ = ["Console"]
59 changes: 59 additions & 0 deletions cflib2/error.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""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",
]
27 changes: 27 additions & 0 deletions cflib2/high_level_commander.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""High-level commander subsystem types"""

from cflib2._rust import HighLevelCommander

__all__ = ["HighLevelCommander"]
43 changes: 43 additions & 0 deletions cflib2/localization.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""Localization subsystem types"""

from cflib2._rust import (
EmergencyControl,
ExternalPose,
Lighthouse,
LighthouseAngleData,
LighthouseAngles,
Localization,
LocoPositioning,
)

__all__ = [
"EmergencyControl",
"ExternalPose",
"Lighthouse",
"LighthouseAngleData",
"LighthouseAngles",
"Localization",
"LocoPositioning",
]
27 changes: 27 additions & 0 deletions cflib2/log.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""Log subsystem types"""

from cflib2._rust import Log, LogBlock, LogData, LogStream

__all__ = ["Log", "LogBlock", "LogData", "LogStream"]
27 changes: 27 additions & 0 deletions cflib2/memory.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""Memory subsystem types"""

from cflib2._rust import CompressedSegment, CompressedStart, Memory, Poly, Poly4D

__all__ = ["CompressedSegment", "CompressedStart", "Memory", "Poly", "Poly4D"]
27 changes: 27 additions & 0 deletions cflib2/param.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""Parameter subsystem types"""

from cflib2._rust import Param, PersistentParamState

__all__ = ["Param", "PersistentParamState"]
27 changes: 27 additions & 0 deletions cflib2/platform.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""Platform subsystem types"""

from cflib2._rust import AppChannel, Platform

__all__ = ["AppChannel", "Platform"]
27 changes: 27 additions & 0 deletions cflib2/toc_cache.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""TOC cache types"""

from cflib2._rust import FileTocCache, InMemoryTocCache, NoTocCache

__all__ = ["FileTocCache", "InMemoryTocCache", "NoTocCache"]
3 changes: 2 additions & 1 deletion examples/swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/toc_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading