-
Notifications
You must be signed in to change notification settings - Fork 111
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
[RSDK-447] Opt-in to implicit dependencies for all components #1488
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a follow up PR: We need to standardize errors that we return from Validate(). We have a handful of variation for a missing board. They should all be NewConfigValidationFieldRequiredError
errors.
} | ||
if cfg.Power == "" { | ||
return utils.NewConfigValidationFieldRequiredError(path, "power") | ||
return nil, utils.NewConfigValidationFieldRequiredError(path, "power") | ||
} | ||
|
||
if cfg.AnalogReader != "psi" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(unrelated to this PR) That's a very strange requirement. If this doesn't make sense to you either, can you please open a ticket to remove this requirement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with the softrobotic gripper, looks like its supposed to be a pin so make sense its required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because of the ADC magic we do to make this gripper work with a pi. We can remove all these requirements and return warnings if we ever want to break this code.
} | ||
|
||
// Validate ensures all parts of the config are valid. | ||
func (config *Config) Validate(path string) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no buttons
and axes
validation? Should they be marked optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly would have to ask @Otterverse. I don't think anyone in nyc has used a gpio input controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since he's on PTO, I looked at the file, I suggest omitting them both as empty by default, and only returning an error or warning if both Buttons
and Axes
are empty. There can be a use case where you use the joystick or the buttons only. @npmenard
@@ -42,6 +42,28 @@ type TMC5072Config struct { | |||
HoldDelay int32 `json:"hold_delay,omitempty"` // 0=instant powerdown, 1-15=delay * 2^18 clocks, 6 default | |||
} | |||
|
|||
// Validate ensures all parts of the config are valid. | |||
func (config *TMC5072Config) Validate(path string) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I don't know much about this component) Are all of these really required? Should pins
be validated too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rob1in Can you help us out here?
@@ -30,32 +30,33 @@ type AttrConfig struct { | |||
SPI string `json:"spi"` | |||
Speed *int `json:"spi_baud_rate"` | |||
Pfreq *int `json:"polling_freq_hz"` | |||
CSPin string `json:"cs_pin"` | |||
CSPin string `json:"chip_select_pin"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a breaking change, let's do this separately and bundle with other breaking changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think anyone is using a vectornav except Nicolas. Might be okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes i am the only one so i vote we should do it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this PR just for arm/board-dependent components? cameramono
depends on a camera for example. I think boat and the trossen grippers also depend on arms.
} | ||
|
||
// Validate ensures all parts of the config are valid. | ||
func (config *Config) Validate(path string) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly would have to ask @Otterverse. I don't think anyone in nyc has used a gpio input controller.
@@ -42,6 +42,28 @@ type TMC5072Config struct { | |||
HoldDelay int32 `json:"hold_delay,omitempty"` // 0=instant powerdown, 1-15=delay * 2^18 clocks, 6 default | |||
} | |||
|
|||
// Validate ensures all parts of the config are valid. | |||
func (config *TMC5072Config) Validate(path string) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rob1in Can you help us out here?
@@ -30,32 +30,33 @@ type AttrConfig struct { | |||
SPI string `json:"spi"` | |||
Speed *int `json:"spi_baud_rate"` | |||
Pfreq *int `json:"polling_freq_hz"` | |||
CSPin string `json:"cs_pin"` | |||
CSPin string `json:"chip_select_pin"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think anyone is using a vectornav except Nicolas. Might be okay?
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, did you decide what to do with the buttons/axes validation?
|
Also address RSDK-444