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

[RSDK-447] Opt-in to implicit dependencies for all components #1488

Merged
merged 18 commits into from
Oct 25, 2022

Conversation

npmenard
Copy link
Member

@npmenard npmenard commented Oct 13, 2022

Also address RSDK-444

@npmenard npmenard requested a review from randhid October 18, 2022 13:38
Copy link
Member

@stevebriskin stevebriskin left a 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" {
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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) {
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

@randhid randhid Oct 19, 2022

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

components/motor/gpio/motor_encoder.go Show resolved Hide resolved
components/motor/gpio/setup.go Outdated Show resolved Hide resolved
components/motor/gpio/setup.go Show resolved Hide resolved
@@ -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) {
Copy link
Member

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?

Copy link
Member

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?

components/movementsensor/gpsnmea/gpsnmea.go Show resolved Hide resolved
@@ -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"`
Copy link
Member

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

Copy link
Member

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?

Copy link
Member Author

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 :)

Copy link
Member

@randhid randhid left a 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.

components/motor/fake/motor.go Show resolved Hide resolved
}

// Validate ensures all parts of the config are valid.
func (config *Config) Validate(path string) ([]string, error) {
Copy link
Member

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.

components/motor/gpio/motor_encoder.go Show resolved Hide resolved
components/motor/gpio/setup.go Outdated Show resolved Hide resolved
components/motor/i2cmotors/ezopmp.go Show resolved Hide resolved
@@ -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) {
Copy link
Member

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?

components/movementsensor/gpsnmea/gpsnmea.go Show resolved Hide resolved
@@ -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"`
Copy link
Member

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?

@github-actions

This comment was marked as off-topic.

@npmenard npmenard requested a review from randhid October 19, 2022 14:15
Copy link
Member

@randhid randhid left a 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?

@npmenard npmenard added the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@edaniels edaniels added the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@npmenard npmenard added the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@npmenard npmenard added the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@npmenard npmenard added the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@npmenard npmenard added the safe to test This pull request is marked safe to test from a trusted zone label Oct 25, 2022
@github-actions
Copy link
Contributor

Code Coverage

Package Line Rate Health
go.viam.com/rdk/components/arm 59%
go.viam.com/rdk/components/arm/universalrobots 12%
go.viam.com/rdk/components/arm/xarm 2%
go.viam.com/rdk/components/arm/yahboom 7%
go.viam.com/rdk/components/audioinput 55%
go.viam.com/rdk/components/base 68%
go.viam.com/rdk/components/base/agilex 62%
go.viam.com/rdk/components/base/boat 41%
go.viam.com/rdk/components/base/wheeled 76%
go.viam.com/rdk/components/board 69%
go.viam.com/rdk/components/board/arduino 10%
go.viam.com/rdk/components/board/commonsysfs 47%
go.viam.com/rdk/components/board/fake 39%
go.viam.com/rdk/components/board/numato 19%
go.viam.com/rdk/components/board/pi 50%
go.viam.com/rdk/components/camera 66%
go.viam.com/rdk/components/camera/fake 67%
go.viam.com/rdk/components/camera/ffmpeg 72%
go.viam.com/rdk/components/camera/transformpipeline 80%
go.viam.com/rdk/components/camera/videosource 55%
go.viam.com/rdk/components/encoder/fake 77%
go.viam.com/rdk/components/gantry 68%
go.viam.com/rdk/components/gantry/multiaxis 84%
go.viam.com/rdk/components/gantry/oneaxis 86%
go.viam.com/rdk/components/generic 84%
go.viam.com/rdk/components/gripper 82%
go.viam.com/rdk/components/input 86%
go.viam.com/rdk/components/input/gpio 83%
go.viam.com/rdk/components/motor 82%
go.viam.com/rdk/components/motor/dmc4000 69%
go.viam.com/rdk/components/motor/fake 58%
go.viam.com/rdk/components/motor/gpio 63%
go.viam.com/rdk/components/motor/gpiostepper 57%
go.viam.com/rdk/components/motor/tmcstepper 62%
go.viam.com/rdk/components/movementsensor 67%
go.viam.com/rdk/components/movementsensor/cameramono 40%
go.viam.com/rdk/components/movementsensor/gpsnmea 37%
go.viam.com/rdk/components/movementsensor/gpsrtk 28%
go.viam.com/rdk/components/posetracker 88%
go.viam.com/rdk/components/sensor 88%
go.viam.com/rdk/components/sensor/ultrasonic 34%
go.viam.com/rdk/components/servo 77%
go.viam.com/rdk/config 77%
go.viam.com/rdk/control 57%
go.viam.com/rdk/data 78%
go.viam.com/rdk/grpc 25%
go.viam.com/rdk/ml 67%
go.viam.com/rdk/ml/inference 70%
go.viam.com/rdk/motionplan 71%
go.viam.com/rdk/operation 84%
go.viam.com/rdk/pointcloud 71%
go.viam.com/rdk/protoutils 62%
go.viam.com/rdk/referenceframe 78%
go.viam.com/rdk/registry 88%
go.viam.com/rdk/resource 85%
go.viam.com/rdk/rimage 78%
go.viam.com/rdk/rimage/depthadapter 94%
go.viam.com/rdk/rimage/transform 73%
go.viam.com/rdk/rimage/transform/cmd/extrinsic_calibration 67%
go.viam.com/rdk/robot 93%
go.viam.com/rdk/robot/client 79%
go.viam.com/rdk/robot/framesystem 68%
go.viam.com/rdk/robot/impl 80%
go.viam.com/rdk/robot/server 59%
go.viam.com/rdk/robot/web 60%
go.viam.com/rdk/robot/web/stream 87%
go.viam.com/rdk/services/armremotecontrol 75%
go.viam.com/rdk/services/armremotecontrol/builtin 25%
go.viam.com/rdk/services/baseremotecontrol 75%
go.viam.com/rdk/services/baseremotecontrol/builtin 71%
go.viam.com/rdk/services/datamanager 62%
go.viam.com/rdk/services/datamanager/builtin 78%
go.viam.com/rdk/services/datamanager/datacapture 34%
go.viam.com/rdk/services/datamanager/datasync 70%
go.viam.com/rdk/services/motion 68%
go.viam.com/rdk/services/motion/builtin 89%
go.viam.com/rdk/services/navigation 54%
go.viam.com/rdk/services/sensors 78%
go.viam.com/rdk/services/sensors/builtin 97%
go.viam.com/rdk/services/shell 15%
go.viam.com/rdk/services/slam 86%
go.viam.com/rdk/services/slam/builtin 73%
go.viam.com/rdk/services/vision 82%
go.viam.com/rdk/services/vision/builtin 74%
go.viam.com/rdk/spatialmath 85%
go.viam.com/rdk/subtype 96%
go.viam.com/rdk/utils 71%
go.viam.com/rdk/vision 26%
go.viam.com/rdk/vision/chess 80%
go.viam.com/rdk/vision/delaunay 87%
go.viam.com/rdk/vision/keypoints 92%
go.viam.com/rdk/vision/objectdetection 82%
go.viam.com/rdk/vision/odometry 60%
go.viam.com/rdk/vision/odometry/cmd 0%
go.viam.com/rdk/vision/segmentation 49%
go.viam.com/rdk/web/server 26%
Summary 66% (19091 / 28839)

@npmenard npmenard merged commit 43e10e5 into viamrobotics:main Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants