Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-DUSE_GLUT=1 if glut is found #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JimmyDaSilva
Copy link
Contributor

Hi @hris2003 and @vrabaud !

As discussed earlier this year on the Google User group here, there is some compilation issue when trying to compile without the proper mesa libraries. Since I am working with the KinectV2, I have to use glut instead.

The problem here is just that USE_GLUT never gets defined in renderer3d.cpp, only in cmake. That's why I use add_definitions(-DUSE_GLUT=1).

I also propose if (${GLUT_FOUND}) so that it's not required to change the option by hand.

It would be nice to also remove the dependency to libosmesa6-dev because it can actually build with glut instead. That way kinectV2 users could install all the debians of ORK.

Thanks for the great work by the way

Cheers,
Jimmy Da Silva

@vrabaud
Copy link
Member

vrabaud commented Jan 19, 2016

OSMes is better because it does not require a screen: it will not pop up a windows to create the rendering. It should be the solution of choice.
Now, it does not work anymore ... I looked into it briefly and was able to run Mesa but not with ORK yet.

Your patch seems to be the correct fast solution. Now, I'd like to understand the install issue you have. Why does it happen ? You have a special PPA that has a secial Mesa ? It's not an Ubuntu problem because the buildfarms are fine with it.

@JimmyDaSilva
Copy link
Contributor Author

This is the error given when trying to install the debian package:

The following packages have unmet dependencies:
 ros-indigo-object-recognition-renderer : Depends: libosmesa6 (>= 6.5.2-1) but it is not going to be installed or
                                                   libgl1-mesa-glide3 but it is not installable
                                          Depends: libosmesa6-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

It's almost a fresh install except that I installed libfreenect2 to run the KinectV2 following these intructions: https://github.com/OpenKinect/libfreenect2#debianubuntu-1404

So my problem may come from:
sudo apt-get install build-essential cmake pkg-config libturbojpeg libjpeg-turbo8-dev mesa-common-dev freeglut3-dev libxrandr-dev libxi-dev

Or maybe when installing the nvidia-352(or 355) driver from ppa:xorg-edgers/ppa

@JimmyDaSilva
Copy link
Contributor Author

Also the display "Assimp renderer" doesn't show anything in training or detection.

@hris2003
Copy link

@JimmyDaSilva If you want to discuss about an issue related to the detection, please open the issue at the appropriate package.

@JimmyDaSilva
Copy link
Contributor Author

@hris2003 Yes sure. Sorry. Going to update previous post

@JimmyDaSilva
Copy link
Contributor Author

Hi @vrabaud,

I am now running linemod with a clean install and OSmesa. As expected the renderer's window is not empty now.

During training the renderer window shows the mesh with different sampling view, but without colors.
Is the renderer or the couchDB database supposed to show the object with the color texture ?
I tried with .blend, .obj, .ply, and .3ds extension.

During detection I get the following window, with my coke can in blue !
ork_linemod

So far, the detection seems to work pretty well. I can detect my mug or my hand sometimes but I guess I will get rid of it with some post-processing.
My main concern is that it doesn't seem to use the color gradient as expected since the score for the Nestea can or the Coca-Cola can are really similar.
I know it's not actually using colors, but color gradients, so is that a normal behaviour ?

I just need to know if the renderer it making is job properly to make use of the object texture. The blue can and the training window just doesn't seem right to me.

Thank you for your help

Jimmy

@nlyubova
Copy link
Contributor

Your cola can be blue because of openni2_launch, try the previous version

@JimmyDaSilva
Copy link
Contributor Author

Thank you for your reply @nlyubova.
It was actually the other way around. I was using openni and not openni2.

It does change the colors displayed but the results are the same. Now the coke can is red, but I still get the same score for both cans

linemod

@nlyubova
Copy link
Contributor

did you learn OBJ meshes?

@JimmyDaSilva
Copy link
Contributor Author

Yes. I also tried converting the .blend to .ply and .3ds but it doesn't change the results.
This is what I get during training:
training_linemod

Is the Error line okay ?

Should I see the mesh in color on the database page ? Should I see colors on the rendering window here ?

Thanks again

@nlyubova
Copy link
Contributor

it says "texture loaded".....

sorry, never tried to use color :) But will try !

@JimmyDaSilva
Copy link
Contributor Author

Okay thanks. Please keep me posted.
Also please if you could reply to my issue on wg-perception/linemod :). I am quite confused with the params.

@JimmyDaSilva
Copy link
Contributor Author

@vrabaud To come back to the mesa/glut problem: Yesterday I installed a graphics card on the desktop I have been working on linemod this past week. All I did was to install nvidia-352 from ppa:xorg-edgers and the renderer was not working anymore, meaning that a problem happens and fails linemod.

What happened for me:
After the graphics card got installed with the nvidia-352 drivers, linemod detection was still able to run properly.
But then I learned a new object. No renderer window shows up but code runs and uploads a new trained object. And now when running detection again, RAM usage explodes and then swaps.

memory_leak

Then I started to look at what happens and in which loop the code is stuck. And it was on reading the "distances" field in the learnt documents:
https://github.com/wg-perception/linemod/blob/master/src/linemod_detect.cpp#L136

Then I compiled to use GLut. Re-trained my objects. And the code runs.
I also tried training with GLut, compile again with mesa, run detection with mesa: works!
So it seems the problem happens only for training with mesa and nvidia-352

short:

  • installing nvidia-352 is enough to break the mesa installation
  • document.get_attachment<std::vector<float> >("distances", distances_[object_id]); with a corrupted trained object (renderer broken) creates a serious memory problem.
  • training runs anyway with nvidia-352 but creates a corrupted template (at least the distance field). no problem with GLut
  • (edited) GLut fails on start if there is several objects in the DB and detection is set to recognize all objects. Loads first, then freeglut illegal glutInit() reinitialization attempt

@vrabaud
Copy link
Member

vrabaud commented Feb 28, 2016

So, should I still merge that PR ? I actually get some black window for training too ... Mesa works but not the renderer so there is indeed a bug there ... I am trying to narrow it down ...

@JimmyDaSilva
Copy link
Contributor Author

GLut seems to work all the time, but is actually slower than mesa I think so I don't know. Depends on if you think you can fix the problem.
Force the recall, this PR will force the use of GLut if it is found. Doesn't seem like a clean way to do it.

@vrabaud
Copy link
Member

vrabaud commented Feb 28, 2016

Hey, can you actually compile the OS demo in there and get it to work for you ? ftp://ftp.freedesktop.org/pub/mesa/demos/8.3.0/
You should see a simple scene with a cone and sphere.

@JimmyDaSilva
Copy link
Contributor Author

@vrabaud Yes, it works. I don't know which specific demo you were talking about but mesa runs. Its a different computer but same setup (nvidia-352).
mesa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants