Skip to content

Commit

Permalink
chore(autoware_traffic_light_multi_camera_fusion): created Schema fil…
Browse files Browse the repository at this point in the history
…e and updated ReadME file for parameters setting (#9994)

* feat(autoware_traffic_light_multi_camera_fusion): Created Schema file and updated ReadME file for parameters setting

Signed-off-by: vish0012 <[email protected]>

* style(pre-commit): autofix

* fix: updated param file , schema and node.cpp file  for traffic_light_multi_camera_fusion as per review comments

Signed-off-by: vish0012 <[email protected]>

* style(pre-commit): autofix

* Update traffic_light_multi_camera_fusion_node.cpp

updated code as per suggestion

* style(pre-commit): autofix

---------

Signed-off-by: vish0012 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
vish0012 and pre-commit-ci[bot] authored Feb 5, 2025
1 parent 8ee3fed commit 15ce10e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,4 @@ You don't need to configure these topics manually. Just provide the `camera_name

## Node parameters

| Parameter | Type | Description |
| ---------------------- | --------------- | ------------------------------------------------ |
| `camera_namespaces` | vector\<string> | Camera Namespaces to be fused |
| `message_lifespan` | double | The maximum timestamp span to be fused |
| `approximate_sync` | bool | Whether work in Approximate Synchronization Mode |
| `perform_group_fusion` | bool | Whether perform Group Fusion |
{{ json_to_markdown("perception/autoware_traffic_light_multi_camera_fusion/schema/traffic_light_multi_camera_fusion.schema.json") }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
camera_namespaces: ["camera6", "camera7"]
message_lifespan: 0.09
approximate_sync: false
perform_group_fusion: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "autoware_traffic_light_multi_camera_fusion parameter",
"type": "object",
"definitions": {
"autoware_traffic_light_multi_camera_fusion": {
"type": "object",
"properties": {
"camera_namespaces": {
"type": "array",
"description": "Camera namespaces to be fused.",
"items": {
"type": "string"
},
"default": []
},
"message_lifespan": {
"type": "number",
"description": "The maximum timestamp span to be fused.",
"default": 0.0
},
"approximate_sync": {
"type": "boolean",
"description": "Whether to work in Approximate Synchronization Mode.",
"default": false
}
},
"required": ["camera_namespaces", "message_lifespan", "approximate_sync"],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/autoware_traffic_light_multi_camera_fusion"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ MultiCameraFusion::MultiCameraFusion(const rclcpp::NodeOptions & node_options)
using std::placeholders::_3;

std::vector<std::string> camera_namespaces =
this->declare_parameter("camera_namespaces", std::vector<std::string>{});
is_approximate_sync_ = this->declare_parameter<bool>("approximate_sync", false);
message_lifespan_ = this->declare_parameter<double>("message_lifespan", 0.09);
this->declare_parameter<std::vector<std::string>>("camera_namespaces");
is_approximate_sync_ = this->declare_parameter<bool>("approximate_sync");
message_lifespan_ = this->declare_parameter<double>("message_lifespan");
for (const std::string & camera_ns : camera_namespaces) {
std::string signal_topic = camera_ns + "/classification/traffic_signals";
std::string roi_topic = camera_ns + "/detection/rois";
Expand Down

0 comments on commit 15ce10e

Please sign in to comment.