generic asf/amc parser following standard version 1.1.
Project description
# PyAsfAmc Author: Nikhil Reji
generic asf/amc parser following standard version 1.1.
features:
- ASF parser
- AMC parser
- Simple, Clean data structure.
Imports
from asfamcparser import ParseASF, ParseAMC
Data Structure
Joint
Immutable class where every property is optional.
JOINT
- name : str
- dof : NamedTuple e.g (rx=(-inf,inf), ry=(-inf,inf), rz=(-inf,inf))
- direction : Tuple e.g (0.0, 1.2, 2.2)
- length : float
- axis : NamedTuple e.g (X=0.0, Y=0.0, Z=0.0)
- order : Tuple e.g ("X", "Y", "Z")
NamedTuple values can be accessed either through their index or their names as follows:
axis.X
ASF
Immutable class.
ASF
- name : str
- units : NamedTuple e.g ("mass"="kg", "length"="mm", "angle"="Deg")
- doc : str
- joints : Tuple[Joint, ...]
- hierarchy : dict where each key corresponds to a a joint that has children.
Individual joints can be retrieved using the dict key method as follows:
LElbowJoint = ASF["LeftElbow"]
Also, all joints can be accessed through for iterations:
for joint in ASF:
print( joint.name )
AMC
Immutable class
AMC
- count:int (number of frames)
- frames: Tuple[dict,...]
Individual frames can be retrieved using the dict key method as follows:
frameTen = AMC[10]
Individual frames and specific joint data can be retrieved using the dict key method as follows:
frameTenHead = AMC[10]["Head"]
Also, all frames can be accessed through for iterations:
for frame in AMC:
print( frame.count )
Examples:
ParseASF
The full path to the .asf file is required to parse.
parsedAsf = ParseASF("./recordings/test.asf")
asf = parsedASF.asf
The retrieve asf file can be navigated using its properties described in the data structudre section.
ParseAMC
The full path to the .amc file is required to parse.
parsedAmc = ParseAmc("./recordings/test.amc")
amc = parsedAMC.amc
The retrieved amc file can be navigated using its properties described in the data structure section.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file asfamc_parser-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: asfamc_parser-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0899c77afe762f94be0feee6995a8961d9366090a82fab4baa3e8a363fac45b |
|
MD5 | aa360e84a5fb5dd9f499bb2540ad6ae3 |
|
BLAKE2b-256 | e181831417424f293dad57109823ff611253172248d16bfe272488a4e64f8c9d |