mikeroberts3000 / flashlight Goto Github PK
View Code? Open in Web Editor NEWFlashlight is a lightweight Python library for analyzing and solving quadrotor control problems.
Home Page: http://mikeroberts3000.github.io/flashlight
Flashlight is a lightweight Python library for analyzing and solving quadrotor control problems.
Home Page: http://mikeroberts3000.github.io/flashlight
Hey! Thank you for uploading this, I am glad to see a good control library for quadrotors with really good looking viz. I wanted to play around with this, but I realized that the library files are Mach-O
formats but I use Linux. I was wondering if you will be providing Linux complied versions of the libraries?
Otherwise I get this ..
ImportError: quadrotor_2d_H.so: invalid ELF header
When running any file that imports transformations.py
. I get a user warning which says that it failed to run line 1902:
/home/arun/git_projs/flashlight/code/lib/flashlight/transformations.py:1888: UserWarning: failed to import module _transformations
warnings.warn("failed to import module %s" % name)
@mikeroberts3000 : Pondering about the use case of trigonometric spline and its coefficients. Since I could not find documentation, I am asking here. Can you provide an an insight or at the least any reference.
Thanks for this really great library! I'm excited to start using it! I was able to run the first example but I had to work around a couple of spots in sympy_utils.py
which didn't work on my platform, anaconda python 2.7.15 with sympy 1.2 on OSX (with Apple's gcc).
Any advice on what I should change or what dependencies I should add on my platform? Thanks!
The workarounds I needed to run the first example are as follows:
First, after changing build_sympy_modules_on_import = True
, line 476 raised an error:
'module' object has no attribute '_get_code_wrapper_class'
My hasty workaround for 476(without support for other backends):
- CodeWrapperClass = sympy.utilities.autowrap._get_code_wrapper_class(backend)
+ if backend == "f2py":
+ CodeWrapperClass = sympy.utilities.autowrap.F2PyCodeWrapper
+ elif backend == "cython":
+ CodeWrapperClass = sympy.utilities.autowrap.CythonCodeWrapper
Nominally, should build_module_autowrap
not be running down that codepath? (I haven't taken any time to understand what's going on inside of it yet.)
I also am using osx's clang-/llvm gcc, without openmp installed, and had to edit a few other items:
-fno-var-tracking-assignments
in this template, since clang raises an error:clang: error: unknown argument: '-fno-var-tracking-assignments'
-fno-var-tracking-assignments
and also remove the second instance of include_dirs
here due to the following error:extra_compile_args=['-std=c99','-fno-var-tracking','-fno-var-tracking-assignments'], include_dirs=[numpy.get_include()],
SyntaxError: keyword argument repeated
After these changes, the first example on the homepage worked.
Again, thanks so much for providing this library!
Update, 9/4/18
I did also try linking to openmp
on my platform with brew install libomp
. The brew formula comes with "caveat" instructions, quoting:
"On Apple Clang, you need to add several options to use OpenMP... This usually looks like
-Xpreprocessor -fopenmp -lomp
"
So now my sympy_utils.py
looks like this (in a blind attempt to follow the instructions without knowing proper OpenMP linking procedures):
-extra_compile_args = [ "-fopenmp", "-fno-var-tracking", "-fno-var-tracking-assignments" ]
-extra_link_args = [ "-fopenmp" ]
+extra_compile_args = [ "-fno-var-tracking", "-Xpreprocessor", "-fopenmp", "-lomp" ]
+extra_link_args = [ "-Xpreprocessor", "-fopenmp", "-lomp" ]
This does generate some clang warnings after setting build_sympy_modules_on_import = True
(this time in quadrotor_3d.py
which I did not build as part of my initial issue posting, since the first example on the homepage uses quadrotor_2d.py
):
clang: warning: -lomp: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-Xpreprocessor -fopenmp' [-Wunused-command-line-argument]
In any case, I'm able to run the examples in this notebook so in the short-term I will wait to dig in further.
Hello!
Kindly, I want to as if I can, with Flashlight, impose inequality constraints on the first and second derivatives of the piecewise polynomial trajectory.
What I am aiming to do is to generate a snap optimized piecewise polynomial trajectory (based on a number of 3D waypoints), in which the zeroth (the minimum snap piecewise polynomial), the first (speed), and the second (acceleration) derivatives won't exceed a certain value.
Any example/guidance would be highly appreciated.
You don't seem to use any of the files from code/lib/flashlight/trajectory_optimization
, just curious as to why it is there?
Thanks!
I was getting the following error from scipy.interpolate.interp1d()
in interpolate_utils.resample_scalar_wrt_scalar()
:
in reparameterize_curve
t_user_progress_cubic = interpolate_utils.resample_scalar_wrt_scalar(l_cum_norm,t_p_linspace_norm,user_progress,kind="cubic")
File "code/lib/flashlight/interpolate_utils.py", line 27, in resample_scalar_wrt_scalar
x_new = x_interp_func(t_new)
File "scipy/interpolate/polyint.py", line 79, in __call__
y = self._evaluate(x)
File "scipy/interpolate/interpolate.py", line 664, in _evaluate
below_bounds, above_bounds = self._check_bounds(x_new)
File "site-packages/scipy/interpolate/interpolate.py", line 696, in _check_bounds
raise ValueError("A value in x_new is above the interpolation "
ValueError: A value in x_new is above the interpolation range.
From this StackOverflow post I'm guessing this is from an update to scipy, so I have added in fill_value='extrapolate'
in interpolate_utils.py
:
- x_interp_func = scipy.interpolate.interp1d(t,x,kind=kind)
+ x_interp_func = scipy.interpolate.interp1d(t,x,kind=kind, fill_value='extrapolate')
I am guessing this was the default behavior of the version of scipy that flashlight was written with, (but I haven't looked in scipy changelogs to check). The generated trajectory in the notebook example looks good though.
Thanks again for this great library! Excited to start using it more!
Platform info
I'm using scipy 1.1.0
: on OSX:
$ conda list | grep scipy
scipy 1.1.0 py27_blas_openblash7943236_201 [blas_openblas] conda-forge
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.