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

Envire Types #2

Open
haider8645 opened this issue Jul 5, 2024 · 2 comments
Open

Envire Types #2

haider8645 opened this issue Jul 5, 2024 · 2 comments
Assignees

Comments

@haider8645
Copy link
Contributor

Hello,

Is there a reason why the types store the config value as local variables and then add them back to the config once the getFullConfig method is called. Would it be an option to simply just store the config and return it? because all these types are doing is communicate the config via the EnvireGraph to the the subscribers of event ItemAdded.

Best,
Haider

@planthaber
Copy link
Member

I can only guess, but these types look like they are meant to be part of the graph, where the normal mode of access is through the graph (e.g. Item), so the obvious way is to store the data in the node/item

These types are mostly meant for the mars robot simulation: https://github.com/orgs/mars-robot-simulation/repositories

@jliersch
Copy link
Contributor

jliersch commented Aug 27, 2024

From my perspective it indirectly validates the config maps given to the constructors to some extend. But this could be done more elegantly using config schemas (cf. #5).

Also having the additional operations is more error-prone. For example it seems like the parameters minValue and maxValue will be missing in the returned ConfigMap from the first call to getFullConfigMap here:

configmaps::ConfigMap getFullConfigMap() {
configmaps::ConfigMap config;
config.append(configMap);
config["name"] = name;
config["type"] = type;
configMap["minValue"] = minValue;
configMap["maxValue"] = maxValue;
config["maxEffort"] = maxEffort;
config["maxSpeed"] = maxSpeed;
config["maxEffortControl"] = maxEffortControl;
return config;

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

4 participants