Arcore google


Google выпустила ARCore — конкурента ARKit для Android

Уже много лет компания Google накапливает опыт в работе с дополненной реальностью. Она разрабатывает электронные контактные линзы, продаёт смарт-очки Glass и постоянно регистрирует ДР-технологии, ведя исследовательскую деятельность. Но самый важный проект на этом поле — платформа компьютерного зрения Tango, которая позволяет смартфонам и другим мобильным устройствам распознавать окружение для навигации, измерений и наложения графических данных.

Особую актуальность Tango обрела с релизом Apple ARKit. Внезапно весь прогрессивный мир понял, что главными устройствами дополненной реальности являются не очки, а именно смартфоны, уже купленные, привычные гаджеты, полезность которых не надо доказывать с нуля. Но в обычном виде Tango работает только со специальными модулями камер, дающими точность и особые возможности сканирования. Чтобы достойно ответить ARKit, Google нужно было «станцевать танго» с обычными смартфонами. Так появился ARCore.

Google представила предварительную версию платформы для создания приложений дополненной реальности ARCore. Она работает с уже выпущенными и анонсированными гаджетами на Android 7.0. Первыми смартфонами с поддержкой нового SDK стали Pixel и Galaxy S8 — характерно, что оба оснащены одинарными модулями камер, как и большинство актуальных смартфонов Apple. Для развития платформы американцы работают с несколькими производителями устройств, среди которых есть Samsung, Huawei, LG и ASUS. Цель Google — 100 миллионов совместимых устройств на рынке к концу тестирования, хотя это заявление выглядит странно, учитывая, что компания воздержалась от оглашения сроков.

Движок ARCore работает с Java/OpenGL, Unity и Unreal и сфокусирован на трёх вещах:

  • Отслеживание движения. Используя камеру телефона для наблюдения за точками на поверхностях объектов и данные инерциального датчика, ARCore определяет положение и ориентацию телефона при его движении. В результате виртуальные объекты точно закрепляются в пространстве.
  • Понимание окружающей среды. Для виртуальных объектов в дополненной реальности характерно размещение на полу или столе. ARCore может обнаруживать горизонтальные поверхности, используя те же функции, которые помогают отслеживать движения.
  • Оценка освещения. ARCore следит за условиями освещения вокруг и позволяет разработчикам естественно освещать виртуальные объекты, делая их более реалистичными.

Google также подчёркивает ведение работы над дополненной реальностью сразу в нескольких областях:

Наряду с ARCore мы инвестируем в приложения и сервисы, которые будут поддерживать разработчиков в создании отличного ДР-опыта. Мы разработали Blocks и Tilt Brush, чтобы каждый мог быстро создать отличный 3D-контент для использования в ДР-приложениях. Как мы уже упоминали на I/O, мы также работаем над Службой визуального позиционирования (VPS), которая позволит дополненной реальности в глобальном масштабе значительно превосходить настольную. И мы считаем, что интернет станет критически важным компонентом будущего дополненной реальности, поэтому также выпускаем прототипы браузеров для веб-разработчиков, чтобы они могли начать экспериментировать с ДР. Эти специальные браузеры позволяют создавать веб-сайты с поддержкой дополненной реальности и запускать их как на Android с ARCore, так и на iOS с ARKit.

Примеры дополненной реальности на ARCore доступны на специальной странице AR Experiments. Обсуждение SDK открыто на GitHub. Google также предлагает делиться идеями в социальных сетях через хештег #ARCore и обещает выделить собственных фаворитов.

Не пропускайте важнейшие новости о дополненной, смешанной и виртуальной реальности — подписывайтесь на Голографику в ВК, Twitter и Facebook! 

Далее: Google приглашает тестировать рекламный SDK для виртуальной реальности

А ещё у нас можно арендовать очки и аттракционы виртуальной и дополненной реальности.

Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.

holographica.space

GoogleARCore Namespace  |  ARCore  |  Google Developers

Summary

Enumerations

AnchorTrackingState{  StoppedTracking,  LostTracking,  Tracking} enum

The tracking state for an anchor.

FrameTrackingState{  TrackingNotInitialized = 0,  LostTracking,  Tracking} enum

The tracking state for an ARCore frame.

SessionConnectionState{  Uninitialized = 0,  Connected,  MissingConfiguration,  InvalidConfiguration,  UserRejectedNeededPermission,  DeviceNotSupported,  ConnectToServiceFailed} enum

Possible states for the ARCore session connection.

TrackableHitFlag{  None = 0,  PlaneWithinPolygon = 1,  PlaneWithinBounds = 2,  PlaneWithinInfinity = 4,  PointCloud = 8} enum

Flags representing categories of raycast hits.

Enumerations

AnchorTrackingState

AnchorTrackingState

The tracking state for an anchor.

Properties
LostTracking

