Class SparseSpatialMap
Fornece 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
Métodos
isAvailable
Verifica whether SparseSpatialMap is available. Always returns true.
bool easyar_SparseSpatialMap_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
public static func isAvailable() -> Bool
public static bool isAvailable()
Retorna
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()
Retorna
bufferRequirement
The number of camera buffers occupied by the current component.
int easyar_SparseSpatialMap_bufferRequirement(easyar_SparseSpatialMap * This)
public int bufferRequirement()
fun bufferRequirement(): Int
public func bufferRequirement() -> Int32
public virtual int bufferRequirement()
Retorna
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()
Retorna
create
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()
Retorna
setResultPoseType
Define 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)
Parâmetros
| Nome |
Tipo |
Descrição |
| enableStabilization |
Boolean |
|
Retorna
setResultAsyncMode
Define 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)
Parâmetros
| Nome |
Tipo |
Descrição |
| enableAsync |
Boolean |
|
Retorna
start
Inicia the SparseSpatialMap algorithm.
bool easyar_SparseSpatialMap_start(easyar_SparseSpatialMap * This)
public func start() -> Bool
public virtual bool start()
Retorna
stop
Para the SparseSpatialMap algorithm. Call start to run it again.
void easyar_SparseSpatialMap_stop(easyar_SparseSpatialMap * This)
public func stop() -> Void
public virtual void stop()
Retorna
close
Fecha SparseSpatialMap. It should not be used after close.
void easyar_SparseSpatialMap_close(easyar_SparseSpatialMap * This)
public func close() -> Void
public virtual void close()
Retorna
getPointCloudBuffer
Obtem 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()
Retorna
getMapPlanes
Obtem 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()
Retorna
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)
Parâmetros
| Nome |
Tipo |
Descrição |
| cameraImagePoint |
Vec2F |
|
Retorna
| Tipo |
Descrição |
| 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)
Parâmetros
| Nome |
Tipo |
Descrição |
| cameraImagePoint |
Vec2F |
|
Retorna
| Tipo |
Descrição |
| List<Vec3F> |
|
getMapVersion
Obtem 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()
Retorna
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)
Parâmetros
| Nome |
Tipo |
Descrição |
| mapID |
String |
|
| callbackScheduler |
CallbackScheduler |
|
| resultCallBack |
Optional<Action<>> |
|
Retorna
setConfig
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)
Parâmetros
Retorna
getConfig
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()
Retorna
startLocalization
Inicia 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)
public boolean startLocalization()
fun startLocalization(): Boolean
- (bool)startLocalization
public func startLocalization() -> Bool
public virtual bool startLocalization()
Retorna
stopLocalization
Para the current localization process.
void easyar_SparseSpatialMap_stopLocalization(easyar_SparseSpatialMap * This)
public void stopLocalization()
fun stopLocalization(): Unit
public func stopLocalization() -> Void
public virtual void stopLocalization()
Retorna
getSyncResult
Obtem 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)
Parâmetros
Retorna