Errors in code

/* -------------------------------------------------------------------------- * SimpleOpenNI DepthImage Test * -------------------------------------------------------------------------- * Processing Wrapper for the OpenNI/Kinect library * http://code.google.com/p/simple-openni * -------------------------------------------------------------------------- * prog: Max Rheiner / Interaction Design / zhdk / http://iad.zhdk.ch/ * date: 02/16/2011 (m/d/y) * ---------------------------------------------------------------------------- */

import SimpleOpenNI.*;

SimpleOpenNI context;

void setup() { context = new SimpleOpenNI(this);

// mirror is by default enabled context.setMirror(true);

// enable depthMap generation if(context.enableDepth() == false) { println("Can't open the depthMap, maybe the camera is not connected!"); exit(); return; }

// enable ir generation //context.enableRGB(640,480,30); //context.enableRGB(1280,1024,15); if(context.enableRGB() == false) { println("Can't open the rgbMap, maybe the camera is not connected or there is no rgbSensor!"); exit(); return; }

size(context.depthWidth() + context.rgbWidth() + 10, context.rgbHeight()); }

void draw() { // update the cam context.update();

background(200,0,0);

// draw depthImageMap image(context.depthImage(),0,0);

// draw irImageMap image(context.rgbImage(),context.depthWidth() + 10,0); }

58 different errors mainly specifying does not name a type? Thank you *pbody *

This code is for Processing, not Arduino.

What is the difference? if you don't mind explaining.

Thank you

PBODY

They ate two different applications and two very different environments.

Processing is downloaded (and supported) by processing.org

um....thank you I hope I figure this stuff out with time

/* --------------------------------------------------------------------------
 * SimpleOpenNI DepthImage Test
 * --------------------------------------------------------------------------
 * Processing Wrapper for the OpenNI/Kinect library
 * http://code.google.com/p/simple-openni
 * --------------------------------------------------------------------------
 * prog:  Max Rheiner / Interaction Design / zhdk / http://iad.zhdk.ch/
 * date:  02/16/2011 (m/d/y)
 * ----------------------------------------------------------------------------
 */

import SimpleOpenNI.*;


SimpleOpenNI  context;

void setup()
{
  context = new SimpleOpenNI(this);
   
  // mirror is by default enabled
  context.setMirror(true);
  
  // enable depthMap generation 
  if(context.enableDepth() == false)
  {
     println("Can't open the depthMap, maybe the camera is not connected!"); 
     exit();
     return;
  }
  
  // enable ir generation
  //context.enableRGB(640,480,30);
  //context.enableRGB(1280,1024,15);  
  if(context.enableRGB() == false)
  {
     println("Can't open the rgbMap, maybe the camera is not connected or there is no rgbSensor!"); 
     exit();
     return;
  }

  size(context.depthWidth() + context.rgbWidth() + 10, context.rgbHeight()); 
}

void draw()
{
  // update the cam
  context.update();
  
  background(200,0,0);
  
  // draw depthImageMap
  image(context.depthImage(),0,0);
  
  // draw irImageMap
  image(context.rgbImage(),context.depthWidth() + 10,0);
}

I know you said the code is for processing but I have a book and it said add the samples to the library click on the depth map and boom I should have a screen shot of myself but I didn't get it through arduino I got it threw openni though I am a little lost I don't want to move onto the next step if I dont fully understand this one.

/* --------------------------------------------------------------------------
 * SimpleOpenNI DepthImage Test
 * --------------------------------------------------------------------------
 * Processing Wrapper for the OpenNI/Kinect library
 * http://code.google.com/p/simple-openni
 * --------------------------------------------------------------------------
 * prog:  Max Rheiner / Interaction Design / zhdk / http://iad.zhdk.ch/
 * date:  02/16/2011 (m/d/y)
 * ----------------------------------------------------------------------------
 */

import SimpleOpenNI.*;


SimpleOpenNI  context;

void setup()
{
  context = new SimpleOpenNI(this);
   
  // mirror is by default enabled
  context.setMirror(true);
  
  // enable depthMap generation 
  if(context.enableDepth() == false)
  {
     println("Can't open the depthMap, maybe the camera is not connected!"); 
     exit();
     return;
  }
  
  // enable ir generation
  //context.enableRGB(640,480,30);
  //context.enableRGB(1280,1024,15);  
  if(context.enableRGB() == false)
  {
     println("Can't open the rgbMap, maybe the camera is not connected or there is no rgbSensor!"); 
     exit();
     return;
  }

  size(context.depthWidth() + context.rgbWidth() + 10, context.rgbHeight()); 
}

void draw()
{
  // update the cam
  context.update();
  
  background(200,0,0);
  
  // draw depthImageMap
  image(context.depthImage(),0,0);
  
  // draw irImageMap
  image(context.rgbImage(),context.depthWidth() + 10,0);
}

I posted this question in the wrong section but I was told this code was for processing and not arduino but the book I have tells me to install the OPPENNI into the arduino did that and I uploaded the code but it says I will see a picture of myself I haven't what am I doing wrong

thank you

void draw() is definetly a processing method, and its says in the title "[u]Processing[/u] Wrapper for the OpenNI/Kinect library"

your book made a mistake, this is for processing.. maybe their is a processing and arduino program?

PBODY: but the book I have tells me to install the OPPENNI into the arduino did that and I uploaded the code but it says I will see a picture of myself I haven't what am I doing wrong

How did you upload the code? I get:

sketch_mar27a:11: error: 'import' does not name a type
sketch_mar27a:14: error: 'SimpleOpenNI' does not name a type
sketch_mar27a.cpp: In function 'void setup()':
sketch_mar27a:18: error: 'context' was not declared in this scope
sketch_mar27a:18: error: expected type-specifier before 'SimpleOpenNI'
sketch_mar27a:18: error: expected `;' before 'SimpleOpenNI'
sketch_mar27a:26: error: 'println' was not declared in this scope
/Applications/Arduino 1.0.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdlib.h:278: error: too few arguments to function 'void exit(int)'
sketch_mar27a:27: error: at this point in file
sketch_mar27a:36: error: 'println' was not declared in this scope
/Applications/Arduino 1.0.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdlib.h:278: error: too few arguments to function 'void exit(int)'
sketch_mar27a:37: error: at this point in file
sketch_mar27a:41: error: 'size' was not declared in this scope
sketch_mar27a.cpp: In function 'void draw()':
sketch_mar27a:47: error: 'context' was not declared in this scope
sketch_mar27a:49: error: 'background' was not declared in this scope
sketch_mar27a:52: error: 'image' was not declared in this scope

sirbrow

How did you upload the code? I get:

That is exactly what I got I am confused.

well sense you guys are talking a lot about processing the book mentions downloading the "Processing" library to the arduino why would they say such a thing?

well sense you guys are talking a lot about processing the book mentions downloading the "Processing" library to the arduino why would they say such a thing?

I don't know what book you are talking about, but if it really says to download Processing TO THE ARDUINO, you should toss it in the nearest trash can.

If it simply says to download Processing, you need to read better.

It might help if you told us what book you have.

PBODY:
I know you said the code is for processing but I have a book and it said add the samples to the library click on the depth map and boom I should have a screen shot of myself but I didn’t get it through arduino I got it threw openni though I am a little lost I don’t want to move onto the next step if I dont fully understand this one.

Nothing in this incoherent run-on makes sense.

In the code’s comments it says: “Processing Wrapper for the OpenNI/Kinect library”.

Visit the web site in the code’s comments: http://code.google.com/p/simple-openni
This site says: “This project is a simple OpenNI and NITE wrapper for Processing.

I don’t care what your book says, you have code meant for Processing. If you double-clicked a file on your computer and the Arduino IDE opened, that’s because Arduino IDE and Processing used the same file extension.

You need to get Processing from processing.org.

If it simply says to download Processing, you need to read better.

It says Bold: Installing the Processing Libray

It might help if you told us what book you have.

Making things see:Greg borenstein

It says Bold: Installing the Processing Libray

It does, but it means Installing the OpenNI library for Processing.

Nothing in this incoherent run-on makes sense

I don’t know if I should take that as constructive criticism or in another way.

In the code’s comments it says: “Processing Wrapper for the OpenNI/Kinect library”.

Visit the web site in the code’s comments: http://code.google.com/p/simple-openni
This site says: “This project is a simple OpenNI and NITE wrapper for Processing.”

I have no clue really to what Wrapper for Processing is.

I am trying to make this clear and not incoherent

I hope I am

You need to get Processing from processing.org

What exactly would I be looking for at processing.org

to me all of this is a run-on incoherent jambalaya of information.
I don’t know where to start or anything.

I got the blinking LED working but… I want to do this.

float a = 100;

void setup() 
{
  size(640, 200);
  stroke(255);
}

void draw() 
{
  background(51);
  a = a - 0.5;
  if (a < 0) { 
    a = height; 
  }
  line(0, a, width, a);  
}

If I put this into the arduino platform with the kinect connected to the computer and the SimpleOpenNi libraries uploaded would it do something?
or would I have to utilize something else?

I got the code from processing.org

I hope this isn’t incorrect and you can understand what I am trying to ask.

It does, but it means Installing the OpenNI library for Processing.

I was told to go to processing.org to help me out with processing but I don't know really where to begin, or what I should code into the arduino platform to be compatible with the OpenNi.

What chapter of the book are you at? According to the table of contents, the Arduino isn't involved until chapter 6, and then it is just responding to serial events sent from Processing. There doesn't seem to be a specific library for the Arduino.

To start with, you download Processing, from http://processing.org, and run the sketch you posted earlier in the Processing IDE.

What chapter of the book are you at

I am on chapter 2

It says go to import library and go to SimpleOpenNI

than go to examples

OpenNi and click Depth Image

than it says if everything is installed correctly it will cause a window to open up with a black and white image of me

if I go to Program on my computer and OpenNi I have a bunch of different options including depth image, hand tracking ect.

The book tells me it should run or something and the image matches the code.

I hope this isn’t confusing if it is I will try to clarify apparently I am incoherent in my explanations I will work on this.