Skip to content

Commit d065ddd

Browse files
Merge pull request autowarefoundation#29 from tier4/sync-upstream
chore: sync upstream
2 parents 8082bea + 2064c33 commit d065ddd

File tree

209 files changed

+13743
-9080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+13743
-9080
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
**Note**: Confirm our [contribution guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/) before submitting a pull request.
1+
**Note**: Confirm the [contribution guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/) before submitting a pull request.
22

33
Click the `Preview` tab and select a PR template:
44

55
- [Standard change](?expand=1&template=standard-change.md)
66
- [Small change](?expand=1&template=small-change.md)
7+
8+
**Do NOT send a PR with this description.**

.github/PULL_REQUEST_TEMPLATE/small-change.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44

55
## Pre-review checklist for the PR author
66

7-
PR author **must** check the checkboxes below when creating the PR.
7+
The PR author **must** check the checkboxes below when creating the PR.
88

99
- [ ] I've confirmed the [contribution guidelines].
1010
- [ ] The PR follows the [pull request guidelines].
1111

1212
## In-review checklist for the PR reviewers
1313

14-
Reviewers **must** check the checkboxes below before approval.
14+
The PR reviewers **must** check the checkboxes below before approval.
1515

1616
- [ ] The PR follows the [pull request guidelines].
1717

1818
## Post-review checklist for the PR author
1919

20-
PR author **must** check the checkboxes below before merging.
20+
The PR author **must** check the checkboxes below before merging.
2121

2222
- [ ] There are no open discussions or they are tracked via tickets.
2323

24-
After all checkboxes are checked, anyone who has the write access can merge the PR.
24+
After all checkboxes are checked, anyone who has write access can merge the PR.
2525

2626
[contribution guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/
2727
[pull request guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/

.github/PULL_REQUEST_TEMPLATE/standard-change.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@
1616

1717
## Pre-review checklist for the PR author
1818

19-
PR author **must** check the checkboxes below when creating the PR.
19+
The PR author **must** check the checkboxes below when creating the PR.
2020

2121
- [ ] I've confirmed the [contribution guidelines].
2222
- [ ] The PR follows the [pull request guidelines].
2323

2424
## In-review checklist for the PR reviewers
2525

26-
Reviewers **must** check the checkboxes below before approval.
26+
The PR reviewers **must** check the checkboxes below before approval.
2727

2828
- [ ] The PR follows the [pull request guidelines].
2929
- [ ] The PR has been properly tested.
3030
- [ ] The PR has been reviewed by the code owners.
3131

3232
## Post-review checklist for the PR author
3333

34-
PR author **must** check the checkboxes below before merging.
34+
The PR author **must** check the checkboxes below before merging.
3535

3636
- [ ] There are no open discussions or they are tracked via tickets.
3737
- [ ] The PR is ready for merge.
3838

39-
After all checkboxes are checked, anyone who has the write access can merge the PR.
39+
After all checkboxes are checked, anyone who has write access can merge the PR.
4040

4141
[contribution guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/
4242
[pull request guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/

.github/stale.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Modified from https://github.com/probot/stale#usage
2+
3+
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed
4+
daysUntilClose: false
5+
6+
# Label to use when marking as stale
7+
staleLabel: stale
8+
9+
# Comment to post when marking as stale
10+
markComment: >
11+
This pull request has been automatically marked as stale because it has not had
12+
recent activity.

.github/sync-files.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
- source: .github/PULL_REQUEST_TEMPLATE/small-change.md
1212
- source: .github/PULL_REQUEST_TEMPLATE/standard-change.md
1313
- source: .github/dependabot.yaml
14+
- source: .github/stale.yml
1415
- source: .github/workflows/pre-commit.yaml
1516
- source: .github/workflows/pre-commit-optional.yaml
1617
- source: .github/workflows/semantic-pull-request.yaml
1718
- source: .github/workflows/spell-check-differential.yaml
19+
- source: .github/workflows/sync-files.yaml
1820
- source: .clang-format
1921
- source: .markdown-link-check.json
2022
- source: .markdownlint.yaml
@@ -33,7 +35,6 @@
3335
- source: .github/workflows/build-and-test-self-hosted.yaml
3436
- source: .github/workflows/check-build-depends.yaml
3537
- source: .github/workflows/clang-tidy-pr-comments.yaml
36-
- source: .github/workflows/sync-files.yaml
3738

3839
- repository: autowarefoundation/autoware-documentation
3940
files:

.pre-commit-config-optional.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/tcort/markdown-link-check
3-
rev: v3.9.3
3+
rev: v3.10.0
44
hooks:
55
- id: markdown-link-check
66
args: [--config=.markdown-link-check.json]

.pre-commit-config.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ repos:
5858
- id: isort
5959

6060
- repo: https://github.com/psf/black
61-
rev: 22.1.0
61+
rev: 22.3.0
6262
hooks:
6363
- id: black
6464
args: [--line-length=100]
@@ -80,9 +80,10 @@ repos:
8080
]
8181

8282
- repo: https://github.com/pre-commit/mirrors-clang-format
83-
rev: v13.0.0
83+
rev: v13.0.1
8484
hooks:
8585
- id: clang-format
86+
types_or: [c++, c, cuda]
8687

8788
- repo: https://github.com/cpplint/cpplint
8889
rev: 1.5.5

common/autoware_point_types/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ endif()
1414
find_package(ament_cmake_auto REQUIRED)
1515
ament_auto_find_build_dependencies()
1616

17+
include_directories(
18+
include
19+
SYSTEM
20+
${PCL_INCLUDE_DIRS}
21+
)
22+
1723
if(BUILD_TESTING)
1824
find_package(ament_lint_auto REQUIRED)
1925
ament_lint_auto_find_test_dependencies()

common/autoware_point_types/include/autoware_point_types/types.hpp

+19
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#include <point_cloud_msg_wrapper/point_cloud_msg_wrapper.hpp>
1919

20+
#include <pcl/point_types.h>
21+
2022
#include <cmath>
2123
#include <tuple>
2224

@@ -41,6 +43,17 @@ struct PointXYZI
4143
}
4244
};
4345

46+
enum ReturnType : uint8_t {
47+
INVALID = 0,
48+
SINGLE_STRONGEST,
49+
SINGLE_LAST,
50+
DUAL_STRONGEST_FIRST,
51+
DUAL_STRONGEST_LAST,
52+
DUAL_WEAK_FIRST,
53+
DUAL_WEAK_LAST,
54+
DUAL_ONLY,
55+
};
56+
4457
struct PointXYZIRADRT
4558
{
4659
float x{0.0F};
@@ -77,4 +90,10 @@ using PointXYZIRADRTGenerator = std::tuple<
7790

7891
} // namespace autoware_point_types
7992

93+
POINT_CLOUD_REGISTER_POINT_STRUCT(
94+
autoware_point_types::PointXYZIRADRT,
95+
(float, x, x)(float, y, y)(float, z, z)(float, intensity, intensity)(std::uint16_t, ring, ring)(
96+
float, azimuth, azimuth)(float, distance, distance)(std::uint8_t, return_type, return_type)(
97+
double, time_stamp, time_stamp))
98+
8099
#endif // AUTOWARE_POINT_TYPES__TYPES_HPP_

common/autoware_point_types/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<depend>ament_cmake_cppcheck</depend>
1919
<depend>ament_cmake_lint_cmake</depend>
2020
<depend>ament_cmake_xmllint</depend>
21+
<depend>pcl_ros</depend>
2122
<depend>point_cloud_msg_wrapper</depend>
2223

2324
<test_depend>ament_cmake_gtest</test_depend>

common/tier4_perception_rviz_plugin/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
2222
## Declare a C++ library
2323
ament_auto_add_library(tier4_perception_rviz_plugin SHARED
2424
src/tools/util.cpp
25+
src/tools/interactive_object.cpp
2526
src/tools/pedestrian_pose.cpp
2627
src/tools/car_pose.cpp
2728
src/tools/unknown_pose.cpp

common/tier4_perception_rviz_plugin/src/tools/car_pose.cpp

+25-49
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@
4747

4848
#include "car_pose.hpp"
4949

50-
#include <unique_identifier_msgs/msg/uuid.hpp>
50+
#include "util.hpp"
5151

52-
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
53-
#include <tf2_ros/transform_listener.h>
52+
#include <rviz_common/display_context.hpp>
5453

5554
#include <algorithm>
5655
#include <random>
@@ -62,6 +61,12 @@ CarInitialPoseTool::CarInitialPoseTool()
6261
{
6362
shortcut_key_ = 'k';
6463

64+
enable_interactive_property_ = new rviz_common::properties::BoolProperty(
65+
"Interactive", false, "Enable/Disable interactive action by manipulating mouse.",
66+
getPropertyContainer());
67+
property_frame_ = new rviz_common::properties::TfFrameProperty(
68+
"Target Frame", rviz_common::properties::TfFrameProperty::FIXED_FRAME_STRING,
69+
"The TF frame where the point cloud is output.", getPropertyContainer(), nullptr, true);
6570
topic_property_ = new rviz_common::properties::StringProperty(
6671
"Pose Topic", "/simulation/dummy_perception_publisher/object_info",
6772
"The topic on which to publish dummy object info.", getPropertyContainer(), SLOT(updateTopic()),
@@ -93,73 +98,44 @@ void CarInitialPoseTool::onInitialize()
9398
updateTopic();
9499
}
95100

96-
void CarInitialPoseTool::updateTopic()
97-
{
98-
rclcpp::Node::SharedPtr raw_node = context_->getRosNodeAbstraction().lock()->get_raw_node();
99-
dummy_object_info_pub_ = raw_node->create_publisher<dummy_perception_publisher::msg::Object>(
100-
topic_property_->getStdString(), 1);
101-
clock_ = raw_node->get_clock();
102-
}
103-
104-
void CarInitialPoseTool::onPoseSet(double x, double y, double theta)
101+
Object CarInitialPoseTool::createObjectMsg() const
105102
{
106-
dummy_perception_publisher::msg::Object output_msg;
103+
Object object{};
107104
std::string fixed_frame = context_->getFixedFrame().toStdString();
108105

109106
// header
110-
output_msg.header.frame_id = fixed_frame;
111-
output_msg.header.stamp = clock_->now();
107+
object.header.frame_id = fixed_frame;
108+
object.header.stamp = clock_->now();
112109

113110
// semantic
114-
output_msg.classification.label = autoware_auto_perception_msgs::msg::ObjectClassification::CAR;
115-
output_msg.classification.probability = 1.0;
111+
object.classification.label = ObjectClassification::CAR;
112+
object.classification.probability = 1.0;
116113

117114
// shape
118-
output_msg.shape.type = autoware_auto_perception_msgs::msg::Shape::BOUNDING_BOX;
115+
object.shape.type = Shape::BOUNDING_BOX;
119116
const double width = 1.8;
120117
const double length = 4.0;
121-
output_msg.shape.dimensions.x = length;
122-
output_msg.shape.dimensions.y = width;
123-
output_msg.shape.dimensions.z = 2.0;
118+
object.shape.dimensions.x = length;
119+
object.shape.dimensions.y = width;
120+
object.shape.dimensions.z = 2.0;
124121

125122
// initial state
126-
// pose
127-
output_msg.initial_state.pose_covariance.pose.position.x = x;
128-
output_msg.initial_state.pose_covariance.pose.position.y = y;
129-
output_msg.initial_state.pose_covariance.pose.position.z = position_z_->getFloat();
130-
output_msg.initial_state.pose_covariance.covariance[0] =
123+
object.initial_state.pose_covariance.pose.position.z = position_z_->getFloat();
124+
object.initial_state.pose_covariance.covariance[0] =
131125
std_dev_x_->getFloat() * std_dev_x_->getFloat();
132-
output_msg.initial_state.pose_covariance.covariance[7] =
126+
object.initial_state.pose_covariance.covariance[7] =
133127
std_dev_y_->getFloat() * std_dev_y_->getFloat();
134-
output_msg.initial_state.pose_covariance.covariance[14] =
128+
object.initial_state.pose_covariance.covariance[14] =
135129
std_dev_z_->getFloat() * std_dev_z_->getFloat();
136-
output_msg.initial_state.pose_covariance.covariance[35] =
130+
object.initial_state.pose_covariance.covariance[35] =
137131
std_dev_theta_->getFloat() * std_dev_theta_->getFloat();
138-
tf2::Quaternion quat;
139-
quat.setRPY(0.0, 0.0, theta);
140-
output_msg.initial_state.pose_covariance.pose.orientation = tf2::toMsg(quat);
141-
RCLCPP_INFO(
142-
rclcpp::get_logger("CarInitialPoseTool"), "Setting pose: %.3f %.3f %.3f %.3f [frame=%s]", x, y,
143-
position_z_->getFloat(), theta, fixed_frame.c_str());
144-
// twist
145-
output_msg.initial_state.twist_covariance.twist.linear.x = velocity_->getFloat();
146-
output_msg.initial_state.twist_covariance.twist.linear.y = 0.0;
147-
output_msg.initial_state.twist_covariance.twist.linear.z = 0.0;
148-
RCLCPP_INFO(
149-
rclcpp::get_logger("CarInitialPoseTool"), "Setting twist: %.3f %.3f %.3f [frame=%s]",
150-
velocity_->getFloat(), 0.0, 0.0, fixed_frame.c_str());
151-
152-
// action
153-
output_msg.action = dummy_perception_publisher::msg::Object::ADD;
154132

155-
// id
156133
std::mt19937 gen(std::random_device{}());
157134
std::independent_bits_engine<std::mt19937, 8, uint8_t> bit_eng(gen);
158-
std::generate(output_msg.id.uuid.begin(), output_msg.id.uuid.end(), bit_eng);
135+
std::generate(object.id.uuid.begin(), object.id.uuid.end(), bit_eng);
159136

160-
dummy_object_info_pub_->publish(output_msg);
137+
return object;
161138
}
162-
163139
} // end namespace rviz_plugins
164140

165141
#include <pluginlib/class_list_macros.hpp>

common/tier4_perception_rviz_plugin/src/tools/car_pose.hpp

+9-33
Original file line numberDiff line numberDiff line change
@@ -48,45 +48,21 @@
4848
#ifndef TOOLS__CAR_POSE_HPP_
4949
#define TOOLS__CAR_POSE_HPP_
5050

51-
#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
52-
#include <QObject>
53-
#include <rclcpp/node.hpp>
54-
#include <rviz_common/display_context.hpp>
55-
#include <rviz_common/properties/float_property.hpp>
56-
#include <rviz_common/properties/string_property.hpp>
57-
#include <rviz_default_plugins/tools/pose/pose_tool.hpp>
58-
#endif
59-
60-
#include <dummy_perception_publisher/msg/object.hpp>
51+
#include "interactive_object.hpp"
6152

6253
namespace rviz_plugins
6354
{
64-
class CarInitialPoseTool : public rviz_default_plugins::tools::PoseTool
65-
{
66-
Q_OBJECT
6755

56+
using autoware_auto_perception_msgs::msg::ObjectClassification;
57+
using autoware_auto_perception_msgs::msg::Shape;
58+
using dummy_perception_publisher::msg::Object;
59+
60+
class CarInitialPoseTool : public InteractiveObjectTool
61+
{
6862
public:
6963
CarInitialPoseTool();
70-
virtual ~CarInitialPoseTool() {}
71-
virtual void onInitialize();
72-
73-
protected:
74-
virtual void onPoseSet(double x, double y, double theta);
75-
76-
private Q_SLOTS:
77-
void updateTopic();
78-
79-
private:
80-
rclcpp::Clock::SharedPtr clock_;
81-
rclcpp::Publisher<dummy_perception_publisher::msg::Object>::SharedPtr dummy_object_info_pub_;
82-
83-
rviz_common::properties::StringProperty * topic_property_;
84-
rviz_common::properties::FloatProperty * std_dev_x_;
85-
rviz_common::properties::FloatProperty * std_dev_y_;
86-
rviz_common::properties::FloatProperty * std_dev_z_;
87-
rviz_common::properties::FloatProperty * std_dev_theta_;
88-
rviz_common::properties::FloatProperty * position_z_;
89-
rviz_common::properties::FloatProperty * velocity_;
64+
void onInitialize();
65+
Object createObjectMsg() const override;
9066
};
9167

9268
} // namespace rviz_plugins

0 commit comments

Comments
 (0)