diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7d4fc6b --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ + + Copyright (C) 2019 Parrot Drones SAS + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Parrot nor the names + of its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. diff --git a/OpenFlightCore.framework/Headers/LibMoserApiBridge.h b/OpenFlightCore.framework/Headers/LibMoserApiBridge.h new file mode 100644 index 0000000..acd1e96 --- /dev/null +++ b/OpenFlightCore.framework/Headers/LibMoserApiBridge.h @@ -0,0 +1,69 @@ +// Copyright (C) 2019 Parrot Drones SAS +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the +// distribution. +// * Neither the name of the Parrot Company nor the names +// of its contributors may be used to endorse or promote products +// derived from this software without specific prior written +// permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. + +#import +#import + +#define MOSER_OG_H 100 +#define MOSER_OG_V 30 +#define MOSER_OG_VSIZE 0.3f + +#define MOSER_DM_W 176 +#define MOSER_DM_H 90 + +#define MOSER_THRESHOLD 80 + +#define MOSER_DISPARITY_MAX 100 + + +@interface LibMoserApiBridge : NSObject { + + /// Disparity frame to process + @public float *disparityframe; +} + +-(instancetype)init; + +/** + update moser occupancy grid using the disparityframe, with love quaternion and droneorigin + @param quat love quaternion + @param origin drone position + @param timestampNs time stamp + */ +-(int)updateFromDisparityFrameWithQuaternion:(float *)quat + origin:(float[3])origin + timestampNs:(const uint64_t)timestampNs; + +/// return the grid's origin +-(simd_float3)getOrigin; + +/// test is a voxel exists at point +-(BOOL)isVoxel: (simd_int3) point; + +@end diff --git a/OpenFlightCore.framework/Headers/OpenFlightCore.h b/OpenFlightCore.framework/Headers/OpenFlightCore.h new file mode 100644 index 0000000..a5f3c02 --- /dev/null +++ b/OpenFlightCore.framework/Headers/OpenFlightCore.h @@ -0,0 +1,18 @@ +// +// OpenFlightCore.h +// OpenFlightCore +// + +#import + +//! Project version number for OpenFlightCore. +FOUNDATION_EXPORT double OpenFlightCoreVersionNumber; + +//! Project version string for OpenFlightCore. +FOUNDATION_EXPORT const unsigned char OpenFlightCoreVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import +#import +#import + diff --git a/OpenFlightCore.framework/Headers/PhotoPano.h b/OpenFlightCore.framework/Headers/PhotoPano.h new file mode 100644 index 0000000..f03094c --- /dev/null +++ b/OpenFlightCore.framework/Headers/PhotoPano.h @@ -0,0 +1,135 @@ +// Copyright (C) 2018 Parrot Drones SAS +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the +// distribution. +// * Neither the name of the Parrot Company nor the names +// of its contributors may be used to endorse or promote products +// derived from this software without specific prior written +// permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. + +#import +#import + +/** Processing status code */ +typedef NS_ENUM(NSInteger, PhotoPanoPreset) { + // Numerical values must be kept in sync with C++ code (enum MakerPreset) + /** Spherical panorama. */ + PhotoPanoPresetSphere = 0, + /** Little-planet panorama. */ + PhotoPanoPresetPlanet = 1, + /** Tunnel panorama. */ + PhotoPanoPresetTunnel = 2, + /** Horizontal panorama, 180° spherical 2:1. */ + PhotoPanoPresetHorizontal = 3, + /** Vertical panorama, 70° recti 1:2. */ + PhotoPanoPresetVertical = 4, + /** Spherical panorama optimized for fast rendering. */ + PhotoPanoPresetFastSphere = 5, + /** Superwide panorama. */ + PhotoPanoPresetSuperWide = 6, + /** Custom panorama. */ + PhotoPanoPresetCustom = 7, +}; + +/** Processing status code */ +typedef NS_ENUM(NSInteger, PhotoPanoProcessingStatus) { + // Numerical values must be kept in sync with C++ code (enum MakerStatus) + /** Waiting */ + PhotoPanoProcessingStatusWaiting = 0, + /** Estimating */ + PhotoPanoProcessingStatusEstimating = 1, + /** Wrapping */ + PhotoPanoProcessingStatusWrapping = 2, + /** Cutting */ + PhotoPanoProcessingStatusCutting = 3, + /** Blending */ + PhotoPanoProcessingStatusBlending = 4, + /** Cancelled */ + PhotoPanoProcessingStatusCancelled = 5, + /** Failed */ + PhotoPanoProcessingStatusFailed = 6, + /** Success */ + PhotoPanoProcessingStatusSuccess = 7, +}; + +/** Completion callback */ +typedef void(^PhotoPanoProcessingStatusUpdate)(PhotoPanoProcessingStatus status); + +/** define a PhotoPanoDescription */ +@interface PhotoPanoDescription: NSObject +@property (nonatomic) CMQuaternion cam_to_world; +@property (nonatomic) float hfov_deg; +@property (nonatomic) float planet_factor; +@property (nonatomic) float planet_width; +@property (nonatomic) float planet_hcrop_factor; +@end + +/** define a PhotoPano */ +@interface PhotoPano : NSObject + +/** + * Process to create a panorama. + * + * Blocking function. + * + * @param preset presets of the panorama to create. + * @param inputs Paths of input pictures + * @param width width of the output picture to create + * @param height height of the output picture to create + * @param output path of the picture to create + * @param estimationIn path to input json estimation file + * @param estimationOut path to output json estimation file + * @param description panorama description + * @param statusUpdateBlock completion callback + * @return ending status. + * Returns directly PhotoPanoProcessingStatusFailed if a process is already running. + * + * @see #abort() + */ +- (PhotoPanoProcessingStatus) processWithPreset:(PhotoPanoPreset)preset + inputs:(NSArray*)inputs + width:(int)width + height:(int)height + output:(NSURL*)output + estimationIn:(NSURL*)estimationIn + estimationOut:(NSURL*)estimationOut + description:(PhotoPanoDescription*)description + statusUpdate:(PhotoPanoProcessingStatusUpdate)statusUpdateBlock +NS_SWIFT_NAME(process(preset:inputs:width:height:output:estimationIn:estimationOut:description:statusUpdate:)); + + +/** + * Aborts the process. + * + * @see process() + */ +- (void) abort; + +/** + * Retrieves the percentage of the process progression. + * + * @return percentage of the current processing. {@code 0.0} if no process running. + */ +- (double) progress; + +@end diff --git a/OpenFlightCore.framework/Headers/PhotoPanoView.h b/OpenFlightCore.framework/Headers/PhotoPanoView.h new file mode 100644 index 0000000..6314635 --- /dev/null +++ b/OpenFlightCore.framework/Headers/PhotoPanoView.h @@ -0,0 +1,66 @@ +// +// PhotoPanoView.h +// PhotoPanoView +// + +#import +#import +#import + +/** FOV control for a viewer. */ +typedef NS_ENUM(NSInteger, PhotoPanoViewFovControl) { + // Numerical values must be kept in sync with C code (ViewerFovControl) + + /** FOV control also affects projection type. */ + PhotoPanoViewFovControlFull = 0, + + /** FOV control always follows rectilinear projection. */ + PhotoPanoViewFovControlRectilinear = 1, +}; + +/** Aspect ratio */ +typedef NS_ENUM(NSInteger, PhotoPanoViewAspectRatio) { + // Numerical values must be kept in sync with C code (ViewerAspectRatio) + /**< 1:1 aspect ratio */ + PhotoPanoViewAspectRatio_1_1 = 0, + + /**< 4:3 aspect ratio */ + PhotoPanoViewAspectRatio_4_3, + + /**< 3:2 aspect ratio */ + PhotoPanoViewAspectRatio_3_2, + + /**< 16:9 aspect ratio */ + PhotoPanoViewAspectRatio_16_9, + + /**< 2:1 aspect ratio */ + PhotoPanoViewAspectRatio_2_1, +}; + +@class PhotoPanoDescription; + +NS_ASSUME_NONNULL_BEGIN + +@interface PhotoPanoView : GLKView +- (void)setup:(EAGLContext *) context fovControl:(PhotoPanoViewFovControl)fovControl gridDivisions:(int)gridDivisions; +- (void)setPanorama:(NSString *)path enableAnimation:(BOOL)enabled triggerAnimation:(BOOL)triggered; +- (void)triggerStartAnimation; +- (void)setQuaternion:(CMQuaternion)q orientation:(UIInterfaceOrientation)orientation; +- (void)touchDown; +- (void)touchUp; +- (void)startPan:(NSInteger)touchCount; +- (void)updatePan:(CGPoint)translation; +- (void)endPan; +- (void)startPinch; +- (void)updatePinch:(CGFloat) scale; +- (void)endPinch; +- (void)startRotation; +- (void)updateRotation:(CGFloat) angle; +- (void)endRotation; +- (void)doubleTap; +- (void)toggleAspectRatio; +- (void)setAspectRatio:(PhotoPanoViewAspectRatio)aspectRatio; +- (PhotoPanoDescription*)panoDescription; +@end + +NS_ASSUME_NONNULL_END diff --git a/OpenFlightCore.framework/Info.plist b/OpenFlightCore.framework/Info.plist new file mode 100644 index 0000000..3bffa23 Binary files /dev/null and b/OpenFlightCore.framework/Info.plist differ diff --git a/OpenFlightCore.framework/Modules/module.modulemap b/OpenFlightCore.framework/Modules/module.modulemap new file mode 100644 index 0000000..b84cce9 --- /dev/null +++ b/OpenFlightCore.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module OpenFlightCore { + umbrella header "OpenFlightCore.h" + + export * + module * { export * } +} diff --git a/OpenFlightCore.framework/OpenFlightCore b/OpenFlightCore.framework/OpenFlightCore new file mode 100755 index 0000000..885038c Binary files /dev/null and b/OpenFlightCore.framework/OpenFlightCore differ diff --git a/OpenFlightCore.framework/_CodeSignature/CodeResources b/OpenFlightCore.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..a55a0fe --- /dev/null +++ b/OpenFlightCore.framework/_CodeSignature/CodeResources @@ -0,0 +1,168 @@ + + + + + files + + Headers/LibMoserApiBridge.h + + YEY4hNbJwaJjvAaacidphVgWdrU= + + Headers/OpenFlightCore.h + + Kx24Apo8PZfjCRt1DYAaLrW3ZqA= + + Headers/PhotoPano.h + + wiAqDR1xNj8JQQVtGX0I4Hs5G40= + + Headers/PhotoPanoView.h + + y0g/Unfsgu+W8PVHxXIC5u/mv/g= + + Info.plist + + JXU/pW6dk3qGHnn2h8nmybI+lRQ= + + Modules/module.modulemap + + LGYR6S7bsl01mmg9sySv9QuxD5U= + + config.xcconfig + + y8jxD+3KSgfxVsNkpwXnV/VicO8= + + + files2 + + Headers/LibMoserApiBridge.h + + hash2 + + KzEnIEErmkyGWPHtOAGQOK8OC4I46i0O8Pmx499AG/I= + + + Headers/OpenFlightCore.h + + hash2 + + H7g+kldfGwaqWJHVDFcwPZBLWh4krI22rFT7O0Ju1yY= + + + Headers/PhotoPano.h + + hash2 + + V19o1OkaUisYBzIIBvOYtMFrU+2xEpzZ1k+HkPSy8PY= + + + Headers/PhotoPanoView.h + + hash2 + + QixAge2oJYTJV4u36epk4z6qnmn3N+RWOVORJUSnbhs= + + + Modules/module.modulemap + + hash2 + + 0E4QS9bRvbXhv1Lj8HOvBPevL5xCiCcQUdKjEEr8RcA= + + + config.xcconfig + + hash2 + + 205WToqe5NLwpxD0fbFUvx3w0MJFR9Jr20Si4B89wO8= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/OpenFlightCore.podspec b/OpenFlightCore.podspec new file mode 100644 index 0000000..fff05b0 --- /dev/null +++ b/OpenFlightCore.podspec @@ -0,0 +1,14 @@ + +Pod::Spec.new do |s| + s.name = "OpenFlightCore" + s.version = "7.0.1" + s.summary = "Parrot Drone OpenFlightCore, low level implementation" + s.homepage = "https://developer.parrot.com" + s.license = "{ :type => 'BSD 3-Clause License', :file => 'LICENSE' }" + s.author = "Parrot Drone SAS" + s.source = { :git => 'https://github.com/Parrot-Developers/pod_openflightcore', :tag => "7.0.1" } + s.platform = :ios + s.ios.deployment_target = '13.0' + s.vendored_frameworks = 'OpenFlightCore.framework' + s.xcconfig = { 'ONLY_ACTIVE_ARCH' => 'YES' } +end