User Tools

Site Tools


nxt_ar_toolkit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
nxt_ar_toolkit [2016/11/01 22:47] dwallacenxt_ar_toolkit [2017/07/17 03:13] (current) – [Step 8: Using Multiple Markers for Localization and Navigation] dwallace
Line 97: Line 97:
  
 Once you have the example program simpleLite working well with marker recognition and tracking, you can move onto creating your own project. For developing your own projects using the ARToolkit, I recommend using Visual Studio 2013 or higher. Visual Studio has great support for the ARToolkit SDK, and all of their example projects have been provided as Visual Studio projects to modify or use as reference. Once you have the example program simpleLite working well with marker recognition and tracking, you can move onto creating your own project. For developing your own projects using the ARToolkit, I recommend using Visual Studio 2013 or higher. Visual Studio has great support for the ARToolkit SDK, and all of their example projects have been provided as Visual Studio projects to modify or use as reference.
 +
 +**Note:** With recent updates to ARToolkit, it can be very difficult to create a new project in Visual Studio for ARToolkit. If you run into these issues, I recommend doing your development within and already-existing project within the provided ARToolkit5 Solution. This will make the process much easier to debug, and take away the worries of creating and maintaining your own project.
  
 To begin with creating a new project, simply open up Visual Studio and create an empty Visual Cpp project. Once you have created the empty project, you will need to add a .c file to the project. I named my file coordinate_tracking.c, because that was the use that I needed out of the ARToolkit. However, the ARToolkit is wide in its ability and uses. To begin with creating a new project, simply open up Visual Studio and create an empty Visual Cpp project. Once you have created the empty project, you will need to add a .c file to the project. I named my file coordinate_tracking.c, because that was the use that I needed out of the ARToolkit. However, the ARToolkit is wide in its ability and uses.
Line 214: Line 216:
 **Tracking Coordinates of Multiple Markers** **Tracking Coordinates of Multiple Markers**
  
-In order to consistently track the coordinates of multiple markers, you will need to alter the detection algorithm to associate one barcode ID with one instance of an array for storing your coordinates. To do this, add these lines of code to the main detection loop, after the IDs and CF values are logged to the ARConsole:+In order to consistently track the coordinates of multiple markers, you will need to alter the detection algorithm to associate one barcode ID with one instance of an array for storing your coordinates. To do this, add these lines of code to the main detection loop, after the IDs and CF values are logged to the ARConsole (Please change xCoord and yCoord to arrays that have the size as the amount of markers to track (currently 8 in this example)):
  
   for (h = 0; h < 7; h++) {   for (h = 0; h < 7; h++) {
Line 228: Line 230:
 ==== Step 8: Using Multiple Markers for Localization and Navigation ==== ==== Step 8: Using Multiple Markers for Localization and Navigation ====
  
-In order to track the position of a robot or other vehicle using the ARToolkit, we will need to create an algorithm that creates relative coordinates for the robot based off of a known location of a stationary marker. This will allows us to create a kind of coordinate system that is independent of camera position or resolution. In order to do this, we will need to use one barcode marker (in most cases this will be number 0) fixed to a stationary location, and then reference this location in our code to get relative distances. This can be achieved by adding this block of code to the end of the for loop from the previous step:+In order to track the position of a robot or other vehicle using the ARToolkit, we will need to create an algorithm that creates relative coordinates for the robot based off of a known location of a stationary marker. This will allows us to create a kind of coordinate system that is independent of camera position or resolution. In order to do this, we will need to use one barcode marker (in most cases this will be number 0) fixed to a stationary location, and then reference this location in our code to get relative distances.  This can be achieved by adding this block of code to the end of the for loop from the previous step (Please declare xCoordRel and yCoordRel as arrays, with the same size as xCoord and yCoord, at the beginning to the mainLoop() function):
  
   if ((xCoord[0] != 0) && (yCoord[0] != 0) && (xCoord[h] < 1000) && (yCoord[h] < 1000) && (xCoord[h] > -1000) && (yCoord[h] > -1000)) {   if ((xCoord[0] != 0) && (yCoord[0] != 0) && (xCoord[h] < 1000) && (yCoord[h] < 1000) && (xCoord[h] > -1000) && (yCoord[h] > -1000)) {
Line 246: Line 248:
 ===== Final Words ===== ===== Final Words =====
  
-This tutorial's objective was to teach how to setup, and use the ARToolkit SDK for tracking and navigation. Complete source code for the coordinate tracking program can be found [[http://www.filehosting.org/file/details/590793/coordinate_tracking.c|here]]. Once the concepts were conveyed the reader could use the ARToolkit to write their own AR/object tracking programs in Visual C/Cpp.+This tutorial's objective was to teach how to setup, and use the ARToolkit SDK for tracking and navigation. Complete source code for the coordinate tracking program can be found [[https://github.com/D-Wazzle/Potential-Fields-Navigation/blob/master/ARToolkitCoordinateTracking.cpp|here]]. Once the concepts were conveyed the reader could use the ARToolkit to write their own AR/object tracking programs in Visual C/Cpp.
 \\  \\ 
 \\  \\ 
Line 252: Line 254:
 \\  \\ 
 \\  \\ 
-For questions, clarifications, etc, Email: <[email protected]+For questions, clarifications, etc, Email: <[email protected]>
nxt_ar_toolkit.1478065664.txt.gz · Last modified: 2016/11/01 22:47 by dwallace