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

Generalize the get_state return value in components #31

Open
francocipollone opened this issue Jul 17, 2023 · 2 comments
Open

Generalize the get_state return value in components #31

francocipollone opened this issue Jul 17, 2023 · 2 comments
Labels
core enhancement New feature or request

Comments

@francocipollone
Copy link
Contributor

Summary

Nowadays the Component::get_state method is a bit flexible. No return type nor structure is demanded.

def get_state(self):
"""
Get the current state of the component.
"""
pass

For example:

Name:

def get_state(self) -> str:
return self._name

Type:

def get_state(self) -> str:
return self._type

Pose:

def get_state(self) -> list:
return self._position + self._rotation

Velocity:

def get_state(self):
return self._linear + self._angular

Proposal

Expect a return type of Dict[str, Any].

Where the dictionary will compose by keys and values from the component:

  • For Name: {'name' : 'A name'}
  • For Type: {'type' : 'A type'}
  • For Pose: {'position', [x, y ,z], 'rotation', [x, y ,z, w]}
  • For Velocity: {'linear', [x, y ,z], 'angular', [x, y ,z]}
@francocipollone
Copy link
Contributor Author

Wdyt @agalbachicar

@agalbachicar
Copy link
Contributor

I think it is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
Status: 🆕 Inbox
Development

No branches or pull requests

2 participants