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

Adding second model -> training -> error: freeglut illegal glutInit() reinitialization attempt #20

Open
YantianZha opened this issue Jan 5, 2016 · 16 comments

Comments

@YantianZha
Copy link

rosrun object_recognition_core training -c rospack find object_recognition_linemod/conf/training.ork
Training 2 objects.
computing object_id: 26fd4a3e0309ca93c5d8ba054b001268
Info, T0: Load /tmp/filejUzsrU.obj
Info, T0: Found a matching importer for this file format
Info, T0: Import root directory is '/tmp/'
Error, T0: OBJ: Unable to locate material file paper_cup.mtl
Error, T0: OBJ: failed to locate material None.001, skipping
Info, T0: Entering post processing pipeline
Info, T0: Points: 0, Lines: 0, Triangles: 1, Polygons: 0 (Meshes, X = removed)
Error, T0: Failed to compute tangents; need UV data in channel0
Info, T0: JoinVerticesProcess finished | Verts in: 71400 out: 48417 | ~32.2%
Info, T0: Cache relevant are 1 meshes (23800 faces). Average output ACMR is 2.034622
Info, T0: Leaving post processing pipeline
Deleting the previous model 26fd4a3e0309ca93c5d8ba054b0027bb of object 26fd4a3e0309ca93c5d8ba054b001268
computing object_id: bd469776b362b00f0f60e3e3bd000425
freeglut illegal glutInit() reinitialization attempt

The first possible reason is: my model is wrong. For your convenience here is the link to my model: https://drive.google.com/folderview?id=0BwZMlUaV88n6OWNqbUtGUE84Y1U&usp=sharing

That said, I created the model with blender following the tutorial (http://wg-perception.github.io/ork_tutorials/tutorial01/tutorial.html#creating-an-object-in-the-db). There're two points: origin, and size. I think my model in right by following the coke.obj (NOT coke.stl) model as an sample.

Another possible reason is: #3
That link refers to wg-perception/ork_renderer@bf49f05
But I can't find the fie "src/renderer_glut.cpp". The closest file I can find is: "ork_renderer/src/renderer3d_impl_glut.cpp". But I suspect I don't need to change that file any more?

Thanks very much!

@mayurand
Copy link

mayurand commented Jan 8, 2016

I am also having the same issue. It would great if anyone can help.

Thanks

@RudiRobot
Copy link

  1. (Error, T0: Failed to compute tangents; need UV data in channel0)
    You have to create an UV map of your object in blender. Don't ask me what is the best uv map for line mod recognition. But you can be guided by the tutorial can. I am looking forward to get hints.
  2. (Error, T0: OBJ: Unable to locate material file paper_cup.mtl)
    a) If you export your obj, you can exclude the material file
    b) You have to add the material file to the right folder (In my case it was the /tmp folder).

@YantianZha
Copy link
Author

Thanks, @RudiRobot .

I moved my files to /tmp folder, and then train, detect.
This time I created my first model with paper_cup, and it worked (with training). It worked perfectly. My paper cup was detected successfully!

And then I created my second model with the official coke, then I got the same error: freeglut illegal glutInit() reinitialization attempt

The problem is, I can't train the second model.

Note: the error comes from using cmd:
rosrun object_recognition_core training -c rospack find object_recognition_linemod/conf/training.ork

Output:
Training 2 objects.
computing object_id: a84197cfa8cb5e6024cb6bed5a0006bd
Info, T0: Load /tmp/filecOqRT9.obj
Info, T0: Found a matching importer for this file format
Info, T0: Import root directory is '/tmp/'
Info, T0: Entering post processing pipeline
Info, T0: Points: 0, Lines: 0, Triangles: 1, Polygons: 0 (Meshes, X = removed)
Error, T0: Failed to compute tangents; need UV data in channel0
Info, T0: JoinVerticesProcess finished | Verts in: 71400 out: 48417 | ~32.2%
Info, T0: Cache relevant are 1 meshes (23800 faces). Average output ACMR is 2.034622
Info, T0: Leaving post processing pipeline
Deleting the previous model a84197cfa8cb5e6024cb6bed5a0022a4 of object a84197cfa8cb5e6024cb6bed5a0006bd
computing object_id: a84197cfa8cb5e6024cb6bed5a001b12
freeglut illegal glutInit() reinitialization attempt

