Skip to content

Commit 74cb075

Browse files
Merge pull request #35 from wep21/autoware-core
feat: add autoware core
2 parents e37bfce + ef07601 commit 74cb075

12 files changed

+256
-32
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff --git a/src/initial_pose_adaptor.cpp b/src/initial_pose_adaptor.cpp
2+
index 3b9aaab..044e314 100644
3+
--- a/src/initial_pose_adaptor.cpp
4+
+++ b/src/initial_pose_adaptor.cpp
5+
@@ -43,7 +43,7 @@ InitialPoseAdaptor::InitialPoseAdaptor(const rclcpp::NodeOptions & options)
6+
std::bind(&InitialPoseAdaptor::on_initial_pose, this, std::placeholders::_1));
7+
8+
cli_initialize_ =
9+
- create_client<Initialize::Service>(Initialize::name, rmw_qos_profile_services_default);
10+
+ create_client<Initialize::Service>(Initialize::name, rclcpp::ServicesQoS());
11+
}
12+
13+
void InitialPoseAdaptor::on_initial_pose(const PoseWithCovarianceStamped::ConstSharedPtr msg)
14+
diff --git a/src/routing_adaptor.cpp b/src/routing_adaptor.cpp
15+
index 9c89e2b..415f570 100644
16+
--- a/src/routing_adaptor.cpp
17+
+++ b/src/routing_adaptor.cpp
18+
@@ -34,11 +34,11 @@ RoutingAdaptor::RoutingAdaptor(const rclcpp::NodeOptions & options)
19+
"~/input/waypoint", 10, std::bind(&RoutingAdaptor::on_waypoint, this, _1));
20+
21+
cli_reroute_ = create_client<ChangeRoutePoints::Service>(
22+
- ChangeRoutePoints::name, rmw_qos_profile_services_default);
23+
+ ChangeRoutePoints::name, rclcpp::ServicesQoS());
24+
cli_route_ =
25+
- create_client<SetRoutePoints::Service>(SetRoutePoints::name, rmw_qos_profile_services_default);
26+
+ create_client<SetRoutePoints::Service>(SetRoutePoints::name, rclcpp::ServicesQoS());
27+
cli_clear_ =
28+
- create_client<ClearRoute::Service>(ClearRoute::name, rmw_qos_profile_services_default);
29+
+ create_client<ClearRoute::Service>(ClearRoute::name, rclcpp::ServicesQoS());
30+
31+
const auto state_qos = rclcpp::QoS{RouteState::depth}
32+
.reliability(RouteState::reliability)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
diff --git a/src/interface.cpp b/src/interface.cpp
2+
index 16e2031..26108bc 100644
3+
--- a/src/interface.cpp
4+
+++ b/src/interface.cpp
5+
@@ -21,7 +21,7 @@ InterfaceNode::InterfaceNode(const rclcpp::NodeOptions & options)
6+
: Node("interface", options),
7+
srv_(create_service<Version::Service>(
8+
Version::name,
9+
- [this](
10+
+ [](
11+
const Version::Service::Request::SharedPtr, const Version::Service::Response::SharedPtr res) {
12+
res->major = 1;
13+
res->minor = 9;
14+
diff --git a/src/localization.cpp b/src/localization.cpp
15+
index e4eca71..ce8f46a 100644
16+
--- a/src/localization.cpp
17+
+++ b/src/localization.cpp
18+
@@ -37,7 +37,7 @@ LocalizationNode::LocalizationNode(const rclcpp::NodeOptions & options)
19+
srv_initialize_ = create_service<autoware::adapi_specs::localization::Initialize::Service>(
20+
autoware::adapi_specs::localization::Initialize::name,
21+
std::bind(&LocalizationNode::on_initialize, this, std::placeholders::_1, std::placeholders::_2),
22+
- rmw_qos_profile_services_default, group_cli_);
23+
+ rclcpp::ServicesQoS(), group_cli_);
24+
25+
// Component Interface
26+
sub_state_ = create_subscription<
27+
diff --git a/src/routing.cpp b/src/routing.cpp
28+
index 1528db6..15580d0 100644
29+
--- a/src/routing.cpp
30+
+++ b/src/routing.cpp
31+
@@ -100,15 +100,15 @@ RoutingNode::RoutingNode(const rclcpp::NodeOptions & options)
32+
cli_clear_route_ =
33+
create_client<autoware::component_interface_specs::planning::ClearRoute::Service>(
34+
autoware::component_interface_specs::planning::ClearRoute::name,
35+
- rmw_qos_profile_services_default, group_cli_);
36+
+ rclcpp::ServicesQoS(), group_cli_);
37+
cli_set_waypoint_route_ =
38+
create_client<autoware::component_interface_specs::planning::SetWaypointRoute::Service>(
39+
autoware::component_interface_specs::planning::SetWaypointRoute::name,
40+
- rmw_qos_profile_services_default, group_cli_);
41+
+ rclcpp::ServicesQoS(), group_cli_);
42+
cli_set_lanelet_route_ =
43+
create_client<autoware::component_interface_specs::planning::SetLaneletRoute::Service>(
44+
autoware::component_interface_specs::planning::SetLaneletRoute::name,
45+
- rmw_qos_profile_services_default, group_cli_);
46+
+ rclcpp::ServicesQoS(), group_cli_);
47+
sub_operation_mode_ =
48+
create_subscription<autoware::component_interface_specs::system::OperationModeState::Message>(
49+
autoware::component_interface_specs::system::OperationModeState::name,
50+
@@ -119,7 +119,7 @@ RoutingNode::RoutingNode(const rclcpp::NodeOptions & options)
51+
cli_operation_mode_ =
52+
create_client<autoware::component_interface_specs::system::ChangeOperationMode::Service>(
53+
autoware::component_interface_specs::system::ChangeOperationMode::name,
54+
- rmw_qos_profile_services_default, group_cli_);
55+
+ rclcpp::ServicesQoS(), group_cli_);
56+
57+
is_autoware_control_ = false;
58+
is_auto_mode_ = false;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff --git a/include/autoware/ground_filter/grid.hpp b/include/autoware/ground_filter/grid.hpp
2+
index b69426c..c57fe92 100644
3+
--- a/include/autoware/ground_filter/grid.hpp
4+
+++ b/include/autoware/ground_filter/grid.hpp
5+
@@ -25,6 +25,12 @@
6+
#include <utility>
7+
#include <vector>
8+
9+
+#ifndef M_PIf
10+
+#define M_PIf 3.14159265358979324f
11+
+#define M_PI_2f 2 * M_PIf
12+
+#define M_PI_4f 4 * M_PIf
13+
+#endif
14+
+
15+
namespace
16+
{
17+
18+
diff --git a/src/node.cpp b/src/node.cpp
19+
index 1fd0f90..9305f75 100644
20+
--- a/src/node.cpp
21+
+++ b/src/node.cpp
22+
@@ -204,9 +204,9 @@ void GroundFilterComponent::subscribe()
23+
if (use_indices_) {
24+
// Subscribe to the input using a filter
25+
sub_input_filter_.subscribe(
26+
- this, "input", rclcpp::SensorDataQoS().keep_last(max_queue_size_).get_rmw_qos_profile());
27+
+ this, "input", rclcpp::SensorDataQoS().keep_last(max_queue_size_));
28+
sub_indices_filter_.subscribe(
29+
- this, "indices", rclcpp::SensorDataQoS().keep_last(max_queue_size_).get_rmw_qos_profile());
30+
+ this, "indices", rclcpp::SensorDataQoS().keep_last(max_queue_size_));
31+
32+
if (approximate_sync_) {
33+
sync_input_indices_a_ = std::make_shared<

patch/ros-kilted-autoware-lanelet2-extension.patch

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,3 @@ index a3ec429..6a64b82 100644
1717
ament_auto_add_executable(${PROJECT_NAME}_sample src/sample_code.cpp)
1818
target_link_libraries(${PROJECT_NAME}_sample
1919
${PROJECT_NAME}_lib
20-
diff --git a/lib/query.cpp b/lib/query.cpp
21-
index 4c61bba..11a9cca 100644
22-
--- a/lib/query.cpp
23-
+++ b/lib/query.cpp
24-
@@ -32,7 +32,7 @@
25-
#include <lanelet2_core/geometry/Lanelet.h>
26-
#include <lanelet2_core/primitives/Lanelet.h>
27-
#include <lanelet2_routing/RoutingGraph.h>
28-
-#include <tf2/utils.h>
29-
+#include <tf2/utils.hpp>
30-
31-
#include <iostream>
32-
#include <utility>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 9f8f868..bfa9cde 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -15,7 +15,7 @@ ament_auto_add_library(pointcloud_map_loader_node SHARED
6+
src/pointcloud_map_loader/utils.cpp
7+
)
8+
target_link_libraries(pointcloud_map_loader_node ${PCL_LIBRARIES})
9+
-target_link_libraries(pointcloud_map_loader_node yaml-cpp)
10+
+target_link_libraries(pointcloud_map_loader_node yaml-cpp::yaml-cpp fmt::fmt)
11+
12+
target_include_directories(pointcloud_map_loader_node
13+
SYSTEM PUBLIC
14+
diff --git a/src/lanelet2_map_loader/lanelet2_map_loader_node.cpp b/src/lanelet2_map_loader/lanelet2_map_loader_node.cpp
15+
index 54e9432..62ae5f6 100644
16+
--- a/src/lanelet2_map_loader/lanelet2_map_loader_node.cpp
17+
+++ b/src/lanelet2_map_loader/lanelet2_map_loader_node.cpp
18+
@@ -104,7 +104,7 @@ void Lanelet2MapLoaderNode::on_map_projector_info(
19+
if (map_major_ver > static_cast<uint64_t>(lanelet::autoware::version)) {
20+
RCLCPP_WARN(
21+
get_logger(),
22+
- "format_version(%ld) of the provided map(%s) is larger than the supported version(%ld)",
23+
+ "format_version(%llu) of the provided map(%s) is larger than the supported version(%llu)",
24+
map_major_ver, lanelet2_filename.c_str(),
25+
static_cast<uint64_t>(lanelet::autoware::version));
26+
if (!allow_unsupported_version) {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/src/node.cpp b/src/node.cpp
2+
index 3530c79..9527336 100644
3+
--- a/src/node.cpp
4+
+++ b/src/node.cpp
5+
@@ -256,7 +256,7 @@ std::optional<PathWithLaneId> PathGenerator::generate_path(
6+
utils::get_lanelets_within_route_up_to(*current_lanelet_, planner_data_, backward_length);
7+
if (!backward_lanelets_within_route) {
8+
RCLCPP_ERROR(
9+
- get_logger(), "Failed to get backward lanelets within route for current lanelet (id: %ld)",
10+
+ get_logger(), "Failed to get backward lanelets within route for current lanelet (id: %lld)",
11+
current_lanelet_->id());
12+
return std::nullopt;
13+
}
14+
@@ -284,7 +284,7 @@ std::optional<PathWithLaneId> PathGenerator::generate_path(
15+
utils::get_lanelets_within_route_after(*current_lanelet_, planner_data_, forward_length);
16+
if (!forward_lanelets_within_route) {
17+
RCLCPP_ERROR(
18+
- get_logger(), "Failed to get forward lanelets within route for current lanelet (id: %ld)",
19+
+ get_logger(), "Failed to get forward lanelets within route for current lanelet (id: %lld)",
20+
current_lanelet_->id());
21+
return std::nullopt;
22+
}

patch/ros-kilted-autoware-pose-initializer.osx.patch

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/src/route_handler.cpp b/src/route_handler.cpp
2+
index 878f1aa..d3604b4 100644
3+
--- a/src/route_handler.cpp
4+
+++ b/src/route_handler.cpp
5+
@@ -2073,7 +2073,7 @@ bool RouteHandler::planPathLaneletsBetweenCheckpoints(
6+
RCLCPP_WARN(
7+
logger_,
8+
"Failed to find reroute on previous preferred lanelets %s, but on previous route "
9+
- "segment %ld still",
10+
+ "segment %lld still",
11+
preferred_lanelets_str.str().c_str(), closest_lanelet.id());
12+
return closest_lanelet;
13+
}
14+
@@ -2134,7 +2134,7 @@ bool RouteHandler::planPathLaneletsBetweenCheckpoints(
15+
const double optional_route_length = optional_route->length2d();
16+
const double optional_route_cost = optional_route_length + angle_diff_weight * angle_diff;
17+
RCLCPP_DEBUG(
18+
- logger_, "Lanelet ID %ld: Route length = %.1f, Angle Diff = %.4f rad, Route cost = %.2f",
19+
+ logger_, "Lanelet ID %lld: Route length = %.1f, Angle Diff = %.4f rad, Route cost = %.2f",
20+
st_llt.id(), optional_route_length, angle_diff, optional_route_cost);
21+
if (optional_route_cost < min_route_cost) {
22+
min_route_cost = optional_route_cost;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/include/rosidl_runtime_cpp/traits.hpp b/include/rosidl_runtime_cpp/traits.hpp
2+
index 2d285b7b2..1f6ba834d 100644
3+
--- a/include/rosidl_runtime_cpp/traits.hpp
4+
+++ b/include/rosidl_runtime_cpp/traits.hpp
5+
@@ -128,14 +128,20 @@ inline void value_to_yaml(const std::string & value, std::ostream & out)
6+
inline void value_to_yaml(const std::u16string & value, std::ostream & out)
7+
{
8+
out << "\"";
9+
+#if __cplusplus < 201703L
10+
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
11+
+#endif
12+
auto flags = out.flags();
13+
size_t index = 0;
14+
while (index < value.size()) {
15+
uint_least16_t character = static_cast<uint_least16_t>(value[index]);
16+
if (!(character & 0xff80)) { // ASCII
17+
+#if __cplusplus < 201703L
18+
std::string character_as_string = convert.to_bytes(character);
19+
out << std::hex << character_as_string.c_str();
20+
+#else
21+
+ out << static_cast<char>(character);
22+
+#endif
23+
} else if (!(character & 0xff00)) { // only 1 byte set
24+
out << "\\x" << std::hex << std::setw(2) << std::setfill('0') << \
25+
character;

pkg_additional_info.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,17 @@ proxsuite:
146146
dep_name: proxsuite
147147
max_pin: 'x.x'
148148
override_version: '0.7.2'
149+
autoware_internal_planning_msgs:
150+
build_number: 13
151+
autoware_planning_msgs:
152+
build_number: 13
153+
autoware_system_msgs:
154+
build_number: 13
155+
autoware_lanelet2_extension:
156+
build_number: 13
157+
autoware_lanelet2_extension_python:
158+
build_number: 13
159+
rclcpp:
160+
build_number: 13
161+
rosidl_runtime_cpp:
162+
build_number: 13

0 commit comments

Comments
 (0)