H3D.org Forum Index Programming Issues
renderer->getProxyPosition() returns UNINITIALIZED_PROXY_POS | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| xabbu | Posted on: 2009/12/21 12:09 |
Not too shy to talk ![]() ![]() Joined: 2009/2/20 From: Berlin, Germany Posts: 19 |
renderer->getProxyPosition() returns UNINITIALIZED_PROXY_POS Hi once again,
i finally started to pack the stuff together into one application which. Let me first describe the situation: I have a class which gets instantiated and sets up all the haptic related and graphics related stuff. After seting everything up the class fires of a thread which takes care of rendering the visual frames. In this thread I ask the renderer which is a member of the above mentioned class to return the ProxyPosition via getProxyPosition. The problem iss that this call returns UNINITIALIZED_PROXY_POS all the time. Here is my code for seting up haptics: --snip--- renderer = shared_ptr<RuspiniRenderer> (new RuspiniRenderer(proxy_radius)); hd.setHapticsRenderer(renderer.get()); if (hd.initDevice() != HAPIHapticsDevice::SUCCESS) { cout << hd.getLastErrorMsg() << endl; return false; } hd.enableDevice(); return true; ---snap--- I use exactly the same procedure in a test application which is mainly doing all the work in the main function and there it works fine. But with the OO-approach it fails. Any clues what I am doing wrong? xaBBu |
| Markus | Posted on: 2009/12/28 9:40 |
Webmaster ![]() ![]() Joined: 2006/3/27 From: SenseGraphics Posts: 1531 |
Re: renderer->getProxyPosition() returns UNINITIALIZED_PROXY_POS It sounds to me like one of these cases:
1. The haptics device does not initialize properly. 2. The haptics thread does not run properly and no error message indicates this. 3. Something odd is happening and you are suddenly querying the wrong instance of RuspiniRenderer for proxy position information. Could you run your program in debug mode and set a breakpoint at the first line in RuspiniRenderer::renderHapticsOneStep? If it never stops here then try setting a breakpoint in HAPIHapticsDevice::hapticRenderingCallback and if it never comes here try to find out why the haptics thread never runs. |
| xabbu | Posted on: 2010/1/5 11:26 |
Not too shy to talk ![]() ![]() Joined: 2009/2/20 From: Berlin, Germany Posts: 19 |
Re: renderer->getProxyPosition() returns UNINITIALIZED_PROXY_POS Happy new year to everybody.
I have come back to this problem and now guess that this is a bug in HAPI. The thing is that renderer->getProxyPosition will return UNINITIALIZED_PROXY_POSITION up until the point when a first shape is added to the haptics device. Once I have added at least one object to render haptically it works like a charm. Could you have a look and confirm that? Cheers, xaBBu |
| Markus | Posted on: 2010/1/8 10:57 |
Webmaster ![]() ![]() Joined: 2006/3/27 From: SenseGraphics Posts: 1531 |
Re: renderer->getProxyPosition() returns UNINITIALIZED_PROXY_POS You are correct, that is how it works.
It is constructed that way since it has been assumed that the haptics renderer should only be used if there are any haptics shapes in the scene. Why are you interested in the proxy when you have no shapes? Why not use the position of the haptics device? |
| xabbu | Posted on: 2010/1/11 10:56 |
Not too shy to talk ![]() ![]() Joined: 2009/2/20 From: Berlin, Germany Posts: 19 |
Re: renderer->getProxyPosition() returns UNINITIALIZED_PROXY_POS I was just thinking that this "intelligence" would be contained in HAPI itself... I mean that the renderer just returns the Haptic Devices position when no shapes are registered. Would be a little bit less confusing in my humble opinion. But ok its only a design thing, but maybe should be documented in the doxygen entry for the function.
Cheers, xaBBu |
| Markus | Posted on: 2010/1/11 11:49 |
Webmaster ![]() ![]() Joined: 2006/3/27 From: SenseGraphics Posts: 1531 |
Re: renderer->getProxyPosition() returns UNINITIALIZED_PROXY_POS That is indeed a better behavior, it looks like it is just a small change to make it so, I will probably make that change quite soon. Within a week or so.
|
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |



