Coder Social home page Coder Social logo

simon-heinen / droidar Goto Github PK

View Code? Open in Web Editor NEW
225.0 51.0 275.0 51.53 MB

DroidAR Mobile Locationbased Augmented Reality Framework for Android

License: GNU General Public License v3.0

Shell 0.04% C 2.07% Java 97.22% Makefile 0.67% Batchfile 0.01%

droidar's Introduction

DroidAR

DroidAR is a framework for Augmented Reality on Android. Location based AR and marker based AR are both possible. Also read the wiki articles (or the FAQ) for more detailed information about DroidAR.

This framework can be used for many different scenarios, there are already some demo applications available (check the videos below). For the latest news about DroidAR also visit our blog.

DroidAR is available under commercial license (contact us at "info (at) bitstars.com" for more details) and can be downloaded and used for non commercial use under the GNU GPL v3 ( http://www.gnu.org/licenses/gpl.html ) license.

Register here to get notified for important news

If you want to you can support the opensource development of this project at https://www.gittip.com/bitstars

Tutorials

Contributing to the code

I would be great if you want to help working on the code, fixing bugs, refactorings and adding you own ideas. Contributing to DroidAR is easy on GitHub (that's the main reason why we switched from Google Code).

  1. Click "Fork", check out your fork and do your changes in your local copy of DroidAR
  2. When you are done commit all changes to you online copy
  3. Send a Pull-Request to via the Github webpage (see Pull-Requests for more infos).
  4. I will review your changes and merge them in the main repository so that everyone can use them.

There are some rules to allow an easy integration of your code and changes:

  • You have to use the default code formatting style of Eclipse
  • You should enable auto formatting whenever you save a file. This way you can't forget to format: Go to Preferences->Java->Editor->Save Actions and enable "Format source code" and "Organize imports".

Now when you save the code is formatted automatically. This will avoid commit conflicts and changes in the code can be reviewed more easily.

Demo Videos

Link to the DroidAR video

Link to the DroidAR video Link to the DroidAR video Link to the DroidAR video Link to the DroidAR video Link to the DroidAR video Link to the DroidAR video

Details

Location based AR and marker based AR are both possible. This framework can be used for many different scenarios, there are already some demo applications available.

  • Footstep recognition & Indoor AR
  • Locationbased Gaming & Crowdsourcing Framework

Since the initial creation of the prototype of an augmented reality development tool in 2010, it was continuously improved and new features were added. The created development tool (SDK) enables other programmers to integrate augmented reality in their own applications. We provided the SDK without charge with an Open Source License for non-commercial projects. It has since evolved into one of the most used open source augmented reality SDKs for the Android platform. The regular feedback from the developers as well as its application in seminars and practical project seminars, where the SDK was used as basis for their projects, greatly aided its improvement. The framework meets and raises interests and is currently being used by numerous developers around the globe. The recorded numbers of the site are about 1500 website visits per month with an increasing tendency. Also, 83% of the about 3200 developers return to the website following their initial visit.

Also take a look at the DroidAR FAQ and the other Wiki pages

Installation

A new instructions video is comming soon. You can watch the old one here:

Link to the DroidAR video

githalytics.com alpha

Applications using DroidAR

(If you use DroidAR in your application you can write us a mail to be added hiere)

Temple Treasure

CHIO Aachen

DroidAR 2 (currently closed source)

  • DroidAR 2 has a plugin for the free to use and fully open source rendering engine jMonkey which allows rapid testing on the desktop and full customization for any application scenario
  • The SDK combines sensor-based, location-based and SLAM tracking, everything offline on the phone
  • Combinable detection techniques: Markers, 2d images, 3d objects, geolocations and gesture detection
  • Strucutre from motion, 3D geometry reconstruction and texture projection
  • Multiplayer components for adhoc network sessions between users and mixed AR+VR scenarios

Contact us for more details

droidar's People

Contributors

marmat avatar mosworld avatar pascal66 avatar rafaisen avatar rtorres-sibs-mtc avatar simon-heinen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

droidar's Issues

ArActivity Objects goes away from the screen and disappears on swipe

I was following this video: https://www.youtube.com/watch?v=r10C1Wn2SGM
And instead of using the DefaultARSetup I am using the DebugSetup.
Now when the ArActivity starts up, the Objects slowly gets away from the screen, when it's totally out of the screen I could not see it even if I point the camera to different directions.

I started the ArActivity again, then swipes the screen, the Objects disappears.

Any thoughts?

Device: Android 4.3

Error while importing to ADT Eclipse

Hi, I would like to use your library for an academic project at the "Accademia di Carrara" in Italy.
I've got problem during the import of the library in ADT Eclipse, I get an error window and all the imported projects come with an exclamation mark on the project except DroidAR wich has an error in the system.EventManager class at line 123, the error says: "TYPE_ROTATION_VECTOR cannot be resolved or is not a field"
But maybe this last error is caused by bad importing in ADT.

Thank you.

I attach an image and I write you down what I get:

(https://cloud.githubusercontent.com/assets/2782780/2625893/dafb5d8e-bdae-11e3-94ee-dd4b8c5b8dc6.png)

eclipse.buildId=v22.3.0-887826
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=it_IT
Framework arguments: -product com.android.ide.eclipse.adt.package.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product com.android.ide.eclipse.adt.package.product

Error
Sun Apr 06 19:03:19 CEST 2014
New Project Wizard failed

java.lang.reflect.InvocationTargetException
at
com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:677)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.access$0(NewProjectCreator.java:590)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator$3.execute(NewProjectCreator.java:400)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: Java Model Exception: Core Exception [code 274] Could not set the project description for 'ModelLoaderAdapters' because the project description file (.project) is out of sync with the file system.
at org.eclipse.jdt.internal.core.ProjectReferenceChange.updateProjectReferencesIfNecessary(ProjectReferenceChange.java:113)
at org.eclipse.jdt.internal.core.ChangeClasspathOperation.classpathChanged(ChangeClasspathOperation.java:59)
at org.eclipse.jdt.internal.core.SetClasspathOperation.executeOperation(SetClasspathOperation.java:74)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793)
at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3095)
at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3057)
at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3110)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.setupSourceFolders(NewProjectCreator.java:1400)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createEclipseProject(NewProjectCreator.java:767)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:660)
... 6 more

Marker Detection Linux Installation

Hello,

First of all thank you for this fantastic project!

Im a member of a mobile development students group, and we are developing an Android App as final course project. We are very interested to use droidAR as a central part of this application, but we have serious troubles to install the Marker in linux.

We can't propertly follow all the steps in the guide:
http://code.google.com/p/droidar/wiki/Markerdetection

It was possible to try this to steps for early noobs?:

  1. Load the external tool configuration "Build AR.launch" into eclipse and edit the environment variables to match your cygwin root folder and your NDK root folder. The cygwin path is a windows path and the ndkdir is a unix path. Keep this in mind when using spaces.

Cywing is not necesary for Linux...

  1. ยฟIn the Build AR.lauch it will be correct this part? (if my android-ndk-r4-crystax was on usr/local/android-ndk-r4-crystax )
    mapAttribute key="org.eclipse.debug.core.environmentVariables
    mapEntry key="CYGWIN_PATH" value="C:\cygwin
    mapEntry key="NDKDIR" value="/usr/local/android-ndk-r4-crystax/

  2. ยฟHow can compile the library using the external tool configuaration?

Thank you!

GoogleMapsSupport

Hello,
I'm trying to use the GoogleMapsSupport, but it doesn't show the map. I imported the GoogleMapsSupport into eclipse, and changed the file GoogleMapsKey.java with my key. Also changed to Google APIs 17. I didn't change anything else.
When I ran the application, I got the following error:

03-27 18:57:13.412: W/System.err(10316): IOException processing: 26
03-27 18:57:13.412: W/System.err(10316): java.io.IOException: Server returned: 3
03-27 18:57:13.412: W/System.err(10316): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
03-27 18:57:13.412: W/System.err(10316): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
03-27 18:57:13.412: W/System.err(10316): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
03-27 18:57:13.412: W/System.err(10316): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
03-27 18:57:13.412: W/System.err(10316): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
03-27 18:57:13.412: W/System.err(10316): at java.lang.Thread.run(Thread.java:856)

I searched in internet, but the solutions I found say that the problem is with the key. I ran the applicacion with USB. My SHA1 fingerprint works fine with other google maps projects.

What can I do?
Thank you a lot,
Isaac

Video Plan

Hello, do you can explain how i can create video plan with droidar ?

Camera GPS Position

How do I update the GPS position of the camera?

I see a method to get it's GPS position, but no set. I also see in the demos that the camera can be moved via buttons (Set Pos A, Set Pos B, etc).

How do I achieve this?

EDIT: I'd like the camera to move as the user moves around (in the real world with her device). What's the most appropriate solution for this?

GeoObj not displayed

Hi guys,

I have 3 devices for test:

  • Nexus 7 Wifi 2013 (Android 4.3)
  • Samsung GT-S5310B (Android 4.1.2)
  • Samsung Galaxy Tab 2 (4.2.2)

This is my Setup:

import geo.GeoObj;
import gl.Color;
import gl.CustomGLSurfaceView;
import gl.GL1Renderer;
import gl.GLCamera;
import gl.GLFactory;
import gui.GuiSetup;

import java.util.List;

import commands.Command;

import system.EventManager;
import system.Setup;
import util.Log;
import util.Vec;
import worldData.Entity;
import worldData.Obj;
import worldData.SystemUpdater;
import worldData.UpdateTimer;
import worldData.Updateable;
import worldData.Visitor;
import worldData.World;
import actions.ActionCalcRelativePos;
import actions.ActionMoveCameraBuffered;
import actions.ActionRotateCameraBuffered;
import actions.ActionWaitForAccuracy;
import android.R;
import android.app.Activity;
import android.location.Location;

public class ArgumentedRealitySetup extends Setup {

    protected static final int ZDELTA = 5;
    private final GLCamera camera;
    private final World world;
    private final ActionCalcRelativePos gpsAction;
    private List<MyObjects> objs;

    private ActionWaitForAccuracy minAccuracyAction;

    public ArgumentedRealitySetup() {
        camera = new GLCamera();
        world = new World(camera);
        gpsAction = new ActionCalcRelativePos(world, camera);

    }

    @Override
    public void _a_initFieldsIfNecessary() {

    }

    @Override
    public void _b_addWorldsToRenderer(GL1Renderer renderer, GLFactory objectFactory, GeoObj currentPosition) {

        objs = Applic.getInstance().getMyObjects();
        for (MyObjects obj : objs) {

            Location l = new Location("");
            l.setLatitude(obj.getLatitude());
            l.setLongitude(obj.getLongitude());
            Obj o = new GeoObj(l);
            o.setComp(objectFactory.newDiamond(Color.red()));
            o.setComp(new Entity() {

                private Updateable p;
                private float waitTimeInMilliseconds = 1000;
                UpdateTimer timer = new UpdateTimer(waitTimeInMilliseconds, null);

                @Override
                public boolean accept(Visitor visitor) {
                    return false;
                }

                @Override
                public boolean update(float timeDelta, Updateable parent) {
                    p = parent;
                    if (timer.update(timeDelta, parent)) {
                        // true once a second, do the calculation here:
                        float distanceOfGeoObjToUser = Vec.distance(((GeoObj) p).getVirtualPosition(), world.getMyCamera().getPosition());
                        // do something with the distance e.g. update a
                        // corresponding Android UI element
                    }
                    return true;
                }

                @Override
                public void setMyParent(Updateable parent) {
                    this.p = parent;
                }

                @Override
                public Updateable getMyParent() {
                    return p;
                }
            });

            world.add(o);
        }

        renderer.addRenderElement(world);
    }

    @Override
    public void _c_addActionsToEvents(EventManager eventManager, CustomGLSurfaceView arView, SystemUpdater updater) {
        arView.addOnTouchMoveListener(new ActionMoveCameraBuffered(camera, 5, 25));

        ActionRotateCameraBuffered rot = new ActionRotateCameraBuffered(camera);
        updater.addObjectToUpdateCycle(rot);
        eventManager.addOnOrientationChangedAction(rot);

        eventManager.addOnTrackballAction(new ActionMoveCameraBuffered(camera, 5, 25));
        minAccuracyAction = new ActionWaitForAccuracy(getActivity(), 24.0f, 10) {
            @Override
            public void minAccuracyReachedFirstTime(Location l,
                    ActionWaitForAccuracy a) {

            }
        };
        eventManager.addOnLocationChangedAction(minAccuracyAction);
    }

    @Override
    public void _d_addElementsToUpdateThread(SystemUpdater updater) {
        updater.addObjectToUpdateCycle(world);
    }

    @Override
    public void _e2_addElementsToGuiSetup(GuiSetup guiSetup, Activity activity) {

        guiSetup.addViewToTop(minAccuracyAction.getView());

        guiSetup.addImangeButtonToRightView(R.drawable.arrow_up_float, new Command() {
            @Override
            public boolean execute() {
                camera.changeZPositionBuffered(+ZDELTA);
                return false;
            }
        });
        guiSetup.addImangeButtonToRightView(R.drawable.arrow_down_float, new Command() {
            @Override
            public boolean execute() {
                camera.changeZPositionBuffered(-ZDELTA);
                return false;
            }
        });

    }

}

This code show the diamonds only in Nexus 7. The other devices dont show nothing.

Behaviour Not As Expected

I've spawned an arrow object at a gps location. I have also used a location listener to move the GLCamera around using the current GPS location of the device.

What I'd expect is for the arrow to remain where it is, and for the camera to "see" the object as I move around it.

However, what I get is the object seemingly remaining in the same position relative to the camera, and therefore I am unable to "move around" my arrow,

Here is the code I am using:

        @Override
        public void addObjectsTo(GL1Renderer renderer, World world,
                GLFactory objectFactory) {
            GeoObj locationObject = EventManager.getInstance().getCurrentLocationObject();

            if (locationObject != null) {                   
                double latitude = 54.62614;
                double longitude = -1.28055;
                double altitude = 0;

                GeoObj geoObj = new GeoObj(latitude, longitude, altitude);
                MeshComponent arrow = objectFactory.newArrow();

                geoObj.setComp(arrow);

                world.add(geoObj);
            }
        }

        @Override
        public void _c_addActionsToEvents(EventManager eventManager,
                CustomGLSurfaceView arView, SystemUpdater updater) {
            super._c_addActionsToEvents(eventManager, arView, updater);
            eventManager.addOnLocationChangedAction(new LocationEventListener() {

                    @Override
                    public boolean onLocationChanged(Location location) {
                        GeoObj locationObject = new GeoObj(location.getLatitude(), location.getLongitude(), location.getAltitude());                            
                        camera.setGpsPos(locationObject);

                        return true;
                    }
                });
        }
    });     

Null Pointer Exception - Nexus 7 2012 Version

Just leaving a message, there's an issue with Nexus7's while using droidar following the basic example video.

The Camera View class needs to be specifically told to open the camera at 0 for a nexus 7 or it will fire off an NPE.

myCamera = Camera.open(0);

I would do it but I haven't looked much into actually using Github yet and wouldn't want to break anything :P

Camera is flipped 90 degrees

Hi I'm trying the demo in a tablet device. When the activity starts the camera is flipped 90 degrees. The layout seems fine.

Method addObjectsTo(World, GLFactory) must override or implement a supertype

Hello! I'm trying to use your library for my bachelor degree, and seem to have some issues regarding the demo that you've posted.
I'm trying to test the solar system, placed at 10m distance from the user, and I keep getting this error. If I correct the error, then this part of code:
@OverRide
public void addObjectsTo (World world, GLFactory objectFactory) {
//GeoObj o = new GeoObj();
// o.setComp(objectFactory.newArrow());
world.add(objectFactory.newSolarSystem(new Vec(10,0,0)));
}
is never used and the app isn't doing anything. The following screenshot shows what I can see on the display with the errors corrected.
screenshot_2014-07-16-13-10-50

The error I get is this:

Multiple markers at this line
- Method breakpoint:Main [entry] - addObjectsTo(World, GLFactory)
- The method addObjectsTo(World, GLFactory) of type new DefaultARSetup(){} must override or implement a supertype

I read some articles saying that it might be a compatibility issue, and to try it with compiler version 1.6 and the project build target to be Android 4.0.3. I tried this, and didn't worked. I've tried a couple more versions, and still nothing.
Could you help me regarding this issue?
Thank you!

P.S. Keep up the good work :)

Is my phone fitting?

Hi Simon, first of all this is a great job.
My phone is not so much cool, it just has GPS and accelerometer:
http://www.mediacomeurope.it/ZeusInc/PressRoom/Documents/M-PPG700.pdf

Can i use geolocation and 3d positioning objects somehow? I downloaded the latest version and built your sample code with solar system, it ran without errors but all i can see is the camera and a cross, no 3d model at all and it says position accuracy 2% .

Thank you so much!

3d objects from ModelLoaderAdapters cannot be seen in the camera view

tested : Samsung galaxy note 10.1 tab

additional information:

Hi, I have tried ModelLoaderAdapters to draw 3D external 3D objects. I downloaded required libgdx projects from http://libgdx.googlecode.com/svn and compiled and tested on samsung note 10.1 tab. I am able to run the application and it shows me camera view and and even red and green axis. But none of the models are shown. However I downloaded and tried .apk file from http://droidar.googlecode.com/svn/trunk/ModelLoaderAdapters/bin/ModelLoaderAdapters.apk and it worked perfectly. What might be the problem of this case that I dont see 3d objects?
Thanks in advance
Heli
p.s. I submitted this as an issue in googlecode as well.

Android Studio

Hi ,

How to import this library in Android Studio. I have tried to clone the code and manually the add the gradle files. However it giving a lot of error of classes not able to find.

import geo.GeoObj;
import gl.Color;
import gl.CustomGLSurfaceView;
import gl.GL1Renderer;
import gl.GLCamera;
import gl.GLFactory;
import gl.scenegraph.MeshComponent;
import gl.scenegraph.Shape;
import gui.GuiSetup;
import gui.InfoScreenSettings;
import system.ErrorHandler;
import system.EventManager;
import system.Setup;
import util.Vec;
import worldData.Obj;
import worldData.SystemUpdater;
import worldData.World;
import actions.Action;
import actions.ActionCalcRelativePos;
import actions.ActionMoveCameraBuffered;
import actions.ActionRotateCameraBuffered;

I have tried adding the prefix de.rwth too but it didn't worked out. Its also giving errors in de.rwth.setups.CollectItemsSetup Class. Any body can help me out?.

Positioning external .obj 3D objects on Marker

I am using ModelLoaderAdapter, ARMarker along with DroidAR to load external .obj models. The model is loaded fine long with its texture but is not positioned on the Marker. Loading a simple cube positions it fine on the Marker but in the same code when I replace the cube with a .obj model the positioning goes off. I tried manually positioning the object by creating a Vec() object for position and rotation but couldn't position it correctly on the Marker (also not sure if this is the correct way to do it).

Following is a snippet of code being used (trimmed for brevity):

public class MyExternalModelSetup extends MarkerDetectionSetup {
        private MarkerObjectMap mMarkerObjectMap; 

         //since the external model is being loaded asynchronously we don't have it yet with us to load into the markerobject map hence store the map in a local variable for later use
    @Override
    public void _a3_registerMarkerObjects(MarkerObjectMap markerObjectMap) {
        mMarkerObjectMap = markerObjectMap;
    }

        //loading the external model in this method since it gives a renderer object to work with which is required while loading an external object
    @Override
    public void _b_addWorldsToRenderer(GL1Renderer renderer,
            GLFactory objectFactory, GeoObj currentPosition) {
        renderer.addRenderElement(world);
        GDXConnection.init(myTargetActivity, renderer);

//once the model is loaded put it in the markerobjectmap thus associating it with a markerid
        new ModelLoader(renderer, mFileName, mTextureName) {
            @Override
            public void modelLoaded(MeshComponent gdxMesh) {
                mMarkerObjectMap.put(getSimpleMeshPlacer(mMarkerId, gdxMesh, camera));
            }
        };
}

    @Override
    public void _c_addActionsToEvents(EventManager eventManager,
            CustomGLSurfaceView arView, SystemUpdater updater) {
        arView.addOnTouchMoveListener(new ActionMoveCameraBuffered(camera, 5, 25));
        Action rot = new ActionRotateCameraBuffered(camera);
        updater.addObjectToUpdateCycle(rot);
        eventManager.addOnOrientationChangedAction(rot);
        eventManager.addOnTrackballAction(new ActionMoveCameraBuffered(camera, 1, 25));

    }

    private SimpleMeshPlacer getSimpleMeshPlacer(int markerId, MeshComponent mesh, GLCamera c) {
        SimpleMeshPlacer meshPlacer = new SimpleMeshPlacer(markerId, mesh, c) {
            boolean firstTime = true;

            @Override
            public void setObjectPos(Vec positionVec) {
                if (firstTime) {
                    firstTime = false;
            myTargetMesh.addChild(GLFactory.getInstance().newCoordinateSystem());
                    Obj aNewObject = new Obj();
                    aNewObject.setComp(myTargetMesh);
                    world.add(aNewObject);
                }
                myTargetMesh.setPosition(positionVec);
            }

            @Override
            public void setObjRotation(float[] rotMatrix) {
                if (myTargetMesh != null) {
                    myTargetMesh.setRotationMatrix(rotMatrix);
                }
            }
        };
        return meshPlacer;
    }   
}


public class SimpleMeshPlacer extends BasicMarker {
    protected MeshComponent myTargetMesh;

    public SimpleMeshPlacer(int id, MeshComponent mesh, GLCamera camera) {
        super(id, camera);
        myTargetMesh = mesh;
    }

    @Override
    public void setObjRotation(float[] rotMatrix) {
        myTargetMesh.setRotationMatrix(rotMatrix);
    }

    @Override
    public void setObjectPos(Vec positionVec) {
        myTargetMesh.setPosition(positionVec);
    }
}   

What is that I am doing wrong here? Please help.

GL objects static on screen

Hey, I have been using your library and I have come across a issue with a few devices. On the Galaxy tab 2 (10.1) and Nexus 5 device and some Nexus 7 devices I have seen that the GL images seem to be static on the screen and do not move with the device. The two images below is what I see when trying to use your example setups StaticDemoSetup.java and PlaceObjectsSetupTwo.java on the Galaxy tab 2. Any direction on how to fix this?

image_one
^^ Above image from your example project "Demo Setup" Note: there is a line that goes from the top of the screen to the center then runs out on right its a little hard to see but that image stays on the screen.

image_two
^^ Above image from your example project "Placing Objects 2"

OutOfMemoryException

I am playing around with your awesome lib and i came across this error.
OutOfMemory Exception ( I will try to add some logs )
What i am doing is that i get 5 icons from the camera folder and i pass them from the MainActivity to the Setup class as bitmaps.
After that i use this code to create MeshComponents
MeshComponent imageMesh = GLFactory.getInstance().newTexturedSquare(
"icon" + scounter, bitmap);

I get this error when trying to load the second image.
I have overcame this error by commenting out that line
texture = TextureManager.getInstance().resizeBitmapIfNecessary(texture);
which is at gl.textures.textureShape. textureShape constructor.
It seems to me that it always tries to recreate the bitmap resulting in OutOfMemory error.

Add ar camera in custom layout

Hello,

Im trying to add DroidAR Framework in my app but i need to place the CameraView in my custom layout. Any help?

3D Model at Geo Location

Hi, Iโ€™m working on the development of an outdoor mobile AR application for android system, oriented to augmented visualization of an historical archaeological site, from an aerial point of view (allowed by using a remotely piloted and free to fly UAV device over the site).
We oriented our research to location-based tracking solutions using GPS and sensors in order to obtain the correct registration of the virtual 3D models on the real scenario. More precisely, we need to position the model in a specific GPS location and with a certain orientation, according to the user's point of view. In fact, if we move around the model, we should see its different perspectives on the handheld device screen.

Therefore our aim will be to register the model in the real scene, on the basis of the six parameters coming from GPS and sensors of the drone (latitude, longitude, altitude, yaw, pitch and roll).
The analysis of state of art regarding outdoor and location-based AR scenarios led us to the open source framework DroidAR, but in the proposed demos I didn't find nothing that will work fine according to our specific task. Nothing helps me to register a 3d model at a geo location, leaving the user free to move around it, and accordingly updating the rendering of the object on the scene. Is there any example that works fine in order to reach this purpose? Have you any suggestions?

Thanks in advance

DroidAR not working on several devices

Hi, I'm working project with droidar. I'm currently use Samsung galaxy mini and it works perfectly to show image and all sensor. Then I'm trying using Samsung galaxy mini 2 and Samsung Galaxy S3 Mini. 2.3 on galaxy mini and mini 2, and 4.2 on galaxy S3 mini.

Then I try to use Samsung galaxy tab 2 wifi only with 4.1.2 android version. It shown the sensor wont work it's only a camera. Beside it's shown an image but only like a picture stuck in the screen. it not move whenever I move my device.

I already change the Setup.java into false but it not working. Link [ https://code.google.com/p/droidar/issues/detail?id=74#c7 ]

The following code is

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

    Button b = new Button(this);
    b.setText("Click me to Start the AR Action");
    b.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            ArActivity.startWithSetup(MainActivity.this, new DefaultARSetup(){

                @Override
                public void addObjectsTo(GL1Renderer renderer, World world,
                        GLFactory objectFactory) {
                    world.add(objectFactory.newSolarSystem(new Vec(10, 0, 0)));
                    }

            });
        }
    });

    setContentView(b);
}

Thanks in advance

NoClassDefFoundError

I've managed to build and run the droidar as an executable to my device.

However, after trying to use the droidar project as a library in a custom android project, I receive a NoClassDefFound error. I've tried a number of possible fixes after searching the web, but it's still not working.

Current location was unknown, cant do steps

package mobi.esys.argeocamere;

import geo.GeoObj;
import gl.GL1Renderer;
import gl.GLFactory;
import system.ArActivity;
import system.DefaultARSetup;
import util.Vec;
import worldData.Entity;
import worldData.Obj;
import worldData.UpdateTimer;
import worldData.Updateable;
import worldData.Visitor;
import worldData.World;
import android.app.Activity;
import android.location.Location;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Button button = new Button(this);
    button.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            ArActivity.startWithSetup(MainActivity.this,
                    new DefaultARSetup() {

                        @Override
                        public void addObjectsTo(GL1Renderer renderer,
                                final World world, GLFactory objectFactory) {
                            Location l = new Location("");
                            l.setLatitude(123);
                            l.setLongitude(123);
                            Obj o = new GeoObj(l);
                            o.setComp(objectFactory.newCube());
                            o.setComp(new Entity() {

                                private Updateable p;
                                private float waitTimeInMilliseconds = 1000;
                                UpdateTimer timer = new UpdateTimer(
                                        waitTimeInMilliseconds, null);

                                @Override
                                public boolean accept(Visitor visitor) {
                                    return false;
                                }

                                @Override
                                public boolean update(float timeDelta,
                                        Updateable parent) {
                                    p = parent;
                                    if (timer.update(timeDelta, parent)) {
                                        // true once a second, do the
                                        // calculation here:
                                        float distanceOfGeoObjToUser = Vec.distance(
                                                ((GeoObj) p)
                                                        .getVirtualPosition(),
                                                world.getMyCamera()
                                                        .getPosition());
                                        Log.d("dist",
                                                String.valueOf(distanceOfGeoObjToUser));
                                    }
                                    return true;
                                }

                                @Override
                                public void setMyParent(Updateable parent) {
                                    this.p = parent;
                                }

                                @Override
                                public Updateable getMyParent() {
                                    return p;
                                }
                            });
                            world.add(o);
                        }
                    });
        }
    });
    setContentView(button);
}

}

Add and update edit text in droid ar

Hi,
This may seem a stupid question to ask but I am unable to figure it out so I am going to ask it . I want to add a 2d text box , at a defined location. So lets say the user points at a particular location, I want to add a button on the camera view , and when the user clicks it it will ask him what object he wants at that location. After he selects the type of object I will display it. I also want to refresh the data displayed(eg:update the points). I looked at GeoPos. I know I have to use it. I also looked at place objects which adds a 3d component. I want to add a 2d component and update the data. Could you please provide some pointers as to how to do this?
Also I see deprecated methods with no javadoc telling us what to use instead. For example:void gl.CustomGLSurfaceView.addOnTouchMoveAction(TouchMoveListener action)
Edit: I tried out the place object demo. I stil dont get how this is entirley supposed to work. I add an object at a particular loaction but when I go to another room , which is to the right of the object I can still see the old object. Whats the best way to place objects using latitude and longitude?

Model loader cannot find GPS location

Every time the ModelLoader application is launched from my phone, it keeps trying to find the GPS location, but never ends, both for the demo .apk and the git code (I had to make code changes to be able to run DroidAR with updated lib GDX). I can skip the location detection, but then the model is always rendered flat at position (0,0,0).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.