-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Get rendering into SceneGraph #9540
Comments
I'm not sure exactly what physical design is proposed here, but I'd like to push us toward "pay for only what you need". Would the VTK, OSPRay be dependencies of SceneGraph, or would SceneGraph merely provide enough outputs or data to allow the user to attach a renderer, in cases where its needed? Since SceneGraph is such a core component of almost any simulation moving forward, I would prefer that it never hard-depend on any rendering engine, since they are finicky. |
Short answerThis branch contains all but the last step above (https://github.com/SeanCurtis-TRI/drake/tree/gw_renderer) -- although not organized in the ordering indicated above. I'm currently decomposing it. Long answerSo, the
Speculative features
|
I think we'll have to explore some tweaks before we get to the rendering engine integration. I don't think its acceptable for anyone who wants to use, say, MultibodyPlant, to have to always link in VTK or OSPRay. In their own ecosystem, they may have incompatible version of those dependencies. If they were trying to use vision simulation, perhaps we can insist that they consume our VTK. If they are just doing some collision queries for a dynamics simulation, though, they should not be tainted by spurious physical dependencies on a rendering engine. Hopefully there is a way to carve out the rendering-engine dependencies into add-on classes, even if there is still a 1:1 relation from an engine to a SceneGraph and they are highly coupled with internal APIs. |
I'm definitely sympathetic with that concern and am fully in favor of resolving it. Would I be correct in my belief that the current rendering architecture has the same problem? It seems so to me. |
On quick glance, RgbdCamera has a hard-dep on VTK, but it's decoupled enough that we could sever it if we wanted to without too much work. I don't think it spuriously bring in OSPRay though? In any case, geometry uses other than vision simulation don't bring in VTK spuriously. |
The current branch has a similar layer of abstraction. SceneGraph only knows about the RenderEngine interface (at least in its header). And all of the nasty vtk (and other future headers) are buried in the .cc files. So, it has a similar severability. Off the top of my head, the only obvious solution I have is a constructor that takes rendering flags combined with the use of dlload. Is this what you have in mind? |
One last question for you @jwnimmer-tri. I'd like to parallelize some of this stuff. For example, the introduction of the SceneGraph-compatible version of the vtk renderer in the geometry space (removal of RBT dependency and generalization of rendering). However, it will propagate the hard dependencies. Do you feel strongly enough that we defer that task listed above until we have a chance to address dependency issues? |
Can I ask why you suggest What if you just had an option to take in a EDIT: I see that you have fidelity flags, and a However, that seems a bit odd. Why not have some sort of open association via strings, such that users can choose what their renderers are? (e.g. And I haven't seen how these renderers would be specified yet (from briefly looking at the code); can I ask how you envision this happening? |
Lots of different points:
|
i'll throw in a vote for bringing it in more quickly and breaking the linking dependencies in a follow-on, simply for the sake of expediency. |
I am all for moving quickly, but if we are going to offer an "image_output_port" on SceneGraph, we need to be sure that it is feasible to update its implementation in the future to avoid the dependencies. (Like, I will do it immediately after image_output_port gets added to master.) We don't want to put ourselves in the position of having to remove the image_output_port from SceneGraph later on (and move it to a different System) as the only path to resolving the dependency issue. Also, if MultibodyPlant starts to depend on VTK8, we will no longer be able to use MultibodyPlant in many places within Anzu. Some parts of Anzu use third-party libraries that depend on VTK6. |
That libdrake.so will always depend on VTK is on par with the current situation. That is not my complaint. My complaint is users in the bazel_drake_external workflow (which includes TRI Anzu, as well as several research labs) who build Drake from source, need to be able to avoid the dependency. It's all about the Separately, I also still in general support libdrake.so being sliced into smaller pieces to curate each one's dependencies, but that is not directly related here. If we have the logical class design and physical component factoring right (as proven out by drake_bazel_external use case), we can still factor libdrake.so installation at a future point. |
Ok, I think my mental model is growing to encompass what you have in mind.
To summarize, the targeted workflow has the flavor that it allows end users to create a custom slice of all of Drake to be the Do I have that basically right? |
Yes, that's the gist of it. The only detail to nitpick is that |
I also think that factoring libdrake.so has to be in our roadmap soon. Looks like we have #7294 to track it. |
RenderEngine abstraction got stopped a few weeks ago -- requests for a design change on how RenderLabels are managed led to a rearchitecture that was interrupted by other issues. The RenderLabel rearchitecture is just about ready for a PR, so the chain will continue in the next day or so. |
Adding |
Expect |
|
Missing render engine feature added (#11545). Began 4-PR chain to get rendering exposed all the way through the |
Where is the current WIP branch for this feature? It doesn't seem to be |
Yeah -- sorry about that. That was the "raw" branch. This is the one that's been maintained and is being curated into commits: https://github.com/SeanCurtis-TRI/drake/tree/gw_renderer_remaining. |
Yes indeed, I confirm it avoids having MultibodyPlant depend on VTK. It adds more instances of package dependency cycles (geometry vs geometry/render vs systems/sensors vs etc.), but those were already there. I am holding off identifying and proposing how to fix those until #10675 is resolved. |
Sounds good. |
The 4-PR chain to integrate the public API is in progress. FIrst merged, second under platform review. Two subsequent PRs are waiting in the wings. |
The |
The last box has been checked. Finally closing! |
Rendering should ultimately belong in SceneGraph (it is, after all, an operation on geometry -- the query is: given camera properties, what is visible?) Currently, it is embodied in the
RgbdRenderer
indrake/sensors
. This issue tracks the work to move it from there into SceneGraph (changing things to conform to the more general SceneGraph paradigm).The following list of anticipated PRs will track the progress for moving rendering into SceneGraph (the list may evolve if it turns out any given PR is too large or too small):
InternalFrame
class. This is largely just some cosmetic stuff that should get done before it smears all over the new changes. (Clean up InternalFrame interface and docs #9541)SceneGraph
. (Refactor internal geometry classification #9570)RenderEngine
abstraction togeometry
(no implementation yet)RenderEngine
pre-requisites (indices, etc.)(Introduce RenderEngine prerequisites #10351)(Introduce preliminary elements for the RenderEngine #11043)RenderEngine
(without labels) and tests. (Add the abstract RenderEngine #11216)RenderEngine
(Adds label images to the RenderEngine #11331)RenderEngine
implementation.geometry_state_test.cc
in anticipation of expansion (Clean up pass on geometry state tests #11546)GeometryState
([render] Add RenderEngine and PerceptionRole to GeometryState #11553)GeometryState
(GeometryState adds role removal API. #11572)SceneGraph
andQueryObject
([render] Expose rendering API through QueryObejct/SceneGraph #11593)RgbdSensor
- the modern equivalent to the attic'dRgbdCamera
. (Introduce RgbdSensor #11704)dev/geometry
) (MBP "visual" geometry has both illustration and perception roles #11824)dev/geometry
dev/geometry
from ManipulationStation (Remove dev/geometry dependencies from ManipulationStation #11839)dev/geometry
everywhere else (Remove dev Geometry from scene graph examples #11829)ImageWriter
- a class for writing Drake Images (as produced byRgbdCamera
) to the disk. (Add ImageWriter #9882)geometry/dev
. (Complete removal of rendering dev artifacts #11859)Add and wire in OSPRay renderer into SceneGraph.Moved into its own issue ([render] Create RenderEngineOspray implementation #11744)/cc @kunimatsu-tri , @thduynguyen , @DamrongGuoy, @sherm1
The text was updated successfully, but these errors were encountered: