forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1260 from tier4/sync-upstream
chore: sync tier4/autoware.universe:awf-latest
- Loading branch information
Showing
159 changed files
with
7,547 additions
and
2,182 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,7 +205,7 @@ planning/sampling_based_planner/frenet_planner/** [email protected] | |
planning/sampling_based_planner/path_sampler/** [email protected] | ||
planning/sampling_based_planner/sampler_common/** [email protected] | ||
planning/scenario_selector/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] | ||
planning/static_centerline_optimizer/** [email protected] [email protected] | ||
planning/static_centerline_generator/** [email protected] [email protected] | ||
planning/surround_obstacle_checker/** [email protected] | ||
sensing/gnss_poser/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] | ||
sensing/image_diagnostics/** [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
common/global_parameter_loader/test/test_global_params_launch.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2023 The Autoware Foundation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include <cstdlib> | ||
#include <iostream> | ||
#include <string> | ||
|
||
TEST(TestLaunchFile, test_launch_file) | ||
{ | ||
// Define the path of Python launch file | ||
std::string global_params_launch_path = "global_params.launch.py"; | ||
|
||
// Define the parameters you want to pass to the launch file | ||
std::string use_sim_time_param = "false"; | ||
std::string vehicle_model_param = "sample_vehicle"; | ||
// Construct the command to run the Python launch script with parameters | ||
std::string command = "ros2 launch global_parameter_loader " + global_params_launch_path + | ||
" use_sim_time:=" + use_sim_time_param + | ||
" vehicle_model:=" + vehicle_model_param; | ||
|
||
// Use the system() function to execute the command | ||
int result = std::system(command.c_str()); | ||
// Check the result of running the launch file | ||
EXPECT_EQ(result, 0); | ||
} | ||
|
||
int main(int argc, char * argv[]) | ||
{ | ||
testing::InitGoogleTest(&argc, argv); | ||
return RUN_ALL_TESTS(); | ||
} |
66 changes: 66 additions & 0 deletions
66
common/tier4_autoware_utils/include/tier4_autoware_utils/ros/polling_subscriber.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright 2024 TIER IV, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef TIER4_AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_ | ||
#define TIER4_AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_ | ||
|
||
#include <rclcpp/rclcpp.hpp> | ||
|
||
#include <string> | ||
|
||
namespace tier4_autoware_utils | ||
{ | ||
|
||
template <typename T> | ||
class InterProcessPollingSubscriber | ||
{ | ||
private: | ||
typename rclcpp::Subscription<T>::SharedPtr subscriber_; | ||
std::optional<T> data_; | ||
|
||
public: | ||
explicit InterProcessPollingSubscriber(rclcpp::Node * node, const std::string & topic_name) | ||
{ | ||
auto noexec_callback_group = | ||
node->create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive, false); | ||
auto noexec_subscription_options = rclcpp::SubscriptionOptions(); | ||
noexec_subscription_options.callback_group = noexec_callback_group; | ||
|
||
subscriber_ = node->create_subscription<T>( | ||
topic_name, rclcpp::QoS{1}, | ||
[node]([[maybe_unused]] const typename T::ConstSharedPtr msg) { assert(false); }, | ||
noexec_subscription_options); | ||
}; | ||
bool updateLatestData() | ||
{ | ||
rclcpp::MessageInfo message_info; | ||
T tmp; | ||
// The queue size (QoS) must be 1 to get the last message data. | ||
if (subscriber_->take(tmp, message_info)) { | ||
data_ = tmp; | ||
} | ||
return data_.has_value(); | ||
}; | ||
const T & getData() const | ||
{ | ||
if (!data_.has_value()) { | ||
throw std::runtime_error("Bad_optional_access in class InterProcessPollingSubscriber"); | ||
} | ||
return data_.value(); | ||
}; | ||
}; | ||
|
||
} // namespace tier4_autoware_utils | ||
|
||
#endif // TIER4_AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.