Pages: [1] 2   Go Down
Author Topic: Errors in code  (Read 2259 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

/* --------------------------------------------------------------------------
 * 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 



Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This code is for Processing, not Arduino.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thank you

PBODY
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

They ate two different applications and two very different environments.

Processing is downloaded (and supported) by processing.org
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
}
 

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
}
 

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
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 486
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

http://dduino.blogspot.com all my Arduino/electronic projects!!!

{NEW} Getting Started, Learning, Reference + FAQ PDF!!:
[url]http://ar

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 499
Posts: 19070
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
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
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sirbrow
Quote
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?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 638
Posts: 50300
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

It says Bold: Installing the Processing Libray

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

Making things see:Greg borenstein
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It says Bold: Installing the Processing Libray
It does, but it means Installing the OpenNI library for Processing.
Logged

Pages: [1] 2   Go Up
Jump to: