gkjohnson / urdf-loaders

URDF Loaders for Unity and THREE.js with example ATHLETE URDF Files open sourced from NASA JPL
https://gkjohnson.github.io/urdf-loaders/javascript/example/bundle/index.html
Apache License 2.0
469 stars 121 forks source link

Enable to load urdf files from vs code #286

Closed virtuamechanica closed 6 months ago

virtuamechanica commented 6 months ago

Hello,

i would like to run the urdf load example from vs code, but it fails loading the urdf files (samples ones). I can successfully render the main html page, seing the menus, but urdf files can’t be processed.. if I run through npm start, it works fine.

Are there well know limitations using it from vs code ? I just want to debug and understand the code in détails Before integrating it in another app. (Nb: I know that you shared a vs code preview extension, so I was wondering why this urdf loader repo would not work properly..)

Thank you for your help

gkjohnson commented 6 months ago

This project is designed as a library to be used in a project - not for loading a VS Code extension. As you've seen I have experimented with displaying a URDF as a plugin but it's not something I'm working on or supporting any future.

yvanblanchard commented 6 months ago

Thank you Garett.

Sorry, but maybe the question was not clear enough. I don't want to use the library as a VS code extension/plugin. I just want to use your code 'as it' (repo example) , running it through VS Code in order to better understand the code. And I was experienced an issue when loading urdf file (using one of those shared in the repo).

When I debug the code, it seems that threeJs got an error since 'robot' object is not defined: this.world.add(robot); image

This object is not defined since the 'traverse' method is never called (this._requestId is not defined itself):

image

Thank you again.

gkjohnson commented 6 months ago

I don't know anything about running from VS Code but there is some documentation on how to run the project examples locally you could try, first:

https://github.com/gkjohnson/urdf-loaders/tree/master/javascript#running-the-example

yvanblanchard commented 6 months ago

Thank you for your quick reply Garett.

I was finally able to solve my problem. I just had to correctly specify the url in the 'launch.json' configuration file of VS Code:

image

(nb: don't use double quotes for the url path).

Of course, need to set the html server first (npm start). Maybe it's possible to automate this using VS Code config file, but I did not check/test it.

We can then close this issue.

gkjohnson commented 6 months ago

We can then close this issue.

For future note, assuming you are also virtuamechanica, you are able to close your own issues, which is appreciated.