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

Refactor/constants #39

Merged
merged 3 commits into from
Jan 21, 2025
Merged

Refactor/constants #39

merged 3 commits into from
Jan 21, 2025

Conversation

Oscar-gg
Copy link
Member

  • Added constants package

Use cases:

  • Import constants into python files
  • Load constants to yaml objects in launch files.

Notes:

  • Current constant mechanism only works for python files (we could later create scripts to generate files compatible with cpp files, depending on use cases.)
  • Added usage examples in some of HRI config files and launch files.
  • Adding constants in frida_interfaces was not possible: apparently, rosidl_generate_interfaces and ament_python_install_package don't work in the same CMake project. There are several workarounds but will leave as it is for the moment.

@Oscar-gg Oscar-gg requested a review from a team January 20, 2025 05:18
@Oscar-gg Oscar-gg requested a review from a team as a code owner January 20, 2025 05:18
Copy link
Member

@IvanRomero03 IvanRomero03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fk it we ball

hear_config = os.path.join(
get_package_share_directory("speech"), "config", "hear.yaml"
)
speaker_config = os.path.join(
get_package_share_directory("speech"), "config", "speaker.yaml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not getting why are we changing this??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yaml config has keys with values "REPLACE". parse_ros_config updates such values, using the constants defined in ModuleNames.HRI.value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmao, seems like a lot isnt it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to have all in one place, why should we keep the input name in the config?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but seems ok either way, this also seems pretty elegant, I dont dislike it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to close this, just wanted to know why

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 would prefer to have all in one place, why should we keep the input name in the config?

Hmm, so that we know which values to insert / which values are being replaced?

@Oscar-gg Oscar-gg merged commit 2b365aa into main Jan 21, 2025
5 checks passed
@Oscar-gg Oscar-gg deleted the refactor/constants branch January 23, 2025 16:32
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

Successfully merging this pull request may close these issues.

2 participants