sceneview-android
sceneview-android copied to clipboard
Sample Project of Google Cloud Anchor not working with New version 2.0.2 but its working with 0.9.5 scenview
We are always getting session.canHostCloudAnchor(sceneView.cameraNode) as false if we are setting cloud anchor enable then also not working bellow is some config and implemenation code so plz guide us.
configureSession { _, config ->
config.planeFindingMode=Config.PlaneFindingMode.HORIZONTAL_AND_VERTICAL
config.depthMode=Config.DepthMode.AUTOMATIC
config.cloudAnchorMode = Config.CloudAnchorMode.ENABLED
}
when (mode) {
Mode.HOME -> {}
Mode.HOST -> {
val session = sceneView.session ?: return
if (!session.canHostCloudAnchor(sceneView.cameraNode)) {
Toast.makeText(context, R.string.insufficient_visual_data, Toast.LENGTH_LONG)
.show()
return
}
val anchor = cursorNode.createAnchor() ?: return
cloudAnchorNode = CloudAnchorNode(sceneView.engine, anchor).apply {
host(session) { cloudAnchorId, state ->
mode = if (state == CloudAnchorState.SUCCESS && cloudAnchorId != null) {
editText.setText(cloudAnchorId)
Mode.RESET
} else {
Toast.makeText(context, R.string.error_occurred, Toast.LENGTH_LONG)
.show()
Mode.HOST
}
}
}
sceneView.addChildNode(cloudAnchorNode!!)
actionButton.apply {
setText(R.string.hosting)
isEnabled = true
}
}
Mode.RESOLVE -> {
val session = sceneView.session ?: return
CloudAnchorNode.resolve(
sceneView.engine,
session,
editText.text.toString()
) { state, node ->
mode = if (!state.isError && node != null) {
cloudAnchorNode = node
sceneView.addChildNode(node)
Mode.RESET
} else {
Toast.makeText(context, R.string.error_occurred, Toast.LENGTH_LONG).show()
Mode.RESOLVE
}
}
actionButton.apply {
setText(R.string.resolving)
isEnabled = false
}
}
Mode.RESET -> {
cloudAnchorNode?.detachAnchor()
mode = Mode.HOME
}
}
Here is the old and new code urls
Old Version which working https://github.com/wh173d3v11/ArCloudAnchorSample_MultipleAnchors_HostAndResolve
New Version where its not working https://github.com/SceneView/sceneview-android/tree/main/samples/ar-cloud-anchor
We implementing both implemention in project with one version its working or with other its not working so I think there is no configrational issue like API enable and manifest implementation
Hi There, The issue remains open, SADLY!!! I am facing a similar issue with this new version 2.0.2 to run Google Cloud Anchor piece of code. Please make a fix as soon as possible. Regards
Anyone found any working solution!!
@ThomasGorisse Can you plz check for this version, At my end also Google Cloud anchor is not working for newer version.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.