-
Notifications
You must be signed in to change notification settings - Fork 61
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 #1518 from tier4/feature/support-latest-autoware-m…
…essage-type Support message type `autoware_internal_planning_msgs::msg::PathWithLaneId`
- Loading branch information
Showing
12 changed files
with
362 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2015 TIER IV, Inc. All rights reserved. | ||
// | ||
// 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 CONCEALER__AVAILABLE_HPP_ | ||
#define CONCEALER__AVAILABLE_HPP_ | ||
|
||
namespace concealer | ||
{ | ||
template <typename T> | ||
constexpr auto available() -> bool | ||
{ | ||
return true; | ||
} | ||
} // namespace concealer | ||
|
||
#endif // CONCEALER__AVAILABLE_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,27 @@ | ||
// Copyright 2015 TIER IV, Inc. All rights reserved. | ||
// | ||
// 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 CONCEALER__CONVERT_HPP_ | ||
#define CONCEALER__CONVERT_HPP_ | ||
|
||
namespace concealer | ||
{ | ||
template <typename To, typename From> | ||
auto convert(const From & from) -> To | ||
{ | ||
return std::forward<decltype(from)>(from); | ||
} | ||
} // namespace concealer | ||
|
||
#endif // CONCEALER__CONVERT_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2015 TIER IV, Inc. All rights reserved. | ||
// | ||
// 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 CONCEALER__GET_PARAMETER_HPP_ | ||
#define CONCEALER__GET_PARAMETER_HPP_ | ||
|
||
#include <rclcpp/rclcpp.hpp> | ||
|
||
namespace concealer | ||
{ | ||
static constexpr auto default_architecture_type = "awf/universe/20240605"; | ||
|
||
template <typename T> | ||
auto getParameter( | ||
const rclcpp::node_interfaces::NodeParametersInterface::SharedPtr & node, | ||
const std::string & name, T value = {}) | ||
{ | ||
if (not node->has_parameter(name)) { | ||
node->declare_parameter(name, rclcpp::ParameterValue(value)); | ||
} | ||
return node->get_parameter(name).get_value<T>(); | ||
} | ||
|
||
template <typename T> | ||
auto getParameter(const std::string & name, T value = {}) | ||
{ | ||
auto node = rclcpp::Node("get_parameter", "simulation"); | ||
return getParameter(node.get_node_parameters_interface(), name, value); | ||
} | ||
} // namespace concealer | ||
|
||
#endif // CONCEALER__GET_PARAMETER_HPP_ |
66 changes: 66 additions & 0 deletions
66
external/concealer/include/concealer/path_with_lane_id.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 2015 TIER IV, Inc. All rights reserved. | ||
// | ||
// 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 CONCEALER__PATH_WITH_LANE_ID_HPP_ | ||
#define CONCEALER__PATH_WITH_LANE_ID_HPP_ | ||
|
||
#if __has_include(<autoware_internal_planning_msgs/msg/path_with_lane_id.hpp>) | ||
#include <autoware_internal_planning_msgs/msg/path_with_lane_id.hpp> | ||
#endif | ||
|
||
#if __has_include(<tier4_planning_msgs/msg/path_with_lane_id.hpp>) | ||
#include <tier4_planning_msgs/msg/path_with_lane_id.hpp> | ||
#endif | ||
|
||
#include <concealer/available.hpp> | ||
#include <concealer/convert.hpp> | ||
|
||
namespace concealer | ||
{ | ||
namespace priority | ||
{ | ||
using PathWithLaneId = decltype(std::tuple_cat( | ||
std::declval<std::tuple< | ||
#if __has_include(<autoware_internal_planning_msgs/msg/path_with_lane_id.hpp>) | ||
autoware_internal_planning_msgs::msg::PathWithLaneId | ||
#endif | ||
> >(), | ||
std::declval<std::tuple< | ||
#if __has_include(<tier4_planning_msgs/msg/path_with_lane_id.hpp>) | ||
tier4_planning_msgs::msg::PathWithLaneId | ||
#endif | ||
> >())); | ||
|
||
static_assert(0 < std::tuple_size_v<PathWithLaneId>); | ||
} // namespace priority | ||
|
||
#if __has_include(<autoware_internal_planning_msgs/msg/path_with_lane_id.hpp>) | ||
template <> | ||
auto available<autoware_internal_planning_msgs::msg::PathWithLaneId>() -> bool; | ||
#endif | ||
|
||
#if __has_include(<tier4_planning_msgs/msg/path_with_lane_id.hpp>) | ||
template <> | ||
auto available<tier4_planning_msgs::msg::PathWithLaneId>() -> bool; | ||
#endif | ||
|
||
#if __has_include(<autoware_internal_planning_msgs/msg/path_with_lane_id.hpp>) and \ | ||
__has_include(<tier4_planning_msgs/msg/path_with_lane_id.hpp>) | ||
template <> | ||
auto convert(const tier4_planning_msgs::msg::PathWithLaneId & from) | ||
-> autoware_internal_planning_msgs::msg::PathWithLaneId; | ||
#endif | ||
} // namespace concealer | ||
|
||
#endif // CONCEALER__PATH_WITH_LANE_ID_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
Oops, something went wrong.