Skip to content

Commit

Permalink
build(static_centerline_generator): prefix package and namespace with…
Browse files Browse the repository at this point in the history
… autoware_ (#6817)

* build(static_centerline_generator): prefix package and namespace with autoware_

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* build: fix CMake target

Signed-off-by: Esteve Fernandez <[email protected]>

* build(autoware_static_centerline_generator): more renames

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* build(autoware_static_centerline_generator): fix namespace

Signed-off-by: Esteve Fernandez <[email protected]>

* fix(autoware_static_centerline_generator): fix clang-tidy issues

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* fix(autoware_static_centerline_generator): fix clang-tidy issues

Signed-off-by: Esteve Fernandez <[email protected]>

* fix(autoware_static_centerline_generator): fix build issues

Signed-off-by: Esteve Fernandez <[email protected]>

* fix(autoware_static_centerline_generator): fix build issues

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* fix(autoware_static_centerline_optimizer): fix clang-tidy issues

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* build: fix build errors

Signed-off-by: Esteve Fernandez <[email protected]>

* fix: remove else statements after return

Signed-off-by: Esteve Fernandez <[email protected]>

* fix(autoware_static_centerline_generator): fix clang-tidy issues

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* revert changes for static_centerline_generator

Signed-off-by: Esteve Fernandez <[email protected]>

* fix(autoware_static_centerline_generator): add autoware_ prefix

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* fix(autoware_static_centerline_generator): fix filenames

Signed-off-by: Esteve Fernandez <[email protected]>

* fix(autoware_static_centerline_generator): fix namespaces

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* fix: added prefix to missing strings

Signed-off-by: Esteve Fernandez <[email protected]>

* refactor(autoware_static_centerline_generator): move header files to src

Signed-off-by: Esteve Fernandez <[email protected]>

* refactor(autoware_static_centerline_generator): fix include paths

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* refactor(autoware_static_centerline_generator): rename base folder

Signed-off-by: Esteve Fernandez <[email protected]>

* Update planning/autoware_static_centerline_generator/launch/static_centerline_generator.launch.xml

Co-authored-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: Esteve Fernandez <[email protected]>

* build(autoware_static_centerline_generator): fix include in CMake

Signed-off-by: Esteve Fernandez <[email protected]>

* build(autoware_static_centerline_generator): fix missing includes

Signed-off-by: Esteve Fernandez <[email protected]>

---------

Signed-off-by: Esteve Fernandez <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
3 people authored May 15, 2024
1 parent d47430c commit dbc96b3
Show file tree
Hide file tree
Showing 39 changed files with 129 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ perception/traffic_light_multi_camera_fusion/** [email protected] tao.zhon
perception/traffic_light_occlusion_predictor/** [email protected] [email protected]
perception/traffic_light_visualization/** [email protected] [email protected]
planning/autoware_remaining_distance_time_calculator/** [email protected]
planning/autoware_static_centerline_generator/** [email protected] [email protected]
planning/behavior_path_avoidance_by_lane_change_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_avoidance_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_dynamic_avoidance_module/** [email protected] [email protected] [email protected] [email protected]
Expand Down Expand Up @@ -208,7 +209,6 @@ 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_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] [email protected]
Expand Down
2 changes: 1 addition & 1 deletion planning/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ nav:
- 'About Motion Velocity Smoother': planning/motion_velocity_smoother
- 'About Motion Velocity Smoother (Japanese)': planning/motion_velocity_smoother/README.ja
- 'Scenario Selector': planning/scenario_selector
- 'Static Centerline Generator': planning/static_centerline_generator
- 'Static Centerline Generator': planning/autoware_static_centerline_generator
- 'API and Library':
- 'Costmap Generator': planning/costmap_generator
- 'External Velocity Limit Selector': planning/external_velocity_limit_selector
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(static_centerline_generator)
project(autoware_static_centerline_generator)

find_package(autoware_cmake REQUIRED)

Expand All @@ -9,7 +9,7 @@ find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)

rosidl_generate_interfaces(
static_centerline_generator
autoware_static_centerline_generator
"srv/LoadMap.srv"
"srv/PlanRoute.srv"
"srv/PlanPath.srv"
Expand All @@ -29,10 +29,10 @@ ament_auto_add_executable(main

if(${rosidl_cmake_VERSION} VERSION_LESS 2.5.0)
rosidl_target_interfaces(main
static_centerline_generator "rosidl_typesupport_cpp")
autoware_static_centerline_generator "rosidl_typesupport_cpp")
else()
rosidl_get_typesupport_target(
cpp_typesupport_target static_centerline_generator "rosidl_typesupport_cpp")
cpp_typesupport_target autoware_static_centerline_generator "rosidl_typesupport_cpp")
target_link_libraries(main "${cpp_typesupport_target}")
endif()

Expand All @@ -43,6 +43,10 @@ ament_auto_package(
rviz
)

target_include_directories(main PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)

if(BUILD_TESTING)
add_launch_test(
test/test_static_centerline_generator.test.py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ We can run
with the following command by designating `<vehicle_model>`

```sh
ros2 launch static_centerline_generator run_planning_server.launch.xml vehicle_model:=<vehicle-model>
ros2 launch autoware_static_centerline_generator run_planning_server.launch.xml vehicle_model:=<vehicle-model>
```

FYI, port ID of the http server is 4010 by default.
Expand All @@ -50,7 +50,7 @@ The optimized centerline can be generated from the command line interface by des
- `<vehicle-model>`

```sh
ros2 launch static_centerline_generator static_centerline_generator.launch.xml run_backgrond:=false lanelet2_input_file_path:=<input-osm-path> lanelet2_output_file_path:=<output-osm-path> start_lanelet_id:=<start-lane-id> end_lanelet_id:=<end-lane-id> vehicle_model:=<vehicle-model>
ros2 launch autoware_static_centerline_generator static_centerline_generator.launch.xml run_backgrond:=false lanelet2_input_file_path:=<input-osm-path> lanelet2_output_file_path:=<output-osm-path> start_lanelet_id:=<start-lane-id> end_lanelet_id:=<end-lane-id> vehicle_model:=<vehicle-model>
```

The default output map path containing the optimized centerline locates `/tmp/lanelet2_map.osm`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<!-- mandatory arguments for planning-->
<arg name="vehicle_model"/>

<include file="$(find-pkg-share static_centerline_generator)/launch/static_centerline_generator.launch.xml">
<include file="$(find-pkg-share autoware_static_centerline_generator)/launch/static_centerline_generator.launch.xml">
<arg name="vehicle_model" value="$(var vehicle_model)"/>
<arg name="run_background" value="true"/>
</include>

<!-- local server to connect path optimizer and cloud software -->
<node pkg="static_centerline_generator" exec="app.py" name="static_centerline_generator_http_server" output="screen"/>
<node pkg="autoware_static_centerline_generator" exec="app.py" name="static_centerline_generator_http_server" output="screen"/>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</node>

<!-- optimize path -->
<node pkg="static_centerline_generator" exec="main" name="static_centerline_generator">
<node pkg="autoware_static_centerline_generator" exec="main" name="static_centerline_generator">
<remap from="lanelet2_map_topic" to="$(var lanelet2_map_topic)"/>
<remap from="input_centerline" to="~/input_centerline"/>
<remap from="output_whole_centerline" to="~/output_whole_centerline"/>
Expand All @@ -79,11 +79,11 @@
<param from="$(var obstacle_avoidance_planner_param)"/>
<param from="$(var mission_planner_param)"/>
<!-- node param -->
<param from="$(find-pkg-share static_centerline_generator)/config/static_centerline_generator.param.yaml"/>
<param from="$(find-pkg-share autoware_static_centerline_generator)/config/static_centerline_generator.param.yaml"/>
<param name="centerline_source" value="$(var centerline_source)"/>
<param name="bag_filename" value="$(var bag_filename)"/>
</node>

<!-- rviz -->
<node pkg="rviz2" exec="rviz2" name="rviz2" output="screen" args="-d $(find-pkg-share static_centerline_generator)/rviz/static_centerline_generator.rviz" if="$(var rviz)"/>
<node pkg="rviz2" exec="rviz2" name="rviz2" output="screen" args="-d $(find-pkg-share autoware_static_centerline_generator)/rviz/static_centerline_generator.param" if="$(var rviz)"/>
</launch>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>static_centerline_generator</name>
<name>autoware_static_centerline_generator</name>
<version>0.1.0</version>
<description>The static_centerline_generator package</description>
<description>The autoware_static_centerline_generator package</description>
<maintainer email="[email protected]">Takayuki Murooka</maintainer>
<maintainer email="[email protected]">Kosuke Takeuchi</maintainer>
<license>Apache License 2.0</license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Visualization Manager:
Filter size: 10
History Policy: Keep Last
Reliability Policy: Reliable
Value: /static_centerline_generator/input_centerline
Value: /autoware_static_centerline_generator/input_centerline
Value: true
View Drivable Area:
Alpha: 0.9990000128746033
Expand Down Expand Up @@ -179,7 +179,7 @@ Visualization Manager:
Filter size: 10
History Policy: Keep Last
Reliability Policy: Reliable
Value: /static_centerline_generator/output_centerline
Value: /autoware_static_centerline_generator/output_centerline
Value: true
View Footprint:
Alpha: 1
Expand Down Expand Up @@ -222,7 +222,7 @@ Visualization Manager:
Filter size: 10
History Policy: Keep Last
Reliability Policy: Reliable
Value: /static_centerline_generator/debug/raw_centerline
Value: /autoware_static_centerline_generator/debug/raw_centerline
Value: false
View Drivable Area:
Alpha: 0.9990000128746033
Expand Down Expand Up @@ -268,7 +268,7 @@ Visualization Manager:
Durability Policy: Transient Local
History Policy: Keep Last
Reliability Policy: Reliable
Value: /static_centerline_generator/debug/unsafe_footprints
Value: /autoware_static_centerline_generator/debug/unsafe_footprints
Value: true
Enabled: false
Name: debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
import json
import uuid

from autoware_static_centerline_generator.srv import LoadMap
from autoware_static_centerline_generator.srv import PlanPath
from autoware_static_centerline_generator.srv import PlanRoute
from flask import Flask
from flask import jsonify
from flask import request
from flask_cors import CORS
import rclpy
from rclpy.node import Node
from static_centerline_generator.srv import LoadMap
from static_centerline_generator.srv import PlanPath
from static_centerline_generator.srv import PlanRoute

rclpy.init()
node = Node("static_centerline_generator_http_server")
Expand All @@ -51,7 +51,7 @@ def get_map():
map_id = map_uuid

# create client
cli = create_client(LoadMap, "/planning/static_centerline_generator/load_map")
cli = create_client(LoadMap, "/planning/autoware_static_centerline_generator/load_map")

# request map loading
req = LoadMap.Request(map=data["map"])
Expand Down Expand Up @@ -85,7 +85,7 @@ def post_planned_route():
print("map_id is not correct.")

# create client
cli = create_client(PlanRoute, "/planning/static_centerline_generator/plan_route")
cli = create_client(PlanRoute, "/planning/autoware_static_centerline_generator/plan_route")

# request route planning
req = PlanRoute.Request(
Expand Down Expand Up @@ -123,7 +123,7 @@ def post_planned_path():
print("map_id is not correct.")

# create client
cli = create_client(PlanPath, "/planning/static_centerline_generator/plan_path")
cli = create_client(PlanPath, "/planning/autoware_static_centerline_generator/plan_path")

# request path planning
route_lane_ids = [eval(i) for i in request.args.getlist("route[]")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def __init__(self):
transient_local_qos = QoSProfile(depth=1, durability=QoSDurabilityPolicy.TRANSIENT_LOCAL)
self.sub_whole_centerline = self.create_subscription(
Trajectory,
"/static_centerline_generator/output_whole_centerline",
"/autoware_static_centerline_generator/output_whole_centerline",
self.onWholeCenterline,
transient_local_qos,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def remove_diff_to_ignore(osm_root):
)
args = parser.parse_args()

original_osm_file_name = "/tmp/static_centerline_generator/input/lanelet2_map.osm"
modified_osm_file_name = "/tmp/static_centerline_generator/output/lanelet2_map.osm"
original_osm_file_name = "/tmp/autoware_static_centerline_generator/input/lanelet2_map.osm"
modified_osm_file_name = "/tmp/autoware_static_centerline_generator/output/lanelet2_map.osm"

# load LL2 maps
original_osm_tree = ET.parse(original_osm_file_name)
Expand All @@ -118,7 +118,7 @@ def remove_diff_to_ignore(osm_root):
remove_diff_to_ignore(modified_osm_root)

# write LL2 maps
output_dir_path = "/tmp/static_centerline_generator/show_lanelet2_map_diff/"
output_dir_path = "/tmp/autoware_static_centerline_generator/show_lanelet2_map_diff/"
os.makedirs(output_dir_path + "original/", exist_ok=True)
os.makedirs(output_dir_path + "modified/", exist_ok=True)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

ros2 launch autoware_static_centerline_generator static_centerline_generator.launch.xml centerline_source:="bag_ego_trajectory_base" run_background:=false lanelet2_input_file_path:="$HOME/autoware_map/sample_map/lanelet2_map.osm" bag_filename:="$(ros2 pkg prefix autoware_static_centerline_generator --share)/test/data/bag_ego_trajectory.db3" vehicle_model:=lexus
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

ros2 launch autoware_static_centerline_generator static_centerline_generator.launch.xml centerline_source:="optimization_trajectory_base" run_background:=false lanelet2_input_file_path:="$HOME/autoware_map/sample_map/lanelet2_map.osm" start_lanelet_id:=125 end_lanelet_id:=132 vehicle_model:=lexus
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "static_centerline_generator/centerline_source/bag_ego_trajectory_based_centerline.hpp"
#include "centerline_source/bag_ego_trajectory_based_centerline.hpp"

#include "rclcpp/serialization.hpp"
#include "rosbag2_cpp/reader.hpp"
#include "static_centerline_generator/static_centerline_generator_node.hpp"
#include "static_centerline_generator_node.hpp"

#include <nav_msgs/msg/odometry.hpp>

namespace static_centerline_generator
#include <memory>
#include <string>

namespace autoware::static_centerline_generator
{
std::vector<TrajectoryPoint> generate_centerline_with_bag(rclcpp::Node & node)
{
Expand Down Expand Up @@ -79,4 +82,4 @@ std::vector<TrajectoryPoint> generate_centerline_with_bag(rclcpp::Node & node)

return centerline_traj_points;
}
} // namespace static_centerline_generator
} // namespace autoware::static_centerline_generator
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_
#define STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_
#ifndef CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_
#define CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_

#include "rclcpp/rclcpp.hpp"
#include "static_centerline_generator/type_alias.hpp"
#include "type_alias.hpp"

#include <vector>

namespace static_centerline_generator
namespace autoware::static_centerline_generator
{
std::vector<TrajectoryPoint> generate_centerline_with_bag(rclcpp::Node & node);
} // namespace static_centerline_generator
#endif // STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_
} // namespace autoware::static_centerline_generator
#endif // CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "static_centerline_generator/centerline_source/optimization_trajectory_based_centerline.hpp"
#include "centerline_source/optimization_trajectory_based_centerline.hpp"

#include "motion_utils/resample/resample.hpp"
#include "motion_utils/trajectory/conversion.hpp"
#include "obstacle_avoidance_planner/node.hpp"
#include "path_smoother/elastic_band_smoother.hpp"
#include "static_centerline_generator/static_centerline_generator_node.hpp"
#include "static_centerline_generator/utils.hpp"
#include "static_centerline_generator_node.hpp"
#include "tier4_autoware_utils/ros/parameter.hpp"
#include "utils.hpp"

namespace static_centerline_generator
#include <algorithm>

namespace autoware::static_centerline_generator
{
namespace
{
Expand Down Expand Up @@ -180,4 +182,4 @@ std::vector<TrajectoryPoint> OptimizationTrajectoryBasedCenterline::optimize_tra

return whole_optimized_traj_points;
}
} // namespace static_centerline_generator
} // namespace autoware::static_centerline_generator
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT
#define STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT
#ifndef CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT
#define CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT

#include "rclcpp/rclcpp.hpp"
#include "static_centerline_generator/type_alias.hpp"
#include "type_alias.hpp"

#include <vector>

namespace static_centerline_generator
namespace autoware::static_centerline_generator
{
class OptimizationTrajectoryBasedCenterline
{
Expand All @@ -37,7 +37,7 @@ class OptimizationTrajectoryBasedCenterline
rclcpp::Publisher<PathWithLaneId>::SharedPtr pub_raw_path_with_lane_id_{nullptr};
rclcpp::Publisher<Path>::SharedPtr pub_raw_path_{nullptr};
};
} // namespace static_centerline_generator
} // namespace autoware::static_centerline_generator
// clang-format off
#endif // STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT
#endif // CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "static_centerline_generator/static_centerline_generator_node.hpp"
#include "static_centerline_generator_node.hpp"

int main(int argc, char * argv[])
{
Expand All @@ -21,7 +21,8 @@ int main(int argc, char * argv[])
// initialize node
rclcpp::NodeOptions node_options;
auto node =
std::make_shared<static_centerline_generator::StaticCenterlineGeneratorNode>(node_options);
std::make_shared<autoware::static_centerline_generator::StaticCenterlineGeneratorNode>(
node_options);

// get ros parameter
const bool run_background = node->declare_parameter<bool>("run_background");
Expand Down
Loading

0 comments on commit dbc96b3

Please sign in to comment.