Skip to content

Commit 4ca6f61

Browse files
pre-commit-ci[bot]liuXinGangChina
authored andcommitted
style(pre-commit): autofix
1 parent dc27db1 commit 4ca6f61

File tree

6 files changed

+113
-152
lines changed

6 files changed

+113
-152
lines changed

sensing/autoware_crop_box_filter/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,3 @@ ament_auto_package(INSTALL_TO_SHARE
3434
config
3535
test
3636
)
37-
38-

sensing/autoware_crop_box_filter/README.md

+22-23
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,40 @@ The `autoware_crop_box_filter` is implemented as a autoware core node that subsc
1212

1313
### Input
1414

15-
| Name | Type | Description |
16-
| ----------------- | ------------------------------- | ----------------- |
17-
| `~/input/points` | `sensor_msgs::msg::PointCloud2` | reference points |
15+
| Name | Type | Description |
16+
| ---------------- | ------------------------------- | ---------------- |
17+
| `~/input/points` | `sensor_msgs::msg::PointCloud2` | reference points |
1818

1919
### Output
2020

21-
| Name | Type | Description |
22-
| ----------------- | ------------------------------- | --------------- |
23-
| `~/output/points` | `sensor_msgs::msg::PointCloud2` | filtered points |
21+
| Name | Type | Description |
22+
| -------------------- | ------------------------------------ | -------------------- |
23+
| `~/output/points` | `sensor_msgs::msg::PointCloud2` | filtered points |
2424
| `~/crop_box_polygon` | `geometry_msgs::msg::PolygonStamped` | bounding box polygon |
2525

2626
## Parameters
2727

2828
### Launch file Parameters
2929

30-
| Name | Type | Default Value | Description |
31-
| ------------------ | ------ | ------------- | ------------------------------------- |
32-
| `input_frame` | string | " " | the frame id in which filtering is performed |
33-
| `output_frame` | string | " " | output frame id of the filtered points |
34-
| `input_pointcloud_frame` | string | " " | frame id of input pointcloud |
35-
| `max_queue_size` | int | 5 | max buffer size of input/output topics |
36-
| `crop_box_filter_param_file` | string | " " | path to the parameter file for the node |
37-
30+
| Name | Type | Default Value | Description |
31+
| ---------------------------- | ------ | ------------- | -------------------------------------------- |
32+
| `input_frame` | string | " " | the frame id in which filtering is performed |
33+
| `output_frame` | string | " " | output frame id of the filtered points |
34+
| `input_pointcloud_frame` | string | " " | frame id of input pointcloud |
35+
| `max_queue_size` | int | 5 | max buffer size of input/output topics |
36+
| `crop_box_filter_param_file` | string | " " | path to the parameter file for the node |
3837

3938
### Node Parameters
4039

41-
| Name | Type | Default Value | Description |
42-
| ------------------ | ------ | ------------- | ------------------------------------- |
43-
| `min_x` | double | -5.0 | minimum x value of the crop box |
44-
| `min_y` | double | -5.0 | minimum y value of the crop box |
45-
| `min_z` | double | -5.0 | minimum z value of the crop box |
46-
| `max_x` | double | 5.0 | maximum x value of the crop box |
47-
| `max_y` | double | 5.0 | maximum y value of the crop box |
48-
| `max_z` | double | 5.0 | maximum z value of the crop box |
49-
| `negative` | bool | true | if true, points inside the box are removed, otherwise points outside the box are removed |
40+
| Name | Type | Default Value | Description |
41+
| ---------- | ------ | ------------- | ---------------------------------------------------------------------------------------- |
42+
| `min_x` | double | -5.0 | minimum x value of the crop box |
43+
| `min_y` | double | -5.0 | minimum y value of the crop box |
44+
| `min_z` | double | -5.0 | minimum z value of the crop box |
45+
| `max_x` | double | 5.0 | maximum x value of the crop box |
46+
| `max_y` | double | 5.0 | maximum y value of the crop box |
47+
| `max_z` | double | 5.0 | maximum z value of the crop box |
48+
| `negative` | bool | true | if true, points inside the box are removed, otherwise points outside the box are removed |
5049

5150
## Usage
5251

sensing/autoware_crop_box_filter/include/autoware/crop_box_filter/crop_box_filter_node.hpp

+12-16
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,20 @@
5555
#ifndef AUTOWARE__CROP_BOX_FILTER__CROP_BOX_FILTER_NODE_HPP_
5656
#define AUTOWARE__CROP_BOX_FILTER__CROP_BOX_FILTER_NODE_HPP_
5757

58-
#include <geometry_msgs/msg/polygon_stamped.hpp>
59-
#include <sensor_msgs/msg/point_cloud2.hpp>
60-
#include <sensor_msgs/point_cloud2_iterator.hpp>
61-
58+
#include <autoware/point_types/types.hpp>
6259
#include <autoware_utils/ros/debug_publisher.hpp>
6360
#include <autoware_utils/ros/managed_transform_buffer.hpp>
6461
#include <autoware_utils/ros/published_time_publisher.hpp>
6562
#include <autoware_utils/system/stop_watch.hpp>
6663

67-
#include <autoware/point_types/types.hpp>
64+
#include <geometry_msgs/msg/polygon_stamped.hpp>
65+
#include <sensor_msgs/msg/point_cloud2.hpp>
66+
#include <sensor_msgs/point_cloud2_iterator.hpp>
6867

6968
#include <memory>
70-
#include <vector>
7169
#include <string>
7270
#include <utility>
71+
#include <vector>
7372

7473
using PointCloud2 = sensor_msgs::msg::PointCloud2;
7574
using PointCloud2ConstPtr = sensor_msgs::msg::PointCloud2::ConstSharedPtr;
@@ -83,9 +82,7 @@ namespace autoware::crop_box_filter
8382

8483
class CropBoxFilter : public rclcpp::Node
8584
{
86-
8785
private:
88-
8986
// member variable declaration & definitions *************************************
9087

9188
/** \brief The managed transform buffer. */
@@ -142,16 +139,16 @@ class CropBoxFilter : public rclcpp::Node
142139
std::unique_ptr<autoware_utils::PublishedTimePublisher> published_time_publisher_;
143140

144141
// function declaration *************************************
145-
142+
146143
void publish_crop_box_polygon();
147-
144+
148145
void pointcloud_callback(const PointCloud2ConstPtr cloud);
149146

150147
/** \brief Parameter service callback */
151148
rcl_interfaces::msg::SetParametersResult param_callback(const std::vector<rclcpp::Parameter> & p);
152149

153-
/** \brief Return whether the input PointCloud2 data has the same layout than PointXYZI. That is to
154-
* say whether you can memcpy from the PointCloud2 data buffer to a PointXYZI */
150+
/** \brief Return whether the input PointCloud2 data has the same layout than PointXYZI. That is
151+
* to say whether you can memcpy from the PointCloud2 data buffer to a PointXYZI */
155152
bool is_data_layout_compatible_with_point_xyzi(const PointCloud2 & input);
156153

157154
/** \brief Return whether the input PointCloud2 data has the same layout than PointXYZIRC. That is
@@ -162,8 +159,8 @@ class CropBoxFilter : public rclcpp::Node
162159
* is to say whether you can memcpy from the PointCloud2 data buffer to a PointXYZIRADRT */
163160
bool is_data_layout_compatible_with_point_xyziradrt(const PointCloud2 & input);
164161

165-
/** \brief Return whether the input PointCloud2 data has the same layout than PointXYZIRCAEDT. That
166-
* is to say whether you can memcpy from the PointCloud2 data buffer to a PointXYZIRCAEDT */
162+
/** \brief Return whether the input PointCloud2 data has the same layout than PointXYZIRCAEDT.
163+
* That is to say whether you can memcpy from the PointCloud2 data buffer to a PointXYZIRCAEDT */
167164
bool is_data_layout_compatible_with_point_xyzircaedt(const PointCloud2 & input);
168165

169166
bool is_valid(const PointCloud2ConstPtr & cloud);
@@ -181,12 +178,11 @@ class CropBoxFilter : public rclcpp::Node
181178
}
182179
return false;
183180
}
184-
185181

186182
public:
187183
PCL_MAKE_ALIGNED_OPERATOR_NEW
188184
explicit CropBoxFilter(const rclcpp::NodeOptions & options);
189-
void pointcloud_filter(const PointCloud2ConstPtr & cloud, PointCloud2 & output);
185+
void filter_pointcloud(const PointCloud2ConstPtr & cloud, PointCloud2 & output);
190186
};
191187
} // namespace autoware::crop_box_filter
192188

sensing/autoware_crop_box_filter/package.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<maintainer email="lxg19892021@gmail.com">Xingang Liu</maintainer>
1818
<license>Apache License 2.0</license>
1919

20-
2120
<!-- Original authors -->
2221
<author>Open Perception</author>
2322
<author email="julius@kammerl.de">Julius Kammerl</author>
@@ -28,10 +27,10 @@
2827

2928
<depend>autoware_point_types</depend>
3029
<depend>autoware_utils</depend>
30+
<depend>geometry_msgs</depend>
3131
<depend>rclcpp</depend>
3232
<depend>rclcpp_components</depend>
3333
<depend>sensor_msgs</depend>
34-
<depend>geometry_msgs</depend>
3534

3635
<test_depend>ament_lint_auto</test_depend>
3736
<test_depend>autoware_lint_common</test_depend>

0 commit comments

Comments
 (0)