mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 18:13:55 +08:00
* locationd at 20hz
* update ref
* bump cereal
* dont modify global state
* add scons files
* ecef2geodetic and geodetic2ecef
* Finish local coords class
* Add header file
* Add orientation.cc
* cleanup
* Add functions to header file
* Add cython wrapper
* y u no work?
* This passes the tests
* test rot2quat and quat2rot
* Teste euler2rot and rot2euler
* rot_matrix
* test ecef_euler_from_ned and ned_euler_from_ecef
* add benchmark
* Add test
* Consistent newlines
* no more radians supported in geodetic
* test localcoord single
* test localcoord single
* all tests pass
* Unused import
* Add alternate namings
* Add source for formulas
* no explicit tests needed
* remove benchmark
* Add release files
* Typo
* Remove print statement
* no access to raw transform matrix
* temporarily add tolerance
* handcode quat2euler
* update ref
old-commit-hash: c18e7da3c2
43 lines
1.0 KiB
Python
43 lines
1.0 KiB
Python
import os
|
|
import numpy
|
|
import sysconfig
|
|
|
|
from Cython.Build import cythonize
|
|
from Cython.Distutils import build_ext
|
|
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
|
|
|
|
def get_ext_filename_without_platform_suffix(filename):
|
|
name, ext = os.path.splitext(filename)
|
|
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
|
|
|
if ext_suffix == ext:
|
|
return filename
|
|
|
|
ext_suffix = ext_suffix.replace(ext, '')
|
|
idx = name.find(ext_suffix)
|
|
|
|
if idx == -1:
|
|
return filename
|
|
else:
|
|
return name[:idx] + ext
|
|
|
|
|
|
class BuildExtWithoutPlatformSuffix(build_ext):
|
|
def get_ext_filename(self, ext_name):
|
|
filename = super().get_ext_filename(ext_name)
|
|
return get_ext_filename_without_platform_suffix(filename)
|
|
|
|
|
|
setup(
|
|
name='Cython transformations wrapper',
|
|
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
|
|
ext_modules=cythonize(
|
|
Extension(
|
|
"transformations",
|
|
sources=["transformations.pyx"],
|
|
language="c++",
|
|
extra_compile_args=["-std=c++14"],
|
|
include_dirs=[numpy.get_include()],
|
|
)
|
|
))
|