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

[humble] Get user specified parameters at startup #45

Closed
wants to merge 1 commit into from

Conversation

john-maidbot
Copy link
Collaborator

Currently, no plugins that declare parameters get the values at startup. This means that even if a user were to specify a parameter via ros2 launch or ros2 run, it would not get loaded. The only way to load a non-default parameter atm is to dynamically configure it after startup.

This PR fixes this by getting the parameter values at startup. For users who are currently using the default values, this PR does nothing. For users who want to be able to specify the parameters at startup, this will allow them to do that.

Relates to this issue: ros-perception/point_cloud_transport#66

@john-maidbot john-maidbot marked this pull request as draft May 11, 2024 17:45
@john-maidbot john-maidbot marked this pull request as ready for review May 11, 2024 18:00
@john-maidbot john-maidbot self-assigned this May 11, 2024
@john-maidbot john-maidbot requested a review from ahcorde May 11, 2024 18:01
@john-maidbot
Copy link
Collaborator Author

CI will fail until this gets merged: ros-perception/point_cloud_transport#79

Comment on lines -146 to +151
quantization_POSITION_paramDescriptor.name, config_.quantization_NORMAL,
quantization_POSITION_paramDescriptor.name, config_.quantization_POSITION,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

spotted some typos as well, so fixing those in this pass

@@ -85,6 +85,7 @@ void DracoPublisher::declareParameters(const std::string & base_topic)
declareParam<int>(
encode_speed_paramDescriptor.name, config_.encode_speed,
encode_speed_paramDescriptor);
getParam<int>(encode_speed_paramDescriptor.name, config_.encode_speed);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

primary change is to add these so that if a user has configured parameter values at startup, we get them

@john-maidbot
Copy link
Collaborator Author

appears to be working properly now.

I first tested this by just logging to verify that the parameters were getting set at startup now.

I also played back this rosbag with force_quantization on and off (set via ros2 run point_cloud_transport republish --ros-args -p out.draco.force_quantization:=<true/false>)
https://github.com/ros-perception/point_cloud_transport_tutorial/tree/rolling/resources

average size of raw messages
0.596 MB

force_quantization off
average size of draco messages
0.446 MB

force_quantization on
average size of draco messages
0.090 MB

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

@john-maidbot john-maidbot changed the title Get user specified parameters at startup [humble] Get user specified parameters at startup May 13, 2024
@john-maidbot
Copy link
Collaborator Author

Same here: #46

@ahcorde
Copy link
Collaborator

ahcorde commented May 16, 2024

closing this one in favour of this other one #50

@ahcorde ahcorde closed this May 16, 2024
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