Table of Contents

Class SparseSpatialMap

네임스페이스
easyar

제공합니다 the main functions of the SparseSpatialMap system: map generation and storage, map loading and localization, and access to environment information such as point clouds and planes for hit Test. SparseSpatialMap occupies 2 camera buffers. Use camera setBufferCapacity to set no less than the total number of camera buffers occupied by all components.

SparseSpatialMap

메서드

isAvailable

확인합니다 whether SparseSpatialMap is available. Always returns true.

bool easyar_SparseSpatialMap_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
+ (bool)isAvailable
public static func isAvailable() -> Bool
public static bool isAvailable()

반환 값

형식 설명
Boolean

inputFrameSink

Input frame input port. SparseSpatialMap input frames must contain camera parameters, timestamp information, and spatial information (cameraTransform and trackingStatus). Refer to InputFrameSink. Note: camera supports pinhole and fisheye camera models. Using a fisheye camera will affect performance.

void easyar_SparseSpatialMap_inputFrameSink(easyar_SparseSpatialMap * This, easyar_InputFrameSink * * Return)
std::shared_ptr<InputFrameSink> inputFrameSink()
public @Nonnull InputFrameSink inputFrameSink()
fun inputFrameSink(): InputFrameSink
- (easyar_InputFrameSink *)inputFrameSink
public func inputFrameSink() -> InputFrameSink
public virtual InputFrameSink inputFrameSink()

반환 값

형식 설명
InputFrameSink

bufferRequirement

The number of camera buffers occupied by the current component.

int easyar_SparseSpatialMap_bufferRequirement(easyar_SparseSpatialMap * This)
int bufferRequirement()
public int bufferRequirement()
fun bufferRequirement(): Int
- (int)bufferRequirement
public func bufferRequirement() -> Int32
public virtual int bufferRequirement()

반환 값

형식 설명
Int32

outputFrameSource

Output frame output port. Refer to OutputFrameSource.

void easyar_SparseSpatialMap_outputFrameSource(easyar_SparseSpatialMap * This, easyar_OutputFrameSource * * Return)
std::shared_ptr<OutputFrameSource> outputFrameSource()
public @Nonnull OutputFrameSource outputFrameSource()
fun outputFrameSource(): OutputFrameSource
- (easyar_OutputFrameSource *)outputFrameSource
public func outputFrameSource() -> OutputFrameSource
public virtual OutputFrameSource outputFrameSource()

반환 값

형식 설명
OutputFrameSource

create

생성합니다 SparseSpatialMap.

void easyar_SparseSpatialMap_create(easyar_SparseSpatialMap * * Return)
static std::shared_ptr<SparseSpatialMap> create()
public static @Nonnull SparseSpatialMap create()
companion object fun create(): SparseSpatialMap
+ (easyar_SparseSpatialMap *)create
public static func create() -> SparseSpatialMap
public static SparseSpatialMap create()

반환 값

형식 설명
SparseSpatialMap

setResultPoseType

설정합니다 the result pose type. The default enableStabilization is false. It is valid only when InputFrame contains spatial information.

void easyar_SparseSpatialMap_setResultPoseType(easyar_SparseSpatialMap * This, bool enableStabilization)
void setResultPoseType(bool enableStabilization)
public void setResultPoseType(boolean enableStabilization)
fun setResultPoseType(enableStabilization: Boolean): Unit
- (void)setResultPoseType:(bool)enableStabilization
public func setResultPoseType(_ enableStabilization: Bool) -> Void
public virtual void setResultPoseType(bool enableStabilization)

매개 변수

이름 형식 설명
enableStabilization Boolean

반환 값

형식 설명
Void

setResultAsyncMode

설정합니다 result async mode. If results are output through outputFrameSource, this should be set to true; if results are obtained through getSyncResult, it should be set to false. The default enableAsync is true. Sync mode can take effect only when the input frame contains spatial information and an XR License is used.

bool easyar_SparseSpatialMap_setResultAsyncMode(easyar_SparseSpatialMap * This, bool enableAsync)
bool setResultAsyncMode(bool enableAsync)
public boolean setResultAsyncMode(boolean enableAsync)
fun setResultAsyncMode(enableAsync: Boolean): Boolean
- (bool)setResultAsyncMode:(bool)enableAsync
public func setResultAsyncMode(_ enableAsync: Bool) -> Bool
public virtual bool setResultAsyncMode(bool enableAsync)

매개 변수

이름 형식 설명
enableAsync Boolean

반환 값

형식 설명
Boolean

start

시작합니다 the SparseSpatialMap algorithm.

bool easyar_SparseSpatialMap_start(easyar_SparseSpatialMap * This)
bool start()
public boolean start()
fun start(): Boolean
- (bool)start
public func start() -> Bool
public virtual bool start()

반환 값

형식 설명
Boolean

stop

중지합니다 the SparseSpatialMap algorithm. Call start to run it again.

void easyar_SparseSpatialMap_stop(easyar_SparseSpatialMap * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()

반환 값

형식 설명
Void

close

닫습니다 SparseSpatialMap. It should not be used after close.

void easyar_SparseSpatialMap_close(easyar_SparseSpatialMap * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()

반환 값

형식 설명
Void

getPointCloudBuffer

가져옵니다 current point cloud position information. Point cloud positions are positions in the world coordinate system. Each point in buffer is represented by three consecutive values, corresponding to the coordinate values on the X, Y, and Z axes, and each value occupies 4 bytes.

void easyar_SparseSpatialMap_getPointCloudBuffer(easyar_SparseSpatialMap * This, easyar_Buffer * * Return)
std::shared_ptr<Buffer> getPointCloudBuffer()
public @Nonnull Buffer getPointCloudBuffer()
fun getPointCloudBuffer(): Buffer
- (easyar_Buffer *)getPointCloudBuffer
public func getPointCloudBuffer() -> Buffer
public virtual Buffer getPointCloudBuffer()

반환 값

형식 설명
Buffer

getMapPlanes

가져옵니다 detected planes, whose type is PlaneType.

void easyar_SparseSpatialMap_getMapPlanes(easyar_SparseSpatialMap * This, easyar_ListOfPlaneData * * Return)
std::vector<std::shared_ptr<PlaneData>> getMapPlanes()
public java.util.@Nonnull ArrayList<@Nonnull PlaneData> getMapPlanes()
fun getMapPlanes(): ArrayList<PlaneData>
- (NSArray<easyar_PlaneData *> *)getMapPlanes
public func getMapPlanes() -> [PlaneData]
public virtual List<PlaneData> getMapPlanes()

반환 값

형식 설명
List<PlaneData>

hitTestAgainstPointCloud

Performs Hit Test in the current point cloud and obtains n (n>=0) position coordinates on a ray from near to far relative to the camera.

void easyar_SparseSpatialMap_hitTestAgainstPointCloud(easyar_SparseSpatialMap * This, easyar_Vec2F cameraImagePoint, easyar_ListOfVec3F * * Return)
std::vector<Vec3F> hitTestAgainstPointCloud(Vec2F cameraImagePoint)
public java.util.@Nonnull ArrayList<@Nonnull Vec3F> hitTestAgainstPointCloud(@Nonnull Vec2F cameraImagePoint)
fun hitTestAgainstPointCloud(cameraImagePoint: Vec2F): ArrayList<Vec3F>
- (NSArray<easyar_Vec3F *> *)hitTestAgainstPointCloud:(easyar_Vec2F *)cameraImagePoint
public func hitTestAgainstPointCloud(_ cameraImagePoint: Vec2F) -> [Vec3F]
public virtual List<Vec3F> hitTestAgainstPointCloud(Vec2F cameraImagePoint)

매개 변수

이름 형식 설명
cameraImagePoint Vec2F

반환 값

형식 설명
List<Vec3F>

hitTestAgainstPlanes

Performs Hit Test on the currently detected planes and obtains n (n>=0) position coordinates on a ray from near to far relative to the camera. In the input image coordinate system ([0, 1]^2), x points right, y points down, and the origin is at the upper-left corner. You can use imageCoordinatesFromScreenCoordinates to convert from screen coordinates to image coordinates. The output is the point cloud coordinates in the world coordinate system.

void easyar_SparseSpatialMap_hitTestAgainstPlanes(easyar_SparseSpatialMap * This, easyar_Vec2F cameraImagePoint, easyar_ListOfVec3F * * Return)
std::vector<Vec3F> hitTestAgainstPlanes(Vec2F cameraImagePoint)
public java.util.@Nonnull ArrayList<@Nonnull Vec3F> hitTestAgainstPlanes(@Nonnull Vec2F cameraImagePoint)
fun hitTestAgainstPlanes(cameraImagePoint: Vec2F): ArrayList<Vec3F>
- (NSArray<easyar_Vec3F *> *)hitTestAgainstPlanes:(easyar_Vec2F *)cameraImagePoint
public func hitTestAgainstPlanes(_ cameraImagePoint: Vec2F) -> [Vec3F]
public virtual List<Vec3F> hitTestAgainstPlanes(Vec2F cameraImagePoint)

매개 변수

이름 형식 설명
cameraImagePoint Vec2F

반환 값

형식 설명
List<Vec3F>

getMapVersion

가져옵니다 the current map version of SparseSpatialMap.

void easyar_SparseSpatialMap_getMapVersion(easyar_String * * Return)
static std::string getMapVersion()
public static java.lang.@Nonnull String getMapVersion()
companion object fun getMapVersion(): String
+ (NSString *)getMapVersion
public static func getMapVersion() -> String
public static string getMapVersion()

반환 값

형식 설명
String

unloadMap

Unloads the specified SparseSpatialMap map data through a callback. The callback return value can be used to determine whether unloading succeeded: true for success, false otherwise.

void easyar_SparseSpatialMap_unloadMap(easyar_SparseSpatialMap * This, easyar_String * mapID, easyar_CallbackScheduler * callbackScheduler, easyar_OptionalOfFunctorOfVoidFromBool resultCallBack)
void unloadMap(std::string mapID, std::shared_ptr<CallbackScheduler> callbackScheduler, std::optional<std::function<void(bool)>> resultCallBack)
public void unloadMap(java.lang.@Nonnull String mapID, @Nonnull CallbackScheduler callbackScheduler, @Nullable FunctorOfVoidFromBool resultCallBack)
fun unloadMap(mapID: String, callbackScheduler: CallbackScheduler, resultCallBack: FunctorOfVoidFromBool?): Unit
- (void)unloadMap:(NSString *)mapID callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler resultCallBack:(void (^)(bool))resultCallBack
public func unloadMap(_ mapID: String, _ callbackScheduler: CallbackScheduler, _ resultCallBack: ((Bool) -> Void)?) -> Void
public virtual void unloadMap(string mapID, CallbackScheduler callbackScheduler, Optional<Action<bool>> resultCallBack)

매개 변수

이름 형식 설명
mapID String
callbackScheduler CallbackScheduler
resultCallBack Optional<Action<>>

반환 값

형식 설명
Void

setConfig

설정합니다 SparseSpatialMap-related configuration. Refer to SparseSpatialMapConfig.

void easyar_SparseSpatialMap_setConfig(easyar_SparseSpatialMap * This, easyar_SparseSpatialMapConfig * config)
void setConfig(std::shared_ptr<SparseSpatialMapConfig> config)
public void setConfig(@Nonnull SparseSpatialMapConfig config)
fun setConfig(config: SparseSpatialMapConfig): Unit
- (void)setConfig:(easyar_SparseSpatialMapConfig *)config
public func setConfig(_ config: SparseSpatialMapConfig) -> Void
public virtual void setConfig(SparseSpatialMapConfig config)

매개 변수

이름 형식 설명
config SparseSpatialMapConfig

반환 값

형식 설명
Void

getConfig

가져옵니다 SparseSpatialMap-related configuration. Refer to SparseSpatialMapConfig.

void easyar_SparseSpatialMap_getConfig(easyar_SparseSpatialMap * This, easyar_SparseSpatialMapConfig * * Return)
std::shared_ptr<SparseSpatialMapConfig> getConfig()
public @Nonnull SparseSpatialMapConfig getConfig()
fun getConfig(): SparseSpatialMapConfig
- (easyar_SparseSpatialMapConfig *)getConfig
public func getConfig() -> SparseSpatialMapConfig
public virtual SparseSpatialMapConfig getConfig()

반환 값

형식 설명
SparseSpatialMapConfig

startLocalization

시작합니다 trying to localize in the loaded map. Before this, the required configuration parameters need to be set. Refer to LocalizationMode.

bool easyar_SparseSpatialMap_startLocalization(easyar_SparseSpatialMap * This)
bool startLocalization()
public boolean startLocalization()
fun startLocalization(): Boolean
- (bool)startLocalization
public func startLocalization() -> Bool
public virtual bool startLocalization()

반환 값

형식 설명
Boolean

stopLocalization

중지합니다 the current localization process.

void easyar_SparseSpatialMap_stopLocalization(easyar_SparseSpatialMap * This)
void stopLocalization()
public void stopLocalization()
fun stopLocalization(): Unit
- (void)stopLocalization
public func stopLocalization() -> Void
public virtual void stopLocalization()

반환 값

형식 설명
Void

getSyncResult

가져옵니다 the synchronous output result. If SparseSpatialMap is paused, or if result async mode has not been set to false through setResultAsyncMode, the return value is empty.

void easyar_SparseSpatialMap_getSyncResult(easyar_SparseSpatialMap * This, easyar_MotionInputData * motionInputData, easyar_OptionalOfSparseSpatialMapResult * Return)
std::optional<std::shared_ptr<SparseSpatialMapResult>> getSyncResult(std::shared_ptr<MotionInputData> motionInputData)
public @Nullable SparseSpatialMapResult getSyncResult(@Nonnull MotionInputData motionInputData)
fun getSyncResult(motionInputData: MotionInputData): SparseSpatialMapResult?
- (easyar_SparseSpatialMapResult *)getSyncResult:(easyar_MotionInputData *)motionInputData
public func getSyncResult(_ motionInputData: MotionInputData) -> SparseSpatialMapResult?
public virtual Optional<SparseSpatialMapResult> getSyncResult(MotionInputData motionInputData)

매개 변수

이름 형식 설명
motionInputData MotionInputData

반환 값

형식 설명
Optional<SparseSpatialMapResult>