forked from ctu-vras/point_cloud_transport_plugins
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor decode_speed_paramDescriptor; | ||
decode_speed_paramDescriptor.name = "decode_speed"; | ||
|
@@ -99,6 +100,7 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
declareParam<int>( | ||
decode_speed_paramDescriptor.name, config_.decode_speed, | ||
decode_speed_paramDescriptor); | ||
getParam<int>(decode_speed_paramDescriptor.name, config_.decode_speed); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor encode_method_paramDescriptor; | ||
encode_method_paramDescriptor.name = "encode_method"; | ||
|
@@ -113,13 +115,15 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
declareParam<int>( | ||
encode_method_paramDescriptor.name, config_.encode_method, | ||
encode_method_paramDescriptor); | ||
getParam<int>(encode_method_paramDescriptor.name, config_.encode_method); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor deduplicate_paramDescriptor; | ||
deduplicate_paramDescriptor.name = "deduplicate"; | ||
deduplicate_paramDescriptor.type = rcl_interfaces::msg::ParameterType::PARAMETER_BOOL; | ||
deduplicate_paramDescriptor.description = | ||
"Remove duplicate point entries."; | ||
declareParam<bool>(deduplicate_paramDescriptor.name, true, deduplicate_paramDescriptor); | ||
getParam<bool>(deduplicate_paramDescriptor.name, config_.deduplicate); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor force_quantization_paramDescriptor; | ||
force_quantization_paramDescriptor.name = "force_quantization"; | ||
|
@@ -130,6 +134,7 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
declareParam<bool>( | ||
force_quantization_paramDescriptor.name, config_.force_quantization, | ||
force_quantization_paramDescriptor); | ||
getParam<bool>(force_quantization_paramDescriptor.name, config_.force_quantization); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor quantization_POSITION_paramDescriptor; | ||
quantization_POSITION_paramDescriptor.name = "quantization_POSITION"; | ||
|
@@ -143,8 +148,9 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
.set__to_value(31) | ||
.set__step(1)}); | ||
declareParam<int>( | ||
quantization_POSITION_paramDescriptor.name, config_.quantization_NORMAL, | ||
quantization_POSITION_paramDescriptor.name, config_.quantization_POSITION, | ||
Comment on lines
-146
to
+151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spotted some typos as well, so fixing those in this pass |
||
quantization_POSITION_paramDescriptor); | ||
getParam<int>(quantization_POSITION_paramDescriptor.name, config_.quantization_POSITION); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor quantization_NORMAL_paramDescriptor; | ||
quantization_NORMAL_paramDescriptor.name = "quantization_NORMAL"; | ||
|
@@ -157,8 +163,9 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
.set__to_value(31) | ||
.set__step(1)}); | ||
declareParam<int>( | ||
quantization_NORMAL_paramDescriptor.name, config_.quantization_COLOR, | ||
quantization_NORMAL_paramDescriptor.name, config_.quantization_NORMAL, | ||
quantization_NORMAL_paramDescriptor); | ||
getParam<int>(quantization_NORMAL_paramDescriptor.name, config_.quantization_NORMAL); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor quantization_COLOR_paramDescriptor; | ||
quantization_COLOR_paramDescriptor.name = "quantization_COLOR"; | ||
|
@@ -171,8 +178,9 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
.set__to_value(31) | ||
.set__step(1)}); | ||
declareParam<int>( | ||
quantization_COLOR_paramDescriptor.name, config_.quantization_TEX_COORD, | ||
quantization_COLOR_paramDescriptor.name, config_.quantization_COLOR, | ||
quantization_COLOR_paramDescriptor); | ||
getParam<int>(quantization_COLOR_paramDescriptor.name, config_.quantization_COLOR); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor quantization_TEX_COORD_paramDescriptor; | ||
quantization_TEX_COORD_paramDescriptor.name = "quantization_TEX_COORD"; | ||
|
@@ -186,8 +194,9 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
.set__to_value(31) | ||
.set__step(1)}); | ||
declareParam<int>( | ||
quantization_TEX_COORD_paramDescriptor.name, config_.quantization_GENERIC, | ||
quantization_TEX_COORD_paramDescriptor.name, config_.quantization_TEX_COORD, | ||
quantization_TEX_COORD_paramDescriptor); | ||
getParam<int>(quantization_TEX_COORD_paramDescriptor.name, config_.quantization_TEX_COORD); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor quantization_GENERIC_paramDescriptor; | ||
quantization_GENERIC_paramDescriptor.name = "quantization_GENERIC"; | ||
|
@@ -201,8 +210,9 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
.set__to_value(31) | ||
.set__step(1)}); | ||
declareParam<int>( | ||
quantization_GENERIC_paramDescriptor.name, config_.quantization_POSITION, | ||
quantization_GENERIC_paramDescriptor.name, config_.quantization_GENERIC, | ||
quantization_GENERIC_paramDescriptor); | ||
getParam<int>(quantization_GENERIC_paramDescriptor.name, config_.quantization_GENERIC); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor expert_quantization_paramDescriptor; | ||
expert_quantization_paramDescriptor.name = "expert_quantization"; | ||
|
@@ -214,6 +224,7 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
declareParam<bool>( | ||
expert_quantization_paramDescriptor.name, config_.expert_quantization, | ||
expert_quantization_paramDescriptor); | ||
getParam<bool>(expert_quantization_paramDescriptor.name, config_.expert_quantization); | ||
|
||
rcl_interfaces::msg::ParameterDescriptor expert_attribute_types_paramDescriptor; | ||
expert_attribute_types_paramDescriptor.name = "expert_attribute_types"; | ||
|
@@ -225,7 +236,9 @@ void DracoPublisher::declareParameters(const std::string & base_topic) | |
declareParam<bool>( | ||
expert_attribute_types_paramDescriptor.name, config_.expert_attribute_types, | ||
expert_attribute_types_paramDescriptor); | ||
getParam<bool>(expert_attribute_types_paramDescriptor.name, config_.expert_attribute_types); | ||
|
||
// we call get param at runtime to get the latest value for these | ||
declareParam<std::string>("attribute_mapping.attribute_type.x", "POSITION"); | ||
declareParam<std::string>("attribute_mapping.attribute_type.y", "POSITION"); | ||
declareParam<std::string>("attribute_mapping.attribute_type.z", "POSITION"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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