Skip to content

Commit

Permalink
refactor(traffic_light_visualization): rework parameters (#8168)
Browse files Browse the repository at this point in the history
* refactor(traffic_light_visualization): rework parameters

Signed-off-by: batuhanbeytekin <batuhanbeytekin@gmail.com>

* style(pre-commit): autofix

Signed-off-by: batuhanbeytekin <batuhanbeytekin@gmail.com>

* style(pre-commit): autofix

---------

Signed-off-by: batuhanbeytekin <batuhanbeytekin@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
batuhanbeytekin and pre-commit-ci[bot] authored Jul 24, 2024
1 parent 3e501cf commit 5995801
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
4 changes: 2 additions & 2 deletions perception/traffic_light_visualization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install(
DESTINATION share/${PROJECT_NAME}/images
)

ament_auto_package(
INSTALL_TO_SHARE
ament_auto_package(INSTALL_TO_SHARE
config
launch
)
4 changes: 1 addition & 3 deletions perception/traffic_light_visualization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ None

#### Node Parameters

| Name | Type | Default Value | Description |
| ----------------------- | ---- | ------------- | --------------------------------------------------------------- |
| `enable_fine_detection` | bool | false | whether to visualize result of the traffic light fine detection |
{{json_to_markdown("perception/traffic_light_visualization/schema/traffic_light_visualization.schema.json")}}

## Assumptions / Known limits

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**:
ros__parameters:
enable_fine_detection: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for traffic_light_visualization",
"type": "object",
"definitions": {
"traffic_light_visualization": {
"type": "object",
"properties": {
"enable_fine_detection": {
"type": "boolean",
"description": "whether to visualize result of the traffic light fine detection",
"default": "false"
}
},
"required": ["enable_fine_detection"]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/traffic_light_visualization"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TrafficLightRoiVisualizerNode::TrafficLightRoiVisualizerNode(const rclcpp::NodeO
using std::placeholders::_2;
using std::placeholders::_3;
using std::placeholders::_4;
enable_fine_detection_ = this->declare_parameter("enable_fine_detection", false);
enable_fine_detection_ = this->declare_parameter<bool>("enable_fine_detection");

if (enable_fine_detection_) {
sync_with_rough_roi_.reset(new SyncWithRoughRoi(
Expand Down

0 comments on commit 5995801

Please sign in to comment.