The anchor is not currently being tracked but tracking may resume in the future.

This can happen if device tracking is lost or if the user enters a new space. When in this state the anchor GameObject is disabled since the transform could be very inaccurate.

StoppedTracking

ARCore has stopped tracking this Anchor and will never resume tracking it.

This typically happens because the anchor was created when the device's tracking state was diminished and then became further diminished or lost.

Tracking

The Anchor is being tracked and its transform is current.

FrameTrackingState

FrameTrackingState

The tracking state for an ARCore frame.

Properties
LostTracking

The motion tracking system has lost tracking.

This can happen for various reasons including poor lighting conditions or a lack of visually distinct features in the camera frame. ARCore will attempt to re-establish tracking, but the frame is invalid.

Tracking

The motion tracking system is tracking and the frame is valid.

TrackingNotInitialized

The motion tracking system is not initialized.

The frame is invalid.

SessionConnectionState

SessionConnectionState

Possible states for the ARCore session connection.

Properties
ConnectToServiceFailed

The ARCore session failed to connect for unknown reason.

Connected

The ARCore session is connected.

DeviceNotSupported

The ARCore session failed to connect because the device is not supported.

InvalidConfiguration

The ARCore session failed to connect because an invalid configuration was supplied.

MissingConfiguration

The ARCore session failed to connect because no configuration was supplied.

Uninitialized

The ARCore session has not been initialized.

UserRejectedNeededPermission

The ARCore session failed to connect because the user rejected at least one needed permission.

TrackableHitFlag

TrackableHitFlag

Flags representing categories of raycast hits.

Properties
None

This value is returned on a TrackableHit to indicate no collision occurred.

If you pass this into Raycast, you will not get any collision results.

PlaneWithinBounds

The collision is within the TrackedPlane's bounding box.

PlaneWithinInfinity

The collision is on the TrackedPlane, but not limited to the bounding box or polygon.

This acts as if the plane extends out to infinity.

PlaneWithinPolygon

The collision is within the the TrackedPlane's convex bounding polygon.

PointCloud

The collision is on points in the current frame's point cloud.

developers.google.com

tomthecarrot/arcore-for-all: Google ARCore for "unsupported" Android devices

Google ARCore for "unsupported" Android devices

See Experimental Branch

This branch is unlikely to work on most devices.Please check out the service mod branch of this repo to help us develop the latest experiment to bring ARCore to more devices. Thanks!

Summary

Google's ARCore developer preview for Android is awesome. Unfortunately, my Android phone (Samsung GS8+) is not on the supported list, and apps built with ARCore exit at start on my device. However, its hardware actually can run ARCore!

I modified the Android library to strip the ARCore device check, and ARCore is now working on the device.

Android Installation

In your Android project, simply replace the Google-provided arcore_client.aar with the one in this repo, and voilà! ARCore on any Android device.

Make sure to first install ARCore Service - "Preparing your Device" section of Google's instructions  

Unity Installation

In your Unity project, simply replace the Google-provided unitygar.aar (located in GoogleARCore/SDK/Plugins/) with the one in this repo, and voilà! ARCore on any Android device, within Unity.

Make sure to first install ARCore Service - "Preparing your Device" section of Google's instructions  

Requirements

  1. Capable Android Hardware - Since Google does not yet officially support more than a few devices, it's unknown which devices will actually work. My estimate is that devices from the past year should work, but it's currently unclear. Feel free to try and see if it works on your device, then let us know! There is a research document so we can identify necessary modifications.
  2. 64-bit Architecture - The library does not contain a build for 32-bit processors, as pointed out by @szugyi.

Disclaimer

Please keep in mind that (at the time of this writing) only 3 Android devices are officially supported by ARCore, so this hack might not work. I also take no responsibility for damage to your software. It's worth a try, though! ;)

Android Build Instructions

To modify the original ARCore AAR library, follow the below instructions. You will need a java class decompiler, such as CFR.

  1. Open a command line interface
  2. Unzip the AAR to a temporary directory: unzip arcore_client-original.aar -d aar-tmp
  3. Enter the temporary aar directory: cd aar-tmp
  4. Unzip classes.jar to a temporary directory: unzip classes.jar -d classes-tmp
  5. Enter the temporary classes directory: cd classes-tmp
  6. Enter the directory containing the SupportedDevices class: cd com/google/atap/tangoservice
  7. Decompile the SupportedDevices class: java -jar /path/to/cfr.jar SupportedDevices.class > SupportedDevices.java
  8. Open a text editor and delete return false from the end of isSupported()
  9. Compile the modified SupportedDevice class: javac -cp /path/to/sdk/platform/android.jar -source 1.7 -target 1.7 SupportedDevices.java
  10. Delete the Java source: rm SupportedDevices.java
  11. Change directory back to aar-tmp: cd ../../../../../
  12. Create a JAR from the modified classes directory: jar cvf classes.jar -C classes-tmp .
  13. Change directory back to repo root: cd ..
  14. Create an AAR from the modified aar directory: jar cvf arcore_client.aar -C aar-tmp .

After the above steps, you will have a modified arcore_client.aar with device verification stripped. Now you can replace the AAR in your project and build to any hardware-capable Android device!

Android (pre-Nougat) Build Instructions

The official library has a minimum SDK version of Android 7.0 (Nougat). See @kenfast's research for installing on pre-7.0.

Unity Build Instructions

Coming soon

Credit

Original library by GoogleModification by Thomas Suarez ("tomthecarrot")

github.com

GoogleARCore.Session Class Reference  |  ARCore  |  Google Developers

Represents an ARCore session, which is an attachment point from the app to the ARCore service.

Summary

Holds information about the global state for ARCore, manages tracking of Anchors and Planes, and performs hit tests against objects ARCore is tracking in the world.

Public static functions

CreateAnchor(Vector3 position, Quaternion rotation)

Creates an anchor in the current ARCore session.

Raycast(Ray ray, TrackableHitFlag filter, out TrackableHit hitResult)

bool

Performs a raycast against physical objects being tracked by ARCore.

Properties

Public static functions

CreateAnchor

Anchor CreateAnchor( Vector3 position, Quaternion rotation )

Creates an anchor in the current ARCore session.

Anchors a gameobject to a position/rotation in the Unity world relative to ARCore's understanding of the physical world. ARCore may periodically perform operations that affect the mapping of Unity world coordinates to the physical world; an example of such being drift correction. Anchors allow GameObjects to retain their physical world location when these operations occur.

Details
Parameters
position

The position to anchor.

rotation

The rotation to anchor.

Returns

A newly created anchor tracking position and rotation if successful, otherwise null.

Raycast

bool Raycast( Ray ray, TrackableHitFlag filter, out TrackableHit hitResult )

Performs a raycast against physical objects being tracked by ARCore.

Details
Parameters
ray

The starting point and direction of the ray.

filter

A filter bitmask where each TrackableHitFlag which is set represents a category of raycast hits the method call should consider valid.

hitResult A TrackableHit that will be set if the raycast is successful.
Returns

true if the raycast had a hit, otherwise false.

developers.google.com

Google ARCore Base  |  ARCore  |  Google Developers

The base module for Google ARCore plugin.

Summary

Enumerations

EGoogleARCoreAnchorTrackingState

EGoogleARCoreAnchorTrackingState

Describes the state of a GoogleARCoreAnchor's pose.

Properties
NotCurrentlyTracking

ARCore is not currently tracking this Anchor, but may resume tracking it in the future.

This can happen if device tracking is lost or if the user enters a new space. When in this state the pose of the anchor may be wildly inaccurate and should generally not be used.

StoppedTracking

ARCore has stopped tracking this Anchor and will never resume tracking it.

This happens either because the anchor was created when the device's tracking state was diminished and then lost, or because it was removed by calling UGoogleARCoreSessionFunctionLibrary::RemoveGoogleARAnchorObject

EGoogleARCorePlaneDetectionMode

EGoogleARCorePlaneDetectionMode

Describes what type of plane detection will be performed in ARCore session.

Properties
HorizontalPlane

Track for horizontal plane.

None

Disable plane detection.

EGoogleARCorePlaneTrackingState

EGoogleARCorePlaneTrackingState

An enum that describes the tracking state of an ARCore plane.

Properties
NotCurrentlyTracking

ARCore is not currently tracking this Plane, but may resume tracking it in the future.

StoppedTracking

ARCore has stopped tracking this Plane and will never resume tracking it.

Subsumed

This plane has been subsumed by another plane.

And will be marked as StoppedTracking in next frame.

Tracking

ARCore is tracking this Plane.

EGoogleARCorePoseType

EGoogleARCorePoseType

The type of pose that is supported to query on every frame.

Properties
CAMERA_COLOR

The back facing color camera.

DEVICE

The physical device.

EGoogleARCoreSessionStatus

EGoogleARCoreSessionStatus

Describes the Google ARCore session status.

Properties
NotStarted

Tracking session hasn't started yet.

NotTracking

Tracking session has started but hasn't got valid tracking data yet.

Tracking

Tracking session is currently tracking.

EGoogleARCoreSupportEnum

EGoogleARCoreSupportEnum

Describes whether Google ARCore is supported on a device.

Properties
NotSupported

Google ARCore is not supported.

Supported

Google ARCore is supported.

developers.google.com

GoogleARCore.Frame Class Reference  |  ARCore  |  Google Developers

Provides a snapshot of the state of ARCore at a specific timestamp associated with the current frame.

Summary

Frame holds information about ARCore's state including tracking status, the pose of the camera relative to the world, estimated lighting parameters, and information on updates to objects (like Planes or Point Clouds) that ARCore is tracking.

Properties

LightEstimate

Gets the current light estimate for this frame.

PointCloud

Get the ARCore device's point cloud for the current ARCore frame.

Pose

static Pose

Gets the pose of the device's camera in the world coordinate frame at the time of capture of the current frame.

Timestamp

static double

Gets the hardware timestamp of the current ARCore frame.

TrackingState

Gets the tracking state of the frame.

Public static functions

GetAllPlanes(ref ListTrackedPlane > planes)

void

Gets all TrackedPlane objects that have been detected in the session.
GetNewPlanes(ref ListTrackedPlane > newPlanes)

void

Gets planes newly detected in the current ARCore frame.

Properties

LightEstimate

static LightEstimate LightEstimate

Gets the current light estimate for this frame.

PointCloud

static PointCloud PointCloud

Get the ARCore device's point cloud for the current ARCore frame.

Pose

static Pose Pose

Gets the pose of the device's camera in the world coordinate frame at the time of capture of the current frame.

Timestamp

static double Timestamp

Gets the hardware timestamp of the current ARCore frame.

TrackingState

static FrameTrackingState TrackingState

Gets the tracking state of the frame.

Public static functions

GetAllPlanes

void GetAllPlanes( ref ListTrackedPlane > planes )

Gets all TrackedPlane objects that have been detected in the session.

Details
Parameters
planes

GetNewPlanes

void GetNewPlanes( ref ListTrackedPlane > newPlanes )

Gets planes newly detected in the current ARCore frame.

Details
Parameters
newPlanes

A list reference that to be filled with planes detected in the current frame.

developers.google.com

Google has announced ARCore, which brings augmented reality (AR) functionality to Android smartphones starting today. This is great news because you can immediately get started with Google’s developer preview of ARCore, which includes Unreal Engine support!

ARCore enables AR development across the Android ecosystem, giving developers the ability to make compelling AR experiences without the need for any additional hardware.

Today, the ARCore SDK supports the Google Pixel, Pixel XL, and the Samsung Galaxy S8 running Android 7.0 Nougat and above. As the developer preview is refined, Google is adding new devices, with a target of 100 million devices at launch.

We at Epic are working to empower developers to create amazing AR experiences using Unreal Engine, which is gaining deeper AR platform support by the day. Unreal Engine 4.18, coming in mid-October, is shaping up to be a major release for AR, with more mature ARKit support, along with early access support for ARCore.

“Augmented reality is the next step in the evolution of the smartphone, and Unreal Engine developers are already hard at work on great AR experiences. ARCore will help further drive AR adoption by empowering developers to build and ship cross-platform AR experiences. We encourage the Unreal community to check out today’s early access Unreal Engine 4 support for ARCore on GitHub as well as the preview coming in Unreal Engine 4.18.” - Mark Rein, Co-Founder and Vice President, Epic Games

Let’s talk a bit more about how ARCore works. There are three main components that help transform how mobile users see the world: motion tracking, environmental understanding and light estimation.

Motion Tracking

As your mobile device moves through the world, ARCore combines visual data from the device's camera and inertial measurements from the device's IMU to estimate the pose (position and orientation) of the camera relative to the world over time. This process, called visual inertial odometry (VIO), lets ARCore know where the device is relative to the world around it.

By aligning the pose of the virtual camera that renders your 3D content with the pose of the device's camera provided by ARCore, virtual content is rendered from the correct perspective. Rendered virtual images are then overlayed on top of the image obtained from the device's camera, making it appear as if the virtual content is part of the real world.

Environmental Understanding

ARCore is constantly improving its understanding of the real world environment by detecting feature points and planes. Feature points are visually distinct features in the captured camera image that ARCore can recognize even when the camera's position changes slightly. ARCore estimates pose changes by triangulating on these feature points between successive frames.

ARCore looks for clusters of feature points that appear to lie on common horizontal surfaces, like tables and desks, and makes these surfaces available to your app as planes. ARCore can also determine each plane's boundary and make that information available to your app. You can use this information to place virtual objects resting on flat surfaces, such as a character running around on the floor or a table.

Light Estimation

Finally, through light estimation ARCore can detect information about the lighting of its environment and provide you with the average intensity of a given camera image. This information enables you to light your virtual objects under the same conditions as the environment around them, increasing the sense of realism.

Without further ado, we encourage you to check out the ARCore developer preview and start experimenting today. Keep an eye out for more learning resources and supporting content for ARCore development as we get closer to the 4.18 release. We can’t wait to see your work, so if you decide to share it, tag us using @UnrealEngine and #UE4 on Twitter, Facebook or Instagram so that we can share it, too!

www.unrealengine.com


Смотрите также