Skip to content

Bug in parsing config? #377

@ykyohei

Description

@ykyohei

A local discussion with @jlashner led to the conclusion that this might be a bug in ocs.

I found that the parser do not allow the duplicated numbers as follows, during testing hwp-gripper agent simonsobs/socs#646

default.yaml

"arguments":
         ["--mcu-ip", "192.168.13.34",
          "--control-port", "8041",
          '--warm-grip-distance', 10.0, 10.0, 15.0,
         ],

agent.py

pgroup.add_argument('--warm-grip-distance', nargs='+', type=float, default=[10.0, 10.0, 10.0],
                        help='Nominal distance for warm grip position')

Namespace(mcu_ip='192.168.13.34', control_port=8041, warm_grip_distance=[10.0, 15.0], ...

Some other test results

  • If I put 3 numbers from command line, it accepts duplicated values.

  • If I instead do '--warm-grip-distance', 10.0, 10.00, 15.0, then I get Namespace(mcu_ip='192.168.13.34', control_port=8041, warm_grip_distance=[10.0, 10.0, 15.0] ,...

  • If I do nargs=3 instead of nargs='+', then agent.py raise an error ocs-agent-cli: error: argument --adjustment-distance: expected 3 arguments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions