-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c2fd1e
commit 8b62956
Showing
10 changed files
with
505 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <Foundation/Foundation.h> | ||
#import <simd/SIMD.h> | ||
|
||
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// OpenFlightCore.h | ||
// OpenFlightCore | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
//! 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 <OpenFlightCore/PublicHeader.h> | ||
#import <OpenFlightCore/LibMoserApiBridge.h> | ||
#import <OpenFlightCore/PhotoPano.h> | ||
#import <OpenFlightCore/PhotoPanoView.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <CoreMotion/CoreMotion.h> | ||
#import <UIKit/UIKit.h> | ||
|
||
/** 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// PhotoPanoView.h | ||
// PhotoPanoView | ||
// | ||
|
||
#import <GLKit/GLKit.h> | ||
#import <UIKit/UIKit.h> | ||
#import <CoreMotion/CoreMotion.h> | ||
|
||
/** 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 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
framework module OpenFlightCore { | ||
umbrella header "OpenFlightCore.h" | ||
|
||
export * | ||
module * { export * } | ||
} |
Binary file not shown.
Oops, something went wrong.