mini-quadlib 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mini_quadlib-0.1.2/LICENSE +21 -0
- mini_quadlib-0.1.2/MANIFEST.in +11 -0
- mini_quadlib-0.1.2/PKG-INFO +253 -0
- mini_quadlib-0.1.2/README.md +217 -0
- mini_quadlib-0.1.2/mini_quadlib/__init__.py +16 -0
- mini_quadlib-0.1.2/mini_quadlib/core.py +808 -0
- mini_quadlib-0.1.2/mini_quadlib/libmini_quadlib.so +0 -0
- mini_quadlib-0.1.2/mini_quadlib/py.typed +1 -0
- mini_quadlib-0.1.2/mini_quadlib.egg-info/PKG-INFO +253 -0
- mini_quadlib-0.1.2/mini_quadlib.egg-info/SOURCES.txt +18 -0
- mini_quadlib-0.1.2/mini_quadlib.egg-info/dependency_links.txt +1 -0
- mini_quadlib-0.1.2/mini_quadlib.egg-info/requires.txt +7 -0
- mini_quadlib-0.1.2/mini_quadlib.egg-info/top_level.txt +1 -0
- mini_quadlib-0.1.2/pyproject.toml +87 -0
- mini_quadlib-0.1.2/setup.cfg +4 -0
- mini_quadlib-0.1.2/setup.py +7 -0
- mini_quadlib-0.1.2/tests/test_python_api.py +717 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sigma Pi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Include documentation and license
|
|
2
|
+
include ../README.md
|
|
3
|
+
include ../LICENSE
|
|
4
|
+
|
|
5
|
+
# Include shared library
|
|
6
|
+
include mini_quadlib/*.so
|
|
7
|
+
include mini_quadlib/libmini_quadlib.so
|
|
8
|
+
recursive-include mini_quadlib *.so
|
|
9
|
+
|
|
10
|
+
# Include type hints marker
|
|
11
|
+
include mini_quadlib/py.typed
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mini-quadlib
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Python bindings for mini-quadlib: A lightweight C library for quadrotor control
|
|
5
|
+
Author-email: Chengyu Yang <chengyuy520@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/sigma-pi/mini-quadlib
|
|
8
|
+
Project-URL: Repository, https://github.com/sigma-pi/mini-quadlib
|
|
9
|
+
Project-URL: Documentation, https://github.com/sigma-pi/mini-quadlib#readme
|
|
10
|
+
Project-URL: Issues, https://github.com/sigma-pi/mini-quadlib/issues
|
|
11
|
+
Keywords: robotics,quadrotor,drone,control,aerospace,geometric-control,L1-adaptive
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: C
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
26
|
+
Requires-Python: >=3.8
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: numpy>=1.19.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
33
|
+
Requires-Dist: black; extra == "dev"
|
|
34
|
+
Requires-Dist: flake8; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# Mini-QuadLib
|
|
38
|
+
|
|
39
|
+
A lightweight C library for quadrotor control systems, with Python bindings.
|
|
40
|
+
|
|
41
|
+
[](https://opensource.org/licenses/MIT)
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- **Geometric Controller** - SE(3) geometric control for quadrotors
|
|
46
|
+
- **L1 Adaptive Control** - Robust adaptive augmentation for disturbance rejection
|
|
47
|
+
- **Robotics Utilities** - Coordinate transforms, frame conversions, rotation representations
|
|
48
|
+
- **Lightweight** - Requires minimal dependencies
|
|
49
|
+
- **Cross-platform** - C library works anywhere, Python bindings for Linux
|
|
50
|
+
|
|
51
|
+
## Repository Structure
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
mini-quadlib/
|
|
55
|
+
├── include/
|
|
56
|
+
│ └── mini_quadlib.h # Main C header (all API documentation here)
|
|
57
|
+
├── src/
|
|
58
|
+
│ └── *.c # C implementation
|
|
59
|
+
├── python/
|
|
60
|
+
│ └── mini_quadlib/ # Python package
|
|
61
|
+
├── build/ # Build output (generated)
|
|
62
|
+
├── CMakeLists.txt
|
|
63
|
+
└── README.md
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## C Library
|
|
69
|
+
|
|
70
|
+
### Building (Linux)
|
|
71
|
+
|
|
72
|
+
#### Prerequisites
|
|
73
|
+
|
|
74
|
+
- CMake >= 3.8
|
|
75
|
+
- GCC or Clang
|
|
76
|
+
|
|
77
|
+
#### Build Static Library
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Clone the repository
|
|
81
|
+
git clone https://github.com/sigma-pi/mini-quadlib.git
|
|
82
|
+
cd mini-quadlib
|
|
83
|
+
|
|
84
|
+
# Create build directory
|
|
85
|
+
mkdir build && cd build
|
|
86
|
+
|
|
87
|
+
# Configure and build
|
|
88
|
+
cmake ..
|
|
89
|
+
make -j$(nproc)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This produces:
|
|
93
|
+
- `build/libmini_quadlib.a` - Static library
|
|
94
|
+
|
|
95
|
+
#### Build Shared Library (for Python bindings)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Create a virtual environment before building
|
|
99
|
+
conda create --name mini_quadlib
|
|
100
|
+
conda activate mini_quadlib
|
|
101
|
+
|
|
102
|
+
# Build
|
|
103
|
+
cd /path/to/mini-quadlib
|
|
104
|
+
mkdir -p build && cd build
|
|
105
|
+
cmake .. -DBUILD_PYTHON=ON
|
|
106
|
+
make -j$(nproc)
|
|
107
|
+
|
|
108
|
+
# Copy .so to package directory
|
|
109
|
+
cp libmini_quadlib.so ../python/mini_quadlib/
|
|
110
|
+
|
|
111
|
+
# Install
|
|
112
|
+
cd ../python
|
|
113
|
+
pip install -e .
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
This produces:
|
|
117
|
+
- `build/libmini_quadlib.so` - Shared library
|
|
118
|
+
|
|
119
|
+
### Using the C Library
|
|
120
|
+
|
|
121
|
+
#### Include in Your Project
|
|
122
|
+
|
|
123
|
+
```c
|
|
124
|
+
#include "mini_quadlib.h"
|
|
125
|
+
|
|
126
|
+
int main() {
|
|
127
|
+
// Get library version
|
|
128
|
+
printf("mini-quadlib version: %s\n", quadlib_version());
|
|
129
|
+
|
|
130
|
+
// Create state and setpoint
|
|
131
|
+
state_t current_state = {
|
|
132
|
+
.pos = {0.0f, 0.0f, 0.0f},
|
|
133
|
+
.vel = {0.0f, 0.0f, 0.0f},
|
|
134
|
+
.quat = {1.0f, 0.0f, 0.0f, 0.0f}, // w, x, y, z
|
|
135
|
+
.omega = {0.0f, 0.0f, 0.0f}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
setpoint_t desired = {
|
|
139
|
+
.pos = {1.0f, 0.0f, -1.0f}, // NED frame
|
|
140
|
+
.vel = {0.0f, 0.0f, 0.0f},
|
|
141
|
+
.acc = {0.0f, 0.0f, 0.0f},
|
|
142
|
+
.jerk = {0.0f, 0.0f, 0.0f},
|
|
143
|
+
.snap = {0.0f, 0.0f, 0.0f},
|
|
144
|
+
.yaw = 0.0f,
|
|
145
|
+
.yaw_dot = 0.0f,
|
|
146
|
+
.yaw_ddot = 0.0f
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// Controller parameters
|
|
150
|
+
geometric_params_t ctrl_params = {
|
|
151
|
+
.k_p = {1.0f, 1.0f, 2.0f},
|
|
152
|
+
.k_v = {0.5f, 0.5f, 1.0f},
|
|
153
|
+
.k_R = {1.0f, 1.0f, 1.0f},
|
|
154
|
+
.k_W = {0.1f, 0.1f, 0.1f}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
quadx_params_t quad_params = {
|
|
158
|
+
.mass = 1.0f,
|
|
159
|
+
.inertia = {0.01f, 0.01f, 0.02f}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// Compute control
|
|
163
|
+
control_4f_t output;
|
|
164
|
+
quadlib_result_t result = geometric_control_fM_fullparam(
|
|
165
|
+
&output, ¤t_state, &desired, &ctrl_params, &quad_params
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
if (result == QUADLIB_SUCCESS) {
|
|
169
|
+
printf("Thrust: %.2f, Moments: [%.2f, %.2f, %.2f]\n",
|
|
170
|
+
output.u1, output.u2, output.u3, output.u4);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return 0;
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### Compile Your Program
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
gcc -I/path/to/mini-quadlib/include \
|
|
181
|
+
-L/path/to/mini-quadlib/build \
|
|
182
|
+
your_program.c -lmini_quadlib -lm -o your_program
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### C API Reference
|
|
186
|
+
|
|
187
|
+
All C API documentation is in the header file:
|
|
188
|
+
|
|
189
|
+
📖 **[include/mini_quadlib.h](include/mini_quadlib.h)**
|
|
190
|
+
|
|
191
|
+
Key sections:
|
|
192
|
+
- **Data Structures** - `vector3f_t`, `quaternion4f_t`, `state_t`, `setpoint_t`, etc.
|
|
193
|
+
- **Geometric Control** - `geometric_control_fM_fullparam()`
|
|
194
|
+
- **L1 Adaptive Control** - `l1_adaptive_control_fullparam()`
|
|
195
|
+
- **Coordinate Transforms** - `enu_to_ned()`, `ned_to_enu()`, `coordinate_transform_omni()`
|
|
196
|
+
- **Rotation Utilities** - Quaternion/Euler/RotationMatrix conversions
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Python Bindings
|
|
201
|
+
|
|
202
|
+
### Quick Install (from source)
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
cd mini-quadlib
|
|
206
|
+
|
|
207
|
+
# Build C library first
|
|
208
|
+
mkdir build && cd build
|
|
209
|
+
cmake .. -DBUILD_PYTHON=ON
|
|
210
|
+
make -j$(nproc)
|
|
211
|
+
cd ..
|
|
212
|
+
|
|
213
|
+
# Install Python package
|
|
214
|
+
cd python
|
|
215
|
+
pip install -e .
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Run Basic Tests
|
|
219
|
+
```bash
|
|
220
|
+
python ./python/tests/test_python_api.py
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Quick Test
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
import mini_quadlib as mql
|
|
227
|
+
import numpy as np
|
|
228
|
+
|
|
229
|
+
print(f"Version: {mql.get_version()}")
|
|
230
|
+
|
|
231
|
+
# Create a quaternion
|
|
232
|
+
q = mql.Quaternion(0.707, 0.0, 0.0, 0.707)
|
|
233
|
+
print(f"Quaternion: {q}")
|
|
234
|
+
|
|
235
|
+
# Coordinate transform
|
|
236
|
+
ned = np.array([1.0, 2.0, 3.0])
|
|
237
|
+
enu = mql.ned_to_enu(ned)
|
|
238
|
+
print(f"NED {ned} -> ENU {enu}")
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
For detailed Python documentation, see:
|
|
242
|
+
|
|
243
|
+
📖 **[python/README.md](python/README.md)**
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
250
|
+
|
|
251
|
+
## Author
|
|
252
|
+
|
|
253
|
+
Chengyu Yang (chengyuy520@gmail.com)
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Mini-QuadLib
|
|
2
|
+
|
|
3
|
+
A lightweight C library for quadrotor control systems, with Python bindings.
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Geometric Controller** - SE(3) geometric control for quadrotors
|
|
10
|
+
- **L1 Adaptive Control** - Robust adaptive augmentation for disturbance rejection
|
|
11
|
+
- **Robotics Utilities** - Coordinate transforms, frame conversions, rotation representations
|
|
12
|
+
- **Lightweight** - Requires minimal dependencies
|
|
13
|
+
- **Cross-platform** - C library works anywhere, Python bindings for Linux
|
|
14
|
+
|
|
15
|
+
## Repository Structure
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
mini-quadlib/
|
|
19
|
+
├── include/
|
|
20
|
+
│ └── mini_quadlib.h # Main C header (all API documentation here)
|
|
21
|
+
├── src/
|
|
22
|
+
│ └── *.c # C implementation
|
|
23
|
+
├── python/
|
|
24
|
+
│ └── mini_quadlib/ # Python package
|
|
25
|
+
├── build/ # Build output (generated)
|
|
26
|
+
├── CMakeLists.txt
|
|
27
|
+
└── README.md
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## C Library
|
|
33
|
+
|
|
34
|
+
### Building (Linux)
|
|
35
|
+
|
|
36
|
+
#### Prerequisites
|
|
37
|
+
|
|
38
|
+
- CMake >= 3.8
|
|
39
|
+
- GCC or Clang
|
|
40
|
+
|
|
41
|
+
#### Build Static Library
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Clone the repository
|
|
45
|
+
git clone https://github.com/sigma-pi/mini-quadlib.git
|
|
46
|
+
cd mini-quadlib
|
|
47
|
+
|
|
48
|
+
# Create build directory
|
|
49
|
+
mkdir build && cd build
|
|
50
|
+
|
|
51
|
+
# Configure and build
|
|
52
|
+
cmake ..
|
|
53
|
+
make -j$(nproc)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This produces:
|
|
57
|
+
- `build/libmini_quadlib.a` - Static library
|
|
58
|
+
|
|
59
|
+
#### Build Shared Library (for Python bindings)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Create a virtual environment before building
|
|
63
|
+
conda create --name mini_quadlib
|
|
64
|
+
conda activate mini_quadlib
|
|
65
|
+
|
|
66
|
+
# Build
|
|
67
|
+
cd /path/to/mini-quadlib
|
|
68
|
+
mkdir -p build && cd build
|
|
69
|
+
cmake .. -DBUILD_PYTHON=ON
|
|
70
|
+
make -j$(nproc)
|
|
71
|
+
|
|
72
|
+
# Copy .so to package directory
|
|
73
|
+
cp libmini_quadlib.so ../python/mini_quadlib/
|
|
74
|
+
|
|
75
|
+
# Install
|
|
76
|
+
cd ../python
|
|
77
|
+
pip install -e .
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This produces:
|
|
81
|
+
- `build/libmini_quadlib.so` - Shared library
|
|
82
|
+
|
|
83
|
+
### Using the C Library
|
|
84
|
+
|
|
85
|
+
#### Include in Your Project
|
|
86
|
+
|
|
87
|
+
```c
|
|
88
|
+
#include "mini_quadlib.h"
|
|
89
|
+
|
|
90
|
+
int main() {
|
|
91
|
+
// Get library version
|
|
92
|
+
printf("mini-quadlib version: %s\n", quadlib_version());
|
|
93
|
+
|
|
94
|
+
// Create state and setpoint
|
|
95
|
+
state_t current_state = {
|
|
96
|
+
.pos = {0.0f, 0.0f, 0.0f},
|
|
97
|
+
.vel = {0.0f, 0.0f, 0.0f},
|
|
98
|
+
.quat = {1.0f, 0.0f, 0.0f, 0.0f}, // w, x, y, z
|
|
99
|
+
.omega = {0.0f, 0.0f, 0.0f}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
setpoint_t desired = {
|
|
103
|
+
.pos = {1.0f, 0.0f, -1.0f}, // NED frame
|
|
104
|
+
.vel = {0.0f, 0.0f, 0.0f},
|
|
105
|
+
.acc = {0.0f, 0.0f, 0.0f},
|
|
106
|
+
.jerk = {0.0f, 0.0f, 0.0f},
|
|
107
|
+
.snap = {0.0f, 0.0f, 0.0f},
|
|
108
|
+
.yaw = 0.0f,
|
|
109
|
+
.yaw_dot = 0.0f,
|
|
110
|
+
.yaw_ddot = 0.0f
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// Controller parameters
|
|
114
|
+
geometric_params_t ctrl_params = {
|
|
115
|
+
.k_p = {1.0f, 1.0f, 2.0f},
|
|
116
|
+
.k_v = {0.5f, 0.5f, 1.0f},
|
|
117
|
+
.k_R = {1.0f, 1.0f, 1.0f},
|
|
118
|
+
.k_W = {0.1f, 0.1f, 0.1f}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
quadx_params_t quad_params = {
|
|
122
|
+
.mass = 1.0f,
|
|
123
|
+
.inertia = {0.01f, 0.01f, 0.02f}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// Compute control
|
|
127
|
+
control_4f_t output;
|
|
128
|
+
quadlib_result_t result = geometric_control_fM_fullparam(
|
|
129
|
+
&output, ¤t_state, &desired, &ctrl_params, &quad_params
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
if (result == QUADLIB_SUCCESS) {
|
|
133
|
+
printf("Thrust: %.2f, Moments: [%.2f, %.2f, %.2f]\n",
|
|
134
|
+
output.u1, output.u2, output.u3, output.u4);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return 0;
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### Compile Your Program
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
gcc -I/path/to/mini-quadlib/include \
|
|
145
|
+
-L/path/to/mini-quadlib/build \
|
|
146
|
+
your_program.c -lmini_quadlib -lm -o your_program
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### C API Reference
|
|
150
|
+
|
|
151
|
+
All C API documentation is in the header file:
|
|
152
|
+
|
|
153
|
+
📖 **[include/mini_quadlib.h](include/mini_quadlib.h)**
|
|
154
|
+
|
|
155
|
+
Key sections:
|
|
156
|
+
- **Data Structures** - `vector3f_t`, `quaternion4f_t`, `state_t`, `setpoint_t`, etc.
|
|
157
|
+
- **Geometric Control** - `geometric_control_fM_fullparam()`
|
|
158
|
+
- **L1 Adaptive Control** - `l1_adaptive_control_fullparam()`
|
|
159
|
+
- **Coordinate Transforms** - `enu_to_ned()`, `ned_to_enu()`, `coordinate_transform_omni()`
|
|
160
|
+
- **Rotation Utilities** - Quaternion/Euler/RotationMatrix conversions
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Python Bindings
|
|
165
|
+
|
|
166
|
+
### Quick Install (from source)
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
cd mini-quadlib
|
|
170
|
+
|
|
171
|
+
# Build C library first
|
|
172
|
+
mkdir build && cd build
|
|
173
|
+
cmake .. -DBUILD_PYTHON=ON
|
|
174
|
+
make -j$(nproc)
|
|
175
|
+
cd ..
|
|
176
|
+
|
|
177
|
+
# Install Python package
|
|
178
|
+
cd python
|
|
179
|
+
pip install -e .
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Run Basic Tests
|
|
183
|
+
```bash
|
|
184
|
+
python ./python/tests/test_python_api.py
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Quick Test
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
import mini_quadlib as mql
|
|
191
|
+
import numpy as np
|
|
192
|
+
|
|
193
|
+
print(f"Version: {mql.get_version()}")
|
|
194
|
+
|
|
195
|
+
# Create a quaternion
|
|
196
|
+
q = mql.Quaternion(0.707, 0.0, 0.0, 0.707)
|
|
197
|
+
print(f"Quaternion: {q}")
|
|
198
|
+
|
|
199
|
+
# Coordinate transform
|
|
200
|
+
ned = np.array([1.0, 2.0, 3.0])
|
|
201
|
+
enu = mql.ned_to_enu(ned)
|
|
202
|
+
print(f"NED {ned} -> ENU {enu}")
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
For detailed Python documentation, see:
|
|
206
|
+
|
|
207
|
+
📖 **[python/README.md](python/README.md)**
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
214
|
+
|
|
215
|
+
## Author
|
|
216
|
+
|
|
217
|
+
Chengyu Yang (chengyuy520@gmail.com)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Mini-QuadLib Python Bindings - Complete C API Coverage
|
|
3
|
+
|
|
4
|
+
A comprehensive Python wrapper for the mini-quadlib C library providing
|
|
5
|
+
almost all C API functions with minimal abstraction.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
# Import everything from core
|
|
9
|
+
from .core import *
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.2"
|
|
12
|
+
__author__ = "Chengyu Yang"
|
|
13
|
+
__email__ = "chengyuy520@gmail.com"
|
|
14
|
+
|
|
15
|
+
# Re-export everything for convenience
|
|
16
|
+
# (Everything is already imported via "from .core import *")
|