最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

drake - Specify background color in Scenario Camera Config yaml - Stack Overflow

programmeradmin2浏览0评论

I would like to use a scenario yaml file for defining my cameras. However, I'm getting RuntimeError: The fields ['_tag'] were unknown to the schema when trying to parse the CameraConfig portion of my scenario file.

I'm trying to achieve it with the following:

@dc.dataclass
class Scenario:
    cameras: typing.Mapping[str, CameraConfig] = dc.field(default_factory=dict)

scenario = yaml_load_typed(
        schema=Scenario, filename=..., defaults=Scenario()
    )

My yaml file looks something like this:

cameras:
  camera0:
    name: camera0
    background: !Rgba { rgba: [0, 0, 0, 1] }

The issue seems to be with the !Rgba not being recognized. However, this seems to be the correct class based on the CameraConfig class.

Note: The Drake Blender Example makes playing with this easy.

What am I doing wrong here?

I would like to use a scenario yaml file for defining my cameras. However, I'm getting RuntimeError: The fields ['_tag'] were unknown to the schema when trying to parse the CameraConfig portion of my scenario file.

I'm trying to achieve it with the following:

@dc.dataclass
class Scenario:
    cameras: typing.Mapping[str, CameraConfig] = dc.field(default_factory=dict)

scenario = yaml_load_typed(
        schema=Scenario, filename=..., defaults=Scenario()
    )

My yaml file looks something like this:

cameras:
  camera0:
    name: camera0
    background: !Rgba { rgba: [0, 0, 0, 1] }

The issue seems to be with the !Rgba not being recognized. However, this seems to be the correct class based on the CameraConfig class.

Note: The Drake Blender Example makes playing with this easy.

What am I doing wrong here?

Share Improve this question edited Jan 30 at 2:28 Nicholas Pfaff asked Jan 30 at 2:23 Nicholas PfaffNicholas Pfaff 7111 gold badge5 silver badges19 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

It requires a very special/bespoke spelling.

cameras:
  camera0:
    name: camera0
    background:
      rgba: [0, 0, 0, 1]
发布评论

评论列表(0)

  1. 暂无评论