After deleting the second object in db, and train again, no error. Everything works fine.

I think this is a bug. ORK people solved one bug by changing ork_renderer to use glut to train models and detect objects. This then gets this second bug.

Thanks!

@YantianZha
Copy link
Author

A possible solution is to change object_id parameter in ork_linemod/apps/training

    print('Training %d objects.' % len(object_ids))
    #for object_id in object_ids:
object_id = "a84197cfa8cb5e6024cb6bed5a0006bd"
    print('computing object_id: %s' % object_id)
    object_id = object_id.encode('ascii')

Then training worked fine.

Then when trying to detect the object, you would still get the error:
freeglut illegal glutInit() reinitialization attempt

And this time you CANNOT detect each object separately, like training.
And if you don't use GLUT, you would met another kind of error:
#18

@nlyubova
Copy link
Contributor

Training works for several objects when using STL meshes. Did you try it?

@YantianZha
Copy link
Author

Yes. But it did not work. "freeglut illegal glutInit() reinitialization attempt" still exists.

@YantianZha
Copy link
Author

I suddenly got this:
rosrun object_recognition_core training -c rospack find object_recognition_linemod/conf/training.ork
[FATAL] [1452744215.058069762]: You must call ros::init() before creating the first NodeHandle
Couldn't find an AF_INET address for []
Couldn't find an AF_INET address for []
[ERROR] [1452744215.059014505]: [registerPublisher] Failed to contact master at [:0]. Retrying...
Couldn't find an AF_INET address for []
Couldn't find an AF_INET address for []
...

I didn't change anything. I just ran the training node. I don't know whether someone met this before.

@YantianZha
Copy link
Author

Hi @nlyubova ,
Could you let me know how you installed the GLUT? I'm using ubuntu 14.04.3, is it same with you? I'm using freeglut, but I can't find anywhere in ORK workspace includes freeglut.h
Thanks!

@JimmyDaSilva
Copy link

@YantianZha, I got the AF_INET error as well.

For me I think the problem was adding the arg -DLINEMOD_VIZ_PCD=ON when compiling.
It actually compiles fine and the real_icpin_ref and real_icpin_model are published when running the detection, but the training then does not work any more

@YantianZha : just run catkin_make -DLINEMOD_VIZ_PCD=OFF

@nlyubova
Copy link
Contributor

right @JimmyDaSilva , it is because of nodeHandle when -DLINEMOD_VIZ_PCD=ON, we should fix it

@JimmyDaSilva
Copy link

@nlyubova I still don't understand where it comes from .Since LINEMOD_VIZ_PCD is only in linemod_detect.cpp how can this param impact the build of linemod_training.cpp ?

@nlyubova
Copy link
Contributor

@JimmyDaSilva , right, it is in linemod_detect.cpp but they are compiled together

@nlyubova
Copy link
Contributor

fixed it in nlyubova@06f48f9

@JimmyDaSilva
Copy link

@nlyubova That solves it ! Tested and approved. Can you push this ?

@nlyubova
Copy link
Contributor

Yeah, also tested and already done a pull request
On Feb 22, 2016 18:36, "Jimmy DA SILVA" [email protected] wrote:

@nlyubova https://github.com/nlyubova That solves it ! Tested and
approved. Can you push this ?


Reply to this email directly or view it on GitHub
#20 (comment)
.

@JimmyDaSilva
Copy link

@vrabaud Got fixed with wg-perception/ork_renderer#12

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

No branches or pull requests

5 participants