RobotLocomotion/drake

GeometryProperties with aggregate values cannot be set in pydrake

Opened this issue · 0 comments

What happened?

Using the ("renderer", "accepting") property as a concrete example. The property is consumed by GeometryState and is used to determine if a geometry should be registered with a particular RenderEngine instance. The expected type of the property is std::set<string>.

Intuitively, one would expect in python, that to set the property, we could simply do:

properties = PerceptionProperties()
properties.AddProperty("rendererer", "accepting", set("A", "B"))

However, when GeometryState goes to extract the property, it does not find a property of type std::set<std::string>. Instead, it finds an instance of type drake:pydrake:Object.

There aren't too many properties of this type (this is the only one that immediately leaps to mind). Most other property values are instances of known primitive or C++ types bound in pydrake. So, the problem doesn't come up much. But it does prevent at least this one property from being set in python.

Version

No response

What operating system are you using?

No response

What installation option are you using?

No response

Relevant log output

No response