Skip to content

Commit d8679eb

Browse files
committed
update readme
Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
1 parent 80a328d commit d8679eb

File tree

7 files changed

+143
-31
lines changed

7 files changed

+143
-31
lines changed

Diff for: autoware_utils/README.md

-28
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,10 @@ The ROS module provides utilities for working with ROS messages and nodes:
5050
- **`marker_helper.hpp`**: Helper functions for creating and manipulating visualization markers.
5151
- **`msg_covariance.hpp`**: Indices for accessing covariance matrices in ROS messages.
5252
- **`msg_operation.hpp`**: Overloaded operators for quaternion messages.
53-
- **`parameter.hpp`**: Simplifies parameter retrieval and declaration.
54-
- **`polling_subscriber.hpp`**: A subscriber class with different polling policies (latest, newest, all).
5553
- **`processing_time_publisher.hpp`**: Publishes processing times as diagnostic messages.
5654
- **`published_time_publisher.hpp`**: Tracks and publishes the time when messages are published.
5755
- **`self_pose_listener.hpp`**: Listens to the self-pose of the vehicle.
58-
- **`update_param.hpp`**: Updates parameters from remote nodes.
5956
- **`uuid_helper.hpp`**: Utilities for generating and managing UUIDs.
60-
- **`wait_for_param.hpp`**: Waits for parameters from remote nodes.
6157
- **`debug_traits.hpp`**: Traits for identifying debug message types.
6258

6359
#### System Module
@@ -133,30 +129,6 @@ int main() {
133129

134130
### Detailed Usage Examples
135131

136-
#### Update Parameters Dynamically with update_param.hpp
137-
138-
```cpp
139-
#include "autoware_utils/ros/update_param.hpp"
140-
#include <rclcpp/rclcpp.hpp>
141-
142-
int main(int argc, char * argv[]) {
143-
rclcpp::init(argc, argv);
144-
auto node = rclcpp::Node::make_shared("param_node");
145-
146-
double param_value = 0.0;
147-
std::vector<rclcpp::Parameter> params = node->get_parameters({"my_param"});
148-
149-
if (autoware_utils::update_param(params, "my_param", param_value)) {
150-
RCLCPP_INFO(node->get_logger(), "Updated parameter value: %f", param_value);
151-
} else {
152-
RCLCPP_WARN(node->get_logger(), "Parameter 'my_param' not found.");
153-
}
154-
155-
rclcpp::shutdown();
156-
return 0;
157-
}
158-
```
159-
160132
#### Logging Processing Times with ProcessingTimePublisher
161133

162134
```cpp
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2025 The Autoware Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef AUTOWARE_UTILS__ROS__PARAMETER_HPP_
16+
#define AUTOWARE_UTILS__ROS__PARAMETER_HPP_
17+
18+
// NOLINTBEGIN(build/namespaces, whitespace/line_length)
19+
// clang-format off
20+
21+
#pragma message("#include <autoware_utils/ros/parameter.hpp> is deprecated. Use #include <autoware_utils_rclcpp/parameter.hpp> instead.")
22+
#include <autoware_utils_rclcpp/parameter.hpp>
23+
namespace autoware_utils { using namespace autoware_utils_rclcpp; }
24+
25+
// clang-format on
26+
// NOLINTEND
27+
28+
#endif // AUTOWARE_UTILS__ROS__PARAMETER_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2025 The Autoware Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_
16+
#define AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_
17+
18+
// NOLINTBEGIN(build/namespaces, whitespace/line_length)
19+
// clang-format off
20+
21+
#pragma message("#include <autoware_utils/ros/polling_subscriber.hpp> is deprecated. Use #include <autoware_utils_rclcpp/polling_subscriber.hpp> instead.")
22+
#include <autoware_utils_rclcpp/polling_subscriber.hpp>
23+
namespace autoware_utils { using namespace autoware_utils_rclcpp; }
24+
25+
// clang-format on
26+
// NOLINTEND
27+
28+
#endif // AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2025 The Autoware Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef AUTOWARE_UTILS__ROS__UPDATE_PARAM_HPP_
16+
#define AUTOWARE_UTILS__ROS__UPDATE_PARAM_HPP_
17+
18+
// NOLINTBEGIN(build/namespaces, whitespace/line_length)
19+
// clang-format off
20+
21+
#pragma message("#include <autoware_utils/ros/update_param.hpp> is deprecated. Use #include <autoware_utils_rclcpp/parameter.hpp> instead.")
22+
#include <autoware_utils_rclcpp/parameter.hpp>
23+
namespace autoware_utils { using namespace autoware_utils_rclcpp; }
24+
25+
// clang-format on
26+
// NOLINTEND
27+
28+
#endif // AUTOWARE_UTILS__ROS__UPDATE_PARAM_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2025 The Autoware Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef AUTOWARE_UTILS__ROS__WAIT_FOR_PARAM_HPP_
16+
#define AUTOWARE_UTILS__ROS__WAIT_FOR_PARAM_HPP_
17+
18+
// NOLINTBEGIN(build/namespaces, whitespace/line_length)
19+
// clang-format off
20+
21+
#pragma message("#include <autoware_utils/ros/wait_for_param.hpp> is deprecated. Use #include <autoware_utils_rclcpp/parameter.hpp> instead.")
22+
#include <autoware_utils_rclcpp/parameter.hpp>
23+
namespace autoware_utils { using namespace autoware_utils_rclcpp; }
24+
25+
// clang-format on
26+
// NOLINTEND
27+
28+
#endif // AUTOWARE_UTILS__ROS__WAIT_FOR_PARAM_HPP_

Diff for: autoware_utils/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<depend>autoware_planning_msgs</depend>
2222
<depend>autoware_utils_geometry</depend>
2323
<depend>autoware_utils_pcl</depend>
24+
<depend>autoware_utils_rclcpp</depend>
2425
<depend>autoware_vehicle_msgs</depend>
2526
<depend>builtin_interfaces</depend>
2627
<depend>diagnostic_msgs</depend>

Diff for: autoware_utils_rclcpp/README.md

+30-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,36 @@
33
## Overview
44

55
The **autoware_utils** library is a comprehensive toolkit designed to facilitate the development of autonomous driving applications.
6-
This package provides essential utilities for visualization.
7-
It is extensively used in the Autoware project to handle common tasks such as creating markers for RViz.
6+
This package provides essential utilities for rclcpp.
7+
It is extensively used in the Autoware project to handle common tasks such as handling parameters, topics and services.
88

99
## Design
1010

11-
- **`marker_helper.hpp`**: Helper functions for creating and manipulating visualization markers.
11+
- **`parameter.hpp`**: Simplifies parameter declaration, retrieval, updating, and waiting.
12+
- **`polling_subscriber.hpp`**: A subscriber class with different polling policies (latest, newest, all).
13+
14+
## Example Code Snippets
15+
16+
### Update Parameters Dynamically with update_param.hpp
17+
18+
```cpp
19+
#include <autoware_utils_rclcpp/update_param.hpp>
20+
#include <rclcpp/rclcpp.hpp>
21+
22+
int main(int argc, char * argv[]) {
23+
rclcpp::init(argc, argv);
24+
auto node = rclcpp::Node::make_shared("param_node");
25+
26+
double param_value = 0.0;
27+
std::vector<rclcpp::Parameter> params = node->get_parameters({"my_param"});
28+
29+
if (autoware_utils::update_param(params, "my_param", param_value)) {
30+
RCLCPP_INFO(node->get_logger(), "Updated parameter value: %f", param_value);
31+
} else {
32+
RCLCPP_WARN(node->get_logger(), "Parameter 'my_param' not found.");
33+
}
34+
35+
rclcpp::shutdown();
36+
return 0;
37+
}
38+
```

0 commit comments

Comments
 (0)