Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds


Browsing this Thread:   1 Anonymous Users




« 1 (2) 3 »


Re: A leg up (on the pile) on VHTK
#11
Webmaster
Webmaster


See User information
This is the code that finds the index.urn file located in H3DAPI.cpp (I think it looks the same in the latest release, this code is from trunk). Therefore it does not matter if you use H3DLoad or your own C++ loader.
string urn_config_file "index.urn";
  
char *buffer getenv"H3D_URN_CONFIG_FILE" );
  if( 
buffer ) {
    
urn_config_file buffer;
    
ResourceResolver::setURNResolver( new URNResolverurn_config_file ) );
  } else if( 
buffer getenv"H3D_ROOT" ) ) {
    
urn_config_file buffer;
    
urn_config_file += "/index.urn";
    
ifstream osurn_config_file.c_str() );
    if( 
os.good() ) {
      
ResourceResolver::setURNResolver( new URNResolverurn_config_file ) );      
    }
    
os.close();
  }


Which means that the path to index.urn is either
H3D_ROOT/index.urn
or
H3D_URN_CONFIG_FILE

From where do you get the warning? What line in the code? I can not find that line in H3DAPI (must be missing it somehow). It does look like it is the index.urn that can not be found. "URN resolver config file" should refer to index.urn.

Posted on: 2011/2/22 8:53
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: A leg up (on the pile) on VHTK
#12
Not too shy to talk
Not too shy to talk


See User information
Hey Markus,

I tracked the error message to the following code block contained in the URNResolver.cpp (Line 37-42):

ifstream isconfig_file.c_str() );
  if( !
is.good() ) {
    
Console(4) << "Warning: Could not open file URN resolver config file "" 
               << config_file << """ 
<< endl
    return;
  }


I also figured out that the issue was that my environment variable (H3D_URN_CONFIG_FILE) was pointing at the directory my URN file was in, but not the actual file. This has been fixed. Note to others: Visual Studio 2010 must be restarted in order for it to notice changes in environmental variables.

Unfortunately, the program still throws errors at me:

[WWarningNone of the urls in the PythonScript node "PythonScript_000000000247DB90" with url ["python/candy/AutoLoadSO.py"could be found.
[
WWARNINGCould not create "VolumeHaptics" nodeIt does not exist in the H3DNodeDatabase (C:/H3D/VHTK/x3d/setup_sphere.x3d line 35)
[
WWARNINGCould not create "LocalInfo" nodeIt does not exist in the H3DNodeDatabase (C:/H3D/VHTK/x3d/setup_sphere.x3d line 39)
[
WWARNINGCould not create "VolumeRenderer" nodeIt does not exist in the H3DNodeDatabase (C:/H3D/VHTK/x3d/setup_sphere.x3d line 48)
[
WWARNINGCould not create "ScalarSurfaceFrictionMode" nodeIt does not exist in the H3DNodeDatabase (C:/H3D/VHTK/x3d/setup_sphere.x3d line 96)
[
WWarningNone of the urls in the PythonScript node "ROTATOR" with url "python/candy/Rotator.py"could be found.
[
WWARNINGRoute errorCould not find field named "rotation" in "ROTATOR" Node (C:/H3D/VHTK/x3d/setup_sphere.x3d line 127)


I can see that the AutoLoadSO.py exists in the VHTK sub folders. My URN file looks as follows and I assume it is now being read, but something must still be off:

urn:h3dapiC:/H3D/H3DAPI/
urn:vhtkC:/H3D/VHTK
urn
:candy:python C:/H3D/VHTK/python/candy


Sigh... Why is this such an uphill battle? :/ I must prevail!

Posted on: 2011/2/22 15:46
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: A leg up (on the pile) on VHTK
#13
Guru
Guru


See User information
Getting the URNs working is a bit of a bitch the first time but it's very useful when you use many different platforms on different computers like me.

I remember that the URNs may fail silently if the number of slashes in the paths of the index.urn file doesn't match the ones expected by the system. A path for urn:vhtk: should end with a slash. You could try putting slashes on the candy path as well, but on my system both work.
urn:h3dapiC:/H3D/H3DAPI/
urn:vhtkC:/H3D/VHTK/
urn:candy:pythonC:/H3D/VHTK/python/candy/

Posted on: 2011/2/23 7:43
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: A leg up (on the pile) on VHTK
#14
Guru
Guru


See User information
Hmmm... taking a second look at your warning message, it looks like it's not at all looking for a URN! It seems that I never got around to release 1.10 and that's the first version that uses URNs. Sorry about that!

Open the example X3D files and replace url="python/candy/XXX.py" with url="urn:candy:python/XXX.py", that should fix it. If there are any lines with url="python/XXX.py" you should replace that with url="urn:vhtk:python/XXX.py".

Posted on: 2011/2/23 7:48
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: A leg up (on the pile) on VHTK
#15
Not too shy to talk
Not too shy to talk


See User information
Replacing following text:
python/candy/AutoLoadSO.py

with
urn:candy:python/AutoLoadSO.py


did unfortunately not help. Still the same errors as before. Instead I replaced all the URLs with hardcoded values pointing directly to all the necessary files (except this file "data/sphere_256x256x256_u8.raw" which I cannot find - perhaps it's created?).

This brought about a slew of new errors. Of course. Nothing is easy...

[WPython error in file "C:H3DVHTKpythoncandyAutoLoadSO.py":
[
WTraceback (most recent call last):
[
W]   File "<string>"line 90in <module>
[
WAttributeError[W] : [W'module' object has no attribute 'argv'[W]
[
WWARNINGCould not create "VolumeHaptics" nodeIt does not exist in the H3DNodeDatabase (C:/H3D/VHTK/x3d/setup_sphere.x3d line 35)
[
WWARNINGCould not create "LocalInfo" nodeIt does not exist in the H3DNodeDatabase (C:/H3D/VHTK/x3d/setup_sphere.x3d line 39)
[
WWARNINGCould not create "VolumeRenderer" nodeIt does not exist in the H3DNodeDatabase (C:/H3D/VHTK/x3d/setup_sphere.x3d line 48)
[
WWARNINGCould not create "ScalarSurfaceFrictionMode" nodeIt does not exist in the H3DNodeDatabase (C:/H3D/VHTK/x3d/setup_sphere.x3d line 96)
[
WWarningH3D API compiled without 3DxwareSpaceWareSensor node will be unusable.


I'm not sure what to make of the error. It's expecting a variable I'm not giving it? Shouldn't the example just work? I hope you guys don't mind me skipping ahead - I mean hardcoding the urls in the x3d file - but I've spent almost two weeks on just getting VHTK to work and it'd be nice to see if I'm just digging myself deeper into a hole I cannot get out of :(

Posted on: 2011/2/23 9:47
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: A leg up (on the pile) on VHTK
#16
Guru
Guru


See User information
There is a bug in the script, a bug that doesn't show for me. You could edit the script and simply remove "sys" from the import early in the script. Or you could replace the AutoLoadSO Python script with a ImportLibrary node that loads the VHTK dll.

Posted on: 2011/2/23 12:05
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: A leg up (on the pile) on VHTK
#17
Not too shy to talk
Not too shy to talk


See User information
Ok. I added the following line:

<ImportLibrary library="C:H3DVHTKbinVHTK.dll" />


and all that remains are the following errors:

[WWarningH3D API compiled without 3DxwareSpaceWareSensor node will be unus
able
.
[
WWarningNo device exists in DeviceInfo when trying to IMPORT from HDEV from H3D_EXPORTSUsing dummy device instead.
[
WWarning in ScalarVolume:
[
WNone of the urls in ScalarVolume with url "data/sphere_256x256x256_u8.raw"could be loadedEither they don't exist or none of the specified ImageLoaders
 is able to load them.


I cannot find the raw volume... Isn't it supposed to be part of the VHTK zip?

Posted on: 2011/2/23 22:09
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: A leg up (on the pile) on VHTK
#18
Guru
Guru


See User information
The sphere data is synthetically generated by the generateSphere.cpp program in the data folder. It's a trivial program so you just compile it to an exe file ("make generateSphere" under Linux systems) and run it.

Posted on: 2011/2/24 9:27
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: A leg up (on the pile) on VHTK
#19
Not too shy to talk
Not too shy to talk


See User information
We have lift off. That is, the whole thing now compiles with only a few (and I hope) unimportant errors:

[W] Warning: H3D API compiled without 3Dxware. SpaceWareSensor node will be unusable.
[W] Warning: No device exists in DeviceInfo when trying to IMPORT from HDEV from H3D_EXPORTS. Using dummy device instead.

But... All I see is a grey screen with what could either be a very small sphere, or (more likely) a small aiming reticule.

Shouldn't I be seeing a big ball or something? I've also tried out most of the keyboard as well as mouse/haptic device without any response...? As far as I can tell from the X3D file there is no defined interaction...

Posted on: 2011/2/24 14:19
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: A leg up (on the pile) on VHTK
#20
Guru
Guru


See User information
It's probably the sphere you see. Without a correctly calibrated viewpoint this is the effect I get as well. It's the default settings that I'm not sure what they are supposed to simulate but at least not a computer monitor at moderate distance. Check that H3D_ROOT variable points at the folder containing the settings folder and check that your settings there are at least somewhat close to reality.

Posted on: 2011/2/25 7:52
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top




« 1 (2) 3 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create pdf.
You cannot get print page.

[Advanced Search]





(C) 2012 SenseGraphics AB    ---    Powered by XOOPS