WVR_DestroyTrackableMarker

WVR_EXPORT WVR_Result WVR_DestroyTrackableMarker(WVR_Uuid uuid)

Function is used to destroy a trackable marker.

Developers use this API to destroy an trackable marker with input uuid WVR_Uuid.

Version
API Level 13
Parameters
  • uuid: the trackable marker with input uuid WVR_Uuid that developers would like to destroy
Return Value
  • WVR_Success: Destroy a trackable marker successfully.
  • others: WVR_Result mean failure.

How to use

Sample function:

#include <wvr/wvr_marker.h>

if (WVR_StartMarker() == WVR_Success) {
    //
    // start marker observer
    if (WVR_StartMarkerObserver(WVR_MarkerObserverTarget_Aruco) == WVR_Success) {
        // Start Aruco marker observer related resources success

        if (WVR_StartMarkerDetection(WVR_MarkerObserverTarget_Aruco) == WVR_Success)) {
            // Start detecting the Aruco marker, and the Aruco marker detection will be WVR_MarkerObserverState_Detecting


            uint32_t count = 0;
            int result = WVR_GetArucoMarkers(0, &count, WVR_PoseOriginModel_OriginOnGround, nullptr);

            if (result==0 & count!=0) {
                std::vector<WVR_ArucoMarker> markers(count);
                int ret = WVR_GetArucoMarkers(count, &count, WVR_PoseOriginModel_OriginOnGround, markers.data());
                if (ret != WVR_Success) {
                    LOGE("%s(%d) WVR_GetArucoMarkers failed ret=(%d)", __FUNCTION__, __LINE__, ret);
                    return;
                }
                for (int i = 0 ; i < count ; i ++) {
                    // get the Aruco markers

                    // collect createInfo and create trackable marker
                    WVR_TrackableMarkerCreateInfo info = {markers[i].uuid, "test name"};
                    WVR_CreateTrackableMarker(&info);

                    // destroy trackable marker with its uuid
                    WVR_DestroyTrackableMarker(markers[i]);
                }
            }

            // Stop detecting Aruco marker
            if (WVR_StopMarkerDetection(WVR_MarkerObserverTarget_Aruco) == WVR_Success)) {
                // The Aruco marker detection will be WVR_MarkerObserverState_Idle
            }
        }

        // release Aruco marker observer related resources success
        if (WVR_StopMarkerObserver(WVR_MarkerObserverTarget_Aruco) == WVR_Success) {

        }
    }

    WVR_StopMarker();
} else {
    // start marker failed!
}