You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that rendering engines must be added to the scene graph before the diagram which contains the scene graph is built. If not, some system (I think it's the RgbdSensor) raise the following exception: RuntimeError: No renderer exists with name: 'camera'.
This is not especially problematic for me, but it does not appear to be documented anywhere that this is the case. I'm not sure if this is a bug or the intended functionality, but it would be helpful for this to be more clearly documented.
Here is some pseudo-code for re-creating this issue.
frompydrake.allimportRobotDiagramBuilder, MakeRenderEngineGl, RenderEngineGlParams, DiagramBuilderrdb=RobotDiagramBuilder(time_step=0)
rdb.AddModelsFromURL(...)
# Add a renderer to the scene graph# Results in correct behavior because this is called before `rdb.Build()`rdb.scene_graph().AddRenderer('camera', MakeRenderEngineGl(RenderEngineGlParams())
robot=rdb.Build()
# Create a higher level diagram with other systemsbuilder=DiagramBuilder()
builder.AddNamedSystem('robot', robot)
# Add a renderer to the scene graph here instead# Technically succeeds, but ultimately results in **incorrect** behavior because this is called after `rdb.Build()` where scene graph is built into robot diagram# robot.scene_graph().AddRenderer('camera', MakeRenderEngineGl(RenderEngineGlParams())# The following assert also succeeds, even though the end result at `ForcedPublish` is an exception that says no renderer by the same name can be found# assert robot.scene_graph().HasRenderer('camera')# Add a camera
...
# Add a system that connects to the camera
...
# Connect subsystems together
...
# Build the diagramdiagram=builder.Build()
# Publish to trigger image generationcontext=diagram.CreateDefaultContext()
diagram.ForcedPublish(context)
Version
v1.36.0
What operating system are you using?
Ubuntu 22.04
What installation option are you using?
pip install drake
Relevant log output
The text was updated successfully, but these errors were encountered:
What happened?
It appears that rendering engines must be added to the scene graph before the diagram which contains the scene graph is built. If not, some system (I think it's the
RgbdSensor
) raise the following exception:RuntimeError: No renderer exists with name: 'camera'
.This is not especially problematic for me, but it does not appear to be documented anywhere that this is the case. I'm not sure if this is a bug or the intended functionality, but it would be helpful for this to be more clearly documented.
Here is some pseudo-code for re-creating this issue.
Version
v1.36.0
What operating system are you using?
Ubuntu 22.04
What installation option are you using?
pip install drake
Relevant log output
The text was updated successfully, but these errors were encountered: