c4dynamics 2.2.0__tar.gz → 2.3.0__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.
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/PKG-INFO +1 -1
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/__init__.py +1 -1
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/detectors/yolo3_opencv.py +1 -1
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/filters/ekf.py +5 -5
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/filters/kalman.py +9 -9
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/states/lib/datapoint.py +1 -1
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/states/lib/rigidbody.py +2 -2
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/states/state.py +24 -21
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/const.py +4 -1
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/math.py +6 -1
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics.egg-info/PKG-INFO +1 -1
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/pyproject.toml +1 -1
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/setup.py +1 -1
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/LICENSE +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/README.md +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/datasets/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/datasets/_manager.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/datasets/_registry.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/detectors/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/envs/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/envs/mountain_car.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/eqm/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/eqm/derivs.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/eqm/integrate.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/filters/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/filters/lowpass.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/rotmat/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/rotmat/animate.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/rotmat/rotmat.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/sensors/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/sensors/lineofsight.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/sensors/radar.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/sensors/seeker.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/states/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/states/lib/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/states/lib/pixelpoint.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/__init__.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/_struct.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/cprint.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/gen_gif.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/idx2keys.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/images_loader.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/plottools.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/plottracks.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/printpts.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/slides_gen.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/tictoc.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/video_gen.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics/utils/vidgen.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics.egg-info/SOURCES.txt +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics.egg-info/dependency_links.txt +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics.egg-info/requires.txt +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/c4dynamics.egg-info/top_level.txt +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/setup.cfg +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_animate.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_const.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_cprint.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_datapoint.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_datasets.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_derivs.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_ekf.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_gen_gif.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_integrate.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_kalman.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_lowpass.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_math.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_pixelpoint.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_plotdefaults.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_radar.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_rigidbody.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_rotmat.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_seeker.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_state.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_state_assignment.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_state_assignment_strict.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_tictoc.py +0 -0
- {c4dynamics-2.2.0 → c4dynamics-2.3.0}/tests/test_yolov3_opencv.py +0 -0
|
@@ -168,7 +168,7 @@ class yolov3:
|
|
|
168
168
|
>>> def ptup(n): return '(' + str(n[0]) + ', ' + str(n[1]) + ')'
|
|
169
169
|
>>> print('{:^10} | {:^10} | {:^16} | {:^16} | {:^10} | {:^14}'.format('center x', 'center y', 'box top-left', 'box bottom-right', 'class', 'frame size')) # doctest: +IGNORE_OUTPUT
|
|
170
170
|
>>> for p in pts:
|
|
171
|
-
... print('{:^
|
|
171
|
+
... print('{:^10} | {:^10} | {:^16} | {:^16} | {:^10} | {:^14}'.format(p.x, p.y, ptup(p.box[0]), ptup(p.box[1]), p.class_id, ptup(p.fsize))) # doctest: +IGNORE_OUTPUT
|
|
172
172
|
... cv2.rectangle(img, p.box[0], p.box[1], [0, 0, 0], 2) # +IGNORE_OUTPUT
|
|
173
173
|
... point = (int((p.box[0][0] + p.box[1][0]) / 2 - 75), p.box[1][1] + 22) # doctest: +IGNORE_OUTPUT
|
|
174
174
|
... cv2.putText(img, p.class_id, point, cv2.FONT_HERSHEY_SIMPLEX, 1, [0, 0, 0], 2) # doctest: +IGNORE_OUTPUT
|
|
@@ -128,7 +128,7 @@ class ekf(kalman):
|
|
|
128
128
|
|
|
129
129
|
.. code::
|
|
130
130
|
|
|
131
|
-
>>> _ekf = ekf({'x': 0
|
|
131
|
+
>>> _ekf = ekf({'x': 0}, P0 = 0.5**2, F = 1, H = 1, Q = 0.05, R = 200)
|
|
132
132
|
>>> print(_ekf)
|
|
133
133
|
[ x ]
|
|
134
134
|
>>> _ekf.X # doctest: +NUMPY_FORMAT
|
|
@@ -146,7 +146,7 @@ class ekf(kalman):
|
|
|
146
146
|
|
|
147
147
|
.. code::
|
|
148
148
|
|
|
149
|
-
>>> _ekf = ekf({'x': 0
|
|
149
|
+
>>> _ekf = ekf({'x': 0}, P0 = 0.5**2, F = 1, G = 150, H = 1, R = 200, Q = 0.05)
|
|
150
150
|
>>> _ekf.X # doctest: +NUMPY_FORMAT
|
|
151
151
|
[0]
|
|
152
152
|
>>> _ekf.P # doctest: +NUMPY_FORMAT
|
|
@@ -163,7 +163,7 @@ class ekf(kalman):
|
|
|
163
163
|
|
|
164
164
|
.. code::
|
|
165
165
|
|
|
166
|
-
>>> _ekf = ekf({'x': 0
|
|
166
|
+
>>> _ekf = ekf({'x': 0}, P0 = 0.5**2, F = 1, G = 150, H = 1, R = 200, Q = 0.05)
|
|
167
167
|
>>> _ekf.X # doctest: +NUMPY_FORMAT
|
|
168
168
|
[0]
|
|
169
169
|
>>> _ekf.P # doctest: +NUMPY_FORMAT
|
|
@@ -244,7 +244,7 @@ class ekf(kalman):
|
|
|
244
244
|
|
|
245
245
|
.. code::
|
|
246
246
|
|
|
247
|
-
>>> _ekf = ekf({'x': 0
|
|
247
|
+
>>> _ekf = ekf({'x': 0}, P0 = 0.5**2, F = 1, H = 1, Q = 0.05, R = 200)
|
|
248
248
|
>>> print(_ekf)
|
|
249
249
|
[ x ]
|
|
250
250
|
>>> _ekf.X # doctest: +NUMPY_FORMAT
|
|
@@ -264,7 +264,7 @@ class ekf(kalman):
|
|
|
264
264
|
|
|
265
265
|
.. code::
|
|
266
266
|
|
|
267
|
-
>>> _ekf = ekf({'x': 0
|
|
267
|
+
>>> _ekf = ekf({'x': 0}, P0 = 0.5**2, F = 1, G = 150, H = 1, R = 200, Q = 0.05)
|
|
268
268
|
>>> _ekf.X # doctest: +NUMPY_FORMAT
|
|
269
269
|
[0]
|
|
270
270
|
>>> _ekf.P # doctest: +NUMPY_FORMAT
|
|
@@ -139,7 +139,7 @@ class kalman(c4d.state):
|
|
|
139
139
|
|
|
140
140
|
>>> v = 150
|
|
141
141
|
>>> sensor_noise = 200
|
|
142
|
-
>>> kf = kalman({'x': 0
|
|
142
|
+
>>> kf = kalman({'x': 0}, P0 = 0.5**2, F = 1, G = v, H = 1
|
|
143
143
|
... , Q = 0.05, R = sensor_noise**2, steadystate = True)
|
|
144
144
|
|
|
145
145
|
|
|
@@ -193,7 +193,7 @@ class kalman(c4d.state):
|
|
|
193
193
|
.. code::
|
|
194
194
|
|
|
195
195
|
>>> v = 150
|
|
196
|
-
>>> kf = kalman({'x': 0
|
|
196
|
+
>>> kf = kalman({'x': 0}, P0 = 0.5*2, F = 1, G = v, H = 1, Q = 0.05)
|
|
197
197
|
>>> for t in range(1, 26): # seconds.
|
|
198
198
|
... kf.store(t)
|
|
199
199
|
... sensor_noise = 200 + 8 * t
|
|
@@ -352,7 +352,7 @@ class kalman(c4d.state):
|
|
|
352
352
|
|
|
353
353
|
.. code::
|
|
354
354
|
|
|
355
|
-
>>> kf = kalman({'x': 0
|
|
355
|
+
>>> kf = kalman({'x': 0}, P0 = 0.5**2, F = 1, H = 1, Q = 0.05, R = 200, steadystate = True)
|
|
356
356
|
>>> print(kf)
|
|
357
357
|
[ x ]
|
|
358
358
|
>>> kf.X # doctest: +NUMPY_FORMAT
|
|
@@ -370,7 +370,7 @@ class kalman(c4d.state):
|
|
|
370
370
|
|
|
371
371
|
.. code::
|
|
372
372
|
|
|
373
|
-
>>> kf = kalman({'x': 0
|
|
373
|
+
>>> kf = kalman({'x': 0}, P0 = 0.5**2, F = 1, G = 150, H = 1, R = 200, Q = 0.05)
|
|
374
374
|
>>> kf.X # doctest: +NUMPY_FORMAT
|
|
375
375
|
[0]
|
|
376
376
|
>>> kf.P # doctest: +NUMPY_FORMAT
|
|
@@ -387,7 +387,7 @@ class kalman(c4d.state):
|
|
|
387
387
|
|
|
388
388
|
.. code::
|
|
389
389
|
|
|
390
|
-
>>> kf = kalman({'x': 0
|
|
390
|
+
>>> kf = kalman({'x': 0}, P0 = 0.5**2, F = 1, G = 150, H = 1, R = 200, Q = 0.05)
|
|
391
391
|
>>> kf.X # doctest: +NUMPY_FORMAT
|
|
392
392
|
[0]
|
|
393
393
|
>>> kf.P # doctest: +NUMPY_FORMAT
|
|
@@ -477,7 +477,7 @@ class kalman(c4d.state):
|
|
|
477
477
|
|
|
478
478
|
.. code::
|
|
479
479
|
|
|
480
|
-
>>> kf = kalman({'x': 0
|
|
480
|
+
>>> kf = kalman({'x': 0}, P0 = 0.5**2, F = 1, H = 1, Q = 0.05, R = 200, steadystate = True)
|
|
481
481
|
>>> print(kf)
|
|
482
482
|
[ x ]
|
|
483
483
|
>>> kf.X # doctest: +NUMPY_FORMAT
|
|
@@ -497,7 +497,7 @@ class kalman(c4d.state):
|
|
|
497
497
|
|
|
498
498
|
.. code::
|
|
499
499
|
|
|
500
|
-
>>> kf = kalman({'x': 0
|
|
500
|
+
>>> kf = kalman({'x': 0}, P0 = 0.5**2, F = 1, G = 150, H = 1, R = 200, Q = 0.05)
|
|
501
501
|
>>> kf.X # doctest: +NUMPY_FORMAT
|
|
502
502
|
[0]
|
|
503
503
|
>>> kf.P # doctest: +NUMPY_FORMAT
|
|
@@ -591,7 +591,7 @@ class kalman(c4d.state):
|
|
|
591
591
|
|
|
592
592
|
.. code::
|
|
593
593
|
|
|
594
|
-
>>> kf = kalman({'x': 0
|
|
594
|
+
>>> kf = kalman({'x': 0}, P0 = 0.5**2, F = 1, H = 1, Q = 0.05, R = 200)
|
|
595
595
|
>>> # store initial conditions
|
|
596
596
|
>>> kf.store()
|
|
597
597
|
>>> kf.predict()
|
|
@@ -668,7 +668,7 @@ class kalman(c4d.state):
|
|
|
668
668
|
Q = np.eye(6) * process_noise**2
|
|
669
669
|
R = np.eye(4) * measure_noise**2
|
|
670
670
|
|
|
671
|
-
kf = kalman({'x': 0
|
|
671
|
+
kf = kalman({'x': 0, 'y': 0, 'w': 0, 'h': 0, 'vx': 0, 'vy': 0}
|
|
672
672
|
, steadystate = True, F = F, H = H, Q = Q, R = R)
|
|
673
673
|
return kf
|
|
674
674
|
|
|
@@ -200,7 +200,7 @@ class datapoint(state):
|
|
|
200
200
|
_mass = 1
|
|
201
201
|
|
|
202
202
|
|
|
203
|
-
def __init__(self, x = 0
|
|
203
|
+
def __init__(self, x = 0, y = 0, z = 0, vx = 0, vy = 0, vz = 0):
|
|
204
204
|
# TODO: document the state type being float by default. (required after chaning vars to 0.0 and the mechanism of generating the state vector array. )
|
|
205
205
|
|
|
206
206
|
dpargs = {}
|
|
@@ -181,8 +181,8 @@ class rigidbody(datapoint): #
|
|
|
181
181
|
_iyy = 0
|
|
182
182
|
_izz = 0
|
|
183
183
|
|
|
184
|
-
def __init__(self, x = 0
|
|
185
|
-
, phi = 0
|
|
184
|
+
def __init__(self, x = 0, y = 0, z = 0, vx = 0, vy = 0, vz = 0
|
|
185
|
+
, phi = 0, theta = 0, psi = 0, p = 0, q = 0, r = 0
|
|
186
186
|
):
|
|
187
187
|
|
|
188
188
|
rbargs = {}
|
|
@@ -110,6 +110,7 @@ class state:
|
|
|
110
110
|
|
|
111
111
|
_reserved_keys = ('X', 'X0', 'P', 'V', 'Position', 'Velocity', 'norm', 'normalize', 'data', '_data', '_prmdata', '_didx')
|
|
112
112
|
|
|
113
|
+
_STATETYPE = np.float64
|
|
113
114
|
|
|
114
115
|
def __init__(self, **kwargs):
|
|
115
116
|
# TODO enable providing type for the setter.X output.
|
|
@@ -137,7 +138,7 @@ class state:
|
|
|
137
138
|
# if any of the input vars is floating point, then it casts the entire state type (no partial types array)
|
|
138
139
|
# if all of them are integer, it casts the staet type.
|
|
139
140
|
# i think maybe the best way to achieve it is by generating a numpy array and check its dtype:
|
|
140
|
-
self._X = np.array(list(kwargs.values()))
|
|
141
|
+
self._X = np.array(list(kwargs.values()), dtype = self._STATETYPE)
|
|
141
142
|
# self._X = np.zeros(len(kwargs)) #, dtype = np.float64)
|
|
142
143
|
# TODO: now the type is determined by the initial values.
|
|
143
144
|
# if any is floating point then the entire state is float.
|
|
@@ -205,13 +206,13 @@ class state:
|
|
|
205
206
|
# intercept known state variables
|
|
206
207
|
if "_didx" in self.__dict__ and var in self._didx:
|
|
207
208
|
|
|
208
|
-
if np.array(val).dtype != self._X.dtype:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
# if np.array(val).dtype != self._X.dtype:
|
|
210
|
+
# warnings.warn(
|
|
211
|
+
# f"Type mismatch! Casting X to {np.array(val).dtype}. (currently: {self._X.dtype})."
|
|
212
|
+
# , c4d.c4warn)
|
|
213
|
+
# self._X = self._X.astype(np.array(val).dtype)
|
|
213
214
|
|
|
214
|
-
self._X[self._didx[var] - 1] = val
|
|
215
|
+
self._X[self._didx[var] - 1] = np.array(val).astype(self._STATETYPE)
|
|
215
216
|
else:
|
|
216
217
|
# regular attribute assignment
|
|
217
218
|
super().__setattr__(var, val)
|
|
@@ -266,7 +267,7 @@ class state:
|
|
|
266
267
|
>>> dp.X # doctest: +NUMPY_FORMAT
|
|
267
268
|
[0 0 0 0 0 0]
|
|
268
269
|
>>> # x y z vx vy vz
|
|
269
|
-
>>> dp.X = [1000
|
|
270
|
+
>>> dp.X = [1000, 100, 0, 0, 0, -100]
|
|
270
271
|
>>> dp.X # doctest: +NUMPY_FORMAT
|
|
271
272
|
[1000 100 0 0 0 -100]
|
|
272
273
|
|
|
@@ -298,13 +299,13 @@ class state:
|
|
|
298
299
|
# i think to replace flatten() with ravel() is
|
|
299
300
|
# safe also here because Xin is iterated over its elements which are
|
|
300
301
|
# mutable. but lets keep tracking.
|
|
301
|
-
Xin = np.atleast_1d(Xin).ravel()
|
|
302
|
+
Xin = np.atleast_1d(Xin).ravel().astype(self._STATETYPE)
|
|
302
303
|
|
|
303
|
-
if Xin.dtype != self._X.dtype:
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
304
|
+
# if Xin.dtype != self._X.dtype:
|
|
305
|
+
# warnings.warn(
|
|
306
|
+
# f"Type mismatch! Casting X to {Xin.dtype}. (currently: {self._X.dtype})."
|
|
307
|
+
# , c4d.c4warn)
|
|
308
|
+
# self._X = self._X.astype(Xin.dtype)
|
|
308
309
|
|
|
309
310
|
|
|
310
311
|
if len(Xin) != len(self._X):
|
|
@@ -421,6 +422,8 @@ class state:
|
|
|
421
422
|
[0 0 0]
|
|
422
423
|
|
|
423
424
|
'''
|
|
425
|
+
# NOTE: maybe useless because user can always create a new state object.
|
|
426
|
+
|
|
424
427
|
b0 = len(self._didx)
|
|
425
428
|
|
|
426
429
|
for i, (k, v) in enumerate(kwargs.items()):
|
|
@@ -493,7 +496,7 @@ class state:
|
|
|
493
496
|
|
|
494
497
|
.. code::
|
|
495
498
|
|
|
496
|
-
>>> s = c4d.state(x = 1
|
|
499
|
+
>>> s = c4d.state(x = 1, y = 0, z = 0)
|
|
497
500
|
>>> for t in np.linspace(0, 1, 3):
|
|
498
501
|
... s.X = np.random.rand(3)
|
|
499
502
|
... s.store(t)
|
|
@@ -602,7 +605,7 @@ class state:
|
|
|
602
605
|
>>> np.random.seed(44)
|
|
603
606
|
>>> for i in range(3):
|
|
604
607
|
... s.X += 1
|
|
605
|
-
... s.w, s.h = np.random.randint(0, 50, 2
|
|
608
|
+
... s.w, s.h = np.random.randint(0, 50, 2)
|
|
606
609
|
... if s.w > 40 or s.h > 20:
|
|
607
610
|
... s.class_id = 'truck'
|
|
608
611
|
... else:
|
|
@@ -733,7 +736,7 @@ class state:
|
|
|
733
736
|
.. code::
|
|
734
737
|
|
|
735
738
|
>>> np.random.seed(100) # to reproduce results
|
|
736
|
-
>>> s = c4d.state(x = 1
|
|
739
|
+
>>> s = c4d.state(x = 1, y = 0, z = 0)
|
|
737
740
|
>>> for t in np.linspace(0, 1, 3):
|
|
738
741
|
... s.X = np.random.rand(3)
|
|
739
742
|
... s.store(t)
|
|
@@ -760,7 +763,7 @@ class state:
|
|
|
760
763
|
|
|
761
764
|
.. code::
|
|
762
765
|
|
|
763
|
-
>>> s = c4d.state(phi = 0
|
|
766
|
+
>>> s = c4d.state(phi = 0)
|
|
764
767
|
>>> for p in np.linspace(0, c4d.pi):
|
|
765
768
|
... s.phi = p
|
|
766
769
|
... s.store()
|
|
@@ -939,7 +942,7 @@ class state:
|
|
|
939
942
|
>>> s = c4d.state(x = 0, y = 0)
|
|
940
943
|
>>> s.store()
|
|
941
944
|
>>> for _ in range(100):
|
|
942
|
-
... s.x = np.random.randint(0, 100, 1
|
|
945
|
+
... s.x = np.random.randint(0, 100, 1)
|
|
943
946
|
... s.store()
|
|
944
947
|
>>> s.plot('x', filename = 'x.png') # doctest: +IGNORE_OUTPUT
|
|
945
948
|
>>> plt.show()
|
|
@@ -958,7 +961,7 @@ class state:
|
|
|
958
961
|
|
|
959
962
|
**Dark mode off:**
|
|
960
963
|
|
|
961
|
-
>>> s = c4d.state(x = 0
|
|
964
|
+
>>> s = c4d.state(x = 0)
|
|
962
965
|
>>> s.xstd = 0.2
|
|
963
966
|
>>> for t in np.linspace(-2 * c4d.pi, 2 * c4d.pi, 1000):
|
|
964
967
|
... s.x = c4d.sin(t) + np.random.randn() * s.xstd
|
|
@@ -974,7 +977,7 @@ class state:
|
|
|
974
977
|
|
|
975
978
|
.. code::
|
|
976
979
|
|
|
977
|
-
>>> s = c4d.state(phi = 0
|
|
980
|
+
>>> s = c4d.state(phi = 0)
|
|
978
981
|
>>> for y in c4d.tan(np.linspace(-c4d.pi, c4d.pi, 500)):
|
|
979
982
|
... s.phi = c4d.atan(y)
|
|
980
983
|
... s.store()
|
|
@@ -5,7 +5,10 @@ Globals and conversion constants.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
C4dynamics includes several constants as global quantities
|
|
8
|
-
and conversion units
|
|
8
|
+
and conversion units.
|
|
9
|
+
All c4dynamics constants reside directly in the c4dynamics namespace.
|
|
10
|
+
For example, if c4dynamics is imported as c4d, then the value of pi is given by c4d.pi.
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
Global Constants
|
|
@@ -10,7 +10,12 @@ Math functions aliasing.
|
|
|
10
10
|
|
|
11
11
|
For convenience, C4dynamics aliases some of
|
|
12
12
|
NumPy's trigonometric functions
|
|
13
|
-
with slight variations in some of them
|
|
13
|
+
with slight variations in some of them.
|
|
14
|
+
|
|
15
|
+
All c4dynamics math functions reside directly in the c4dynamics namespace.
|
|
16
|
+
For example, if c4dynamics is imported as c4d, then the sin() function is given by c4d.sin().
|
|
17
|
+
|
|
18
|
+
|
|
14
19
|
|
|
15
20
|
.. code::
|
|
16
21
|
|
|
@@ -56,7 +56,7 @@ setup(
|
|
|
56
56
|
, keywords = ['python', 'dynamics', 'physics'
|
|
57
57
|
, 'algorithms', 'computer vision'
|
|
58
58
|
, 'navigation', 'guidance', 'slam'
|
|
59
|
-
, '
|
|
59
|
+
, 'vslam', 'image processing', 'signal processing', 'control']
|
|
60
60
|
, classifiers = ['Development Status :: 5 - Production/Stable'
|
|
61
61
|
, 'Intended Audience :: Developers'
|
|
62
62
|
, 'Programming Language :: Python :: 3'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|