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

Add JSON tags to configuration struct #142

Open
kilianp07 opened this issue Feb 24, 2024 · 0 comments
Open

Add JSON tags to configuration struct #142

kilianp07 opened this issue Feb 24, 2024 · 0 comments

Comments

@kilianp07
Copy link

Hi !
It would be nice to add JSON tags to the conf structure to automate controller configuration. In my case this required me to create a structure with tags and cast it into your, I think this could be simplified by adding it to yours.

Here's my suggestion:

// ControllerConfig contains configurable parameters for a Controller.
type ControllerConfig struct {
	// ProportionalGain determines ratio of output response to error signal.
	ProportionalGain float64 `json:"kp"`
	// IntegralGain determines previous error's affect on output.
	IntegralGain float64 `json:"ki"`
	// DerivativeGain decreases the sensitivity to large reference changes.
	DerivativeGain float64 `json:"kd"`
}

Best regards.

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