-
Notifications
You must be signed in to change notification settings - Fork 303
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
Providers as dependent packages #735
Comments
Yes, I think the
IMO I would simplify your example and reduce the class to a simpler one: get rid of the
Documentation for providers has been added recently http://www.itowns-project.org/itowns/API_Doc/Provider.html, but it can certainly be completed by a more thorough tutorial.
No, we need to keep basic ones, but some may go I think. iTowns shouldn't be bloated, but it shouldn't be naked at first sight. A new user needs to have some cases that works out of the box. |
+1 to everything @zarov said. To elaborate a bit on 6: imho itowns should support widely-used openly specified protocols out-of-the-box.
From this formulation, I understand that you wanted to write a library, but your repo looks like an app (build results and bundles committed, no peer dependencies, a webpack config, a preinstall script etc). Is it intended?
I'm pretty sure you shouldn't do that, otherwise the update loop will never stop. So your best bet is to add your view.notifyChange in a callback to the same topic But the important conclusion here: as you don't actually need an update method, you don't need a provider here. Just add your 3D objects to the scene when you initiate the connection, subscribe to the right topic and call As a rule of thumb: if you only ever have a fixed initial amount of 3d objects, you need neither layers nor Providers, providing you can react to data updates.
|
The develop branch is where I work. the master branch is just push forced with the develop head with an extra "publication" commit to be able to host the demo as a ghpage using this script. index.html is indeed the demo app and src should be the library. I must admit I stumbled onto 2 issues :
If anyone could help me configure the |
As for other aspects :
|
What do you mean by "to work more consistently"? What happens if you don't? Btw, you can pass an object3D to picking.pickObjectsAt to restrict the hierarchy of pickable objects. Maybe passing your root object (of this layer) to it will help?
yes, no problem about that. Or maybe view.addProtocolProvider, it depends if we want one Scheduler per webpage or per view.
Not against per se, but 2 remarks:
To be tried and seen in practice I'd say.
I'd say exactly the contrary for picking: it should work on simple Object3D, not only on a layer. That would cover your use case too I guess. But I think it's already the case.... I'm not sure why you have trouble with that (maybe a bug?).
how you stylize an object3D already constructed? But apart from that, again I think the contrary: you should be able to stylize and display stuffs without layers imho. Ex, you have a gpx as a string objects (because you constructed it, or have it by other means), you could feed it directly to a parser then a stylizer then a sink and voilà, you have a Object3D you can add to view.scene directly, skipping providers (or sources) and processing (because really you don't need them). Layers should be seen as a dynamic collection of Object3D, that can update itself. but yeah at the end we want to be able to do this:
Imho the problem you have here, is that Ros3Djs already gives you Object3D, which makes providers and layers of itowns useless. Maybe a alternative solution would be to use roslibjs directly in |
I opened #747 for this.
I agree we are not there yet, I am just proposing the idea of a multi-package repo to get opinions.
any thought ?
You can change the material properties, or even the whole material, you can process its attributes to create another object3d... That is what is being done in the wfs example with onMeshCreated callbacks for instance.
I find it difficult to draw this line : #747 may help to have a common agreement on that.
If I rephrase that, I am proposing to be able to provide Object3D sources as itowns libraries that can be plugged in seamlessly (after we split the providers) and you are proposing that in the case of sources that produce an Object3D, the user would have to manually call whatever any styling, transformation, material patching, picking fixing code he requires. |
Yes your phrasing is biaised, I didn't say |
I may have missed something (I'm not familiar with Ros3Djs): what does it give you apart from the 20 lines of |
That is right for NavSatFix, but there are plenty of other messages and the handling of moving frames by SceneNode. I would rather write the ros->three code I need in an existing package maintained by a small but active community than rewrite yet another one. |
This issue has been covered now, see the documentation and tutorials. |
This issue is about discussing and deciding on a prescribed and supported way to write client code (with itowns as a npm dependency) that adds a new type of protocol/datasource.
Sample usecase
ROS is a robotics framework that is able (among other things) to stream raw or more processed sensor measurements (GPS tracks, lidar point clouds, color images...) through a websocket server.
ROSLIB and ROS3D are client js code that enable the visualization of these streams inside THREE.JS.
It sounds a lot like a datasource/protocol that itowns could visualize ! So I gave it a try and wrote itowns-ros, an npm project external to itowns that depends on both itowns and ros libraries and offers a simple ROSProvider class, with an extra
register
method to streamline the registration of the provider in the protocol registry maintained by the scheduler.Questions / todos
The text was updated successfully, but these errors were encountered: