Skip to content
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

Use ConfigSchema to validate the config map used for initialization #5

Open
jliersch opened this issue Aug 27, 2024 · 3 comments
Open

Comments

@jliersch
Copy link
Contributor

Situation

Currently the types check if all required keys are present in the given configmap using a conjunction. If it fails, a generic error message regarding missing keys is printed.

Task

For each type, define a config schema to be used by configmaps/ConfigSchema to validate the given config on construction of the type objects.

@jliersch jliersch mentioned this issue Aug 27, 2024
@jliersch
Copy link
Contributor Author

@jliersch
Copy link
Contributor Author

validating minValue of motor types currently claims invalid data types:

ConfigSchema::validate_types: Invalid value for "minValue", expected "number"
[20240828-17:09:09:211] [ERROR] - envire_types::Invalid configuration for type envire::types::motors::PID; item name: rover_5connector_roll

This is the used configuration:

motors:
- d: 0
  i: 0
  joint: connector_roll
  maxEffort: 50.0
  maxSpeed: 0.349066
  maxValue: 0.523599
  minValue: -0.523599
  name: connector_roll
  p: 20.0
  type: PID

Maybe ConfigSchema.validate can't handle negative doubles?

@jliersch
Copy link
Contributor Author

jliersch commented Sep 2, 2024

validating minValue of motor types currently claims invalid data types:

ConfigSchema::validate_types: Invalid value for "minValue", expected "number"
[20240828-17:09:09:211] [ERROR] - envire_types::Invalid configuration for type envire::types::motors::PID; item name: rover_5connector_roll

This is the used configuration:

motors:
- d: 0
  i: 0
  joint: connector_roll
  maxEffort: 50.0
  maxSpeed: 0.349066
  maxValue: 0.523599
  minValue: -0.523599
  name: connector_roll
  p: 20.0
  type: PID

Maybe ConfigSchema.validate can't handle negative doubles?

This was fixed with rock-simulation/configmaps#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant