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 [2017/02/09 13:38] dwallacenxt_ar_toolkit [2017/07/17 03:13] (current) – [Step 8: Using Multiple Markers for Localization and Navigation] dwallace
Line 216: 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 230: 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)) {
nxt_ar_toolkit.txt · Last modified: 2017/07/17 03:13 by dwallace