Skip to content

Commit

Permalink
Merge branch 'main' into prefix-behavior_velocity_run_out_module
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsanchezaran authored Jun 6, 2024
2 parents 0aacd09 + 5935138 commit 5a49d25
Show file tree
Hide file tree
Showing 55 changed files with 401 additions and 238 deletions.
59 changes: 59 additions & 0 deletions .cppcheck_suppressions
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
arrayIndexThenCheck
assignBoolToFloat
checkersReport
constParameterPointer
constParameterReference
constStatement
constVariable
constVariablePointer
constVariableReference
containerOutOfBounds
cstyleCast
ctuOneDefinitionRuleViolation
current_deleted_index
duplicateAssignExpression
duplicateBranch
duplicateBreak
duplicateCondition
duplicateExpression
funcArgNamesDifferent
functionConst
functionStatic
invalidPointerCast
knownConditionTrueFalse
missingInclude
missingIncludeSystem
multiCondition
noConstructor
noExplicitConstructor
noValidConfiguration
obstacle_cruise_planner
passedByValue
preprocessorErrorDirective
redundantAssignment
redundantContinue
redundantIfRemove
redundantInitialization
returnByReference
selfAssignment
shadowArgument
shadowFunction
shadowVariable
stlFindInsert
syntaxError
uninitMemberVar
unknownMacro
unmatchedSuppression
unpreciseMathCall
unreadVariable
unsignedLessThanZero
unusedFunction
unusedScopedObject
unusedStructMember
unusedVariable
useInitializationList
useStlAlgorithm
uselessCallsSubstr
uselessOverride
variableScope
virtualCallInConstructor
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ perception/traffic_light_visualization/** [email protected] yukihiro.saito@tier
planning/autoware_behavior_path_external_request_lane_change_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_behavior_velocity_planner/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_behavior_velocity_template_module/** [email protected]
planning/autoware_behavior_velocity_virtual_traffic_light_module/** [email protected] [email protected] [email protected]
planning/autoware_planning_test_manager/** [email protected] [email protected]
planning/autoware_remaining_distance_time_calculator/** [email protected]
planning/autoware_static_centerline_generator/** [email protected] [email protected]
Expand Down Expand Up @@ -174,7 +175,6 @@ planning/autoware_behavior_velocity_run_out_module/** [email protected] m
planning/behavior_velocity_speed_bump_module/** [email protected] [email protected] [email protected]
planning/behavior_velocity_stop_line_module/** [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_traffic_light_module/** [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_virtual_traffic_light_module/** [email protected] [email protected] [email protected]
planning/behavior_velocity_walkway_module/** [email protected] [email protected] [email protected] [email protected]
planning/costmap_generator/** [email protected] [email protected] [email protected]
planning/external_velocity_limit_selector/** [email protected] [email protected] [email protected] [email protected] [email protected]
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/cppcheck-all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: cppcheck-all

on:
pull_request:
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
cppcheck-all:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake git libpcre3-dev
# cppcheck from apt does not yet support --check-level args, and thus install from source
- name: Install Cppcheck from source
run: |
mkdir /tmp/cppcheck
git clone https://github.com/danmar/cppcheck.git /tmp/cppcheck
cd /tmp/cppcheck
git checkout 2.14.1
mkdir build
cd build
cmake ..
make -j $(nproc)
sudo make install
- name: Run Cppcheck on all files
continue-on-error: true
id: cppcheck
run: |
cppcheck --enable=all --inconclusive --check-level=exhaustive --error-exitcode=1 --xml . 2> cppcheck-report.xml
shell: bash

- name: Count errors by error ID and severity
run: |
#!/bin/bash
temp_file=$(mktemp)
grep -oP '(?<=id=")[^"]+" severity="[^"]+' cppcheck-report.xml | sed 's/" severity="/,/g' > "$temp_file"
echo "Error counts by error ID and severity:"
sort "$temp_file" | uniq -c
rm "$temp_file"
shell: bash

- name: Upload Cppcheck report
uses: actions/upload-artifact@v2
with:
name: cppcheck-report
path: cppcheck-report.xml

- name: Fail the job if Cppcheck failed
if: steps.cppcheck.outcome == 'failure'
run: exit 1
65 changes: 65 additions & 0 deletions .github/workflows/cppcheck-differential.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: cppcheck-differential

on:
pull_request:

jobs:
cppcheck-differential:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake git libpcre3-dev
# cppcheck from apt does not yet support --check-level args, and thus install from source
- name: Install Cppcheck from source
run: |
mkdir /tmp/cppcheck
git clone https://github.com/danmar/cppcheck.git /tmp/cppcheck
cd /tmp/cppcheck
git checkout 2.14.1
mkdir build
cd build
cmake ..
make -j $(nproc)
sudo make install
- name: Get changed files
id: changed-files
run: |
git fetch origin ${{ github.base_ref }} --depth=1
git diff --name-only FETCH_HEAD ${{ github.sha }} > changed_files.txt
cat changed_files.txt
- name: Run Cppcheck on changed files
continue-on-error: true
id: cppcheck
run: |
files=$(cat changed_files.txt | grep -E '\.(cpp|hpp)$' || true)
if [ -n "$files" ]; then
echo "Running Cppcheck on changed files: $files"
cppcheck --enable=all --inconclusive --check-level=exhaustive --error-exitcode=1 --suppressions-list=.cppcheck_suppressions $files 2> cppcheck-report.txt
else
echo "No C++ files changed."
touch cppcheck-report.txt
fi
shell: bash

- name: Show cppcheck-report result
run: |
cat cppcheck-report.txt
- name: Upload Cppcheck report
uses: actions/upload-artifact@v2
with:
name: cppcheck-report
path: cppcheck-report.txt

- name: Fail the job if Cppcheck failed
if: steps.cppcheck.outcome == 'failure'
run: exit 1
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
/>
<let
name="behavior_velocity_planner_launch_modules"
value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + 'behavior_velocity_planner::VirtualTrafficLightModulePlugin, '&quot;)"
value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + 'autoware::behavior_velocity_planner::VirtualTrafficLightModulePlugin, '&quot;)"
if="$(var launch_virtual_traffic_light_module)"
/>
<let
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<arg name="autoware_pose_covariance_modifier/output_pose_with_covariance_topic" default="/localization/pose_estimator/pose_with_covariance"/>
<arg name="param_file" default="$(find-pkg-share autoware_pose_covariance_modifier)/config/pose_covariance_modifier.param.yaml"/>

<node pkg="autoware_pose_covariance_modifier" exec="autoware_pose_covariance_modifier_node" name="pose_covariance_modifier_node" output="screen">
<node pkg="autoware_pose_covariance_modifier" exec="autoware_pose_covariance_modifier_node" name="pose_covariance_modifier_node" output="both">
<remap from="input_gnss_pose_with_cov_topic" to="$(var autoware_pose_covariance_modifier/input_gnss_pose_with_cov_topic)"/>
<remap from="input_ndt_pose_with_cov_topic" to="$(var autoware_pose_covariance_modifier/input_ndt_pose_with_cov_topic)"/>
<remap from="output_pose_with_covariance_topic" to="$(var autoware_pose_covariance_modifier/output_pose_with_covariance_topic)"/>
Expand Down
85 changes: 42 additions & 43 deletions localization/yabloc/yabloc_image_processing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,55 @@ find_package(OpenCV REQUIRED)
# PCL
find_package(PCL REQUIRED COMPONENTS common)

ament_auto_add_library(${PROJECT_NAME} SHARED
src/line_segment_detector/line_segment_detector_core.cpp
src/graph_segment/graph_segment_core.cpp
src/graph_segment/similar_area_searcher.cpp
src/segment_filter/segment_filter_core.cpp
src/undistort/undistort_node.cpp
src/line_segments_overlay/line_segments_overlay_core.cpp
src/lanelet2_overlay/lanelet2_overlay_core.cpp
)
target_include_directories(${PROJECT_NAME} PUBLIC include ${EIGEN3_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES} ${OpenCV_LIBS})

# ===================================================
# Executable
# line segment detector
set(TARGET line_segment_detector_node)
ament_auto_add_executable(${TARGET}
src/line_segment_detector/line_segment_detector_node.cpp
src/line_segment_detector/line_segment_detector_core.cpp)
target_include_directories(${TARGET} PUBLIC include)
target_include_directories(${TARGET} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS})
target_link_libraries(${TARGET} ${OpenCV_LIBS})
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "yabloc::graph_segment::GraphSegment"
EXECUTABLE yabloc_graph_segment_node
EXECUTOR SingleThreadedExecutor
)

# graph based segmentation
set(TARGET graph_segment_node)
ament_auto_add_executable(${TARGET}
src/graph_segment/graph_segment_node.cpp
src/graph_segment/graph_segment_core.cpp
src/graph_segment/similar_area_searcher.cpp)
target_include_directories(${TARGET} PUBLIC include)
target_include_directories(${TARGET} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS})
target_link_libraries(${TARGET} ${OpenCV_LIBS})
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "yabloc::lanelet2_overlay::Lanelet2Overlay"
EXECUTABLE yabloc_lanelet2_overlay_node
EXECUTOR SingleThreadedExecutor
)

# segment filter
set(TARGET segment_filter_node)
ament_auto_add_executable(${TARGET}
src/segment_filter/segment_filter_node.cpp
src/segment_filter/segment_filter_core.cpp)
target_include_directories(${TARGET} PUBLIC include ${EIGEN3_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS})
target_link_libraries(${TARGET} ${PCL_LIBRARIES} ${OpenCV_LIBS})
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "yabloc::line_segment_detector::LineSegmentDetector"
EXECUTABLE yabloc_line_segment_detector_node
EXECUTOR SingleThreadedExecutor
)

# undistort
set(TARGET undistort_node)
ament_auto_add_executable(${TARGET}
src/undistort/undistort_node.cpp)
target_link_libraries(${TARGET} ${OpenCV_LIBS})
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "yabloc::line_segments_overlay::LineSegmentsOverlay"
EXECUTABLE yabloc_line_segments_overlay_node
EXECUTOR SingleThreadedExecutor
)

# line_segments_overlay
set(TARGET line_segments_overlay_node)
ament_auto_add_executable(${TARGET}
src/line_segments_overlay/line_segments_overlay_core.cpp
src/line_segments_overlay/line_segments_overlay_node.cpp)
target_include_directories(${TARGET} PUBLIC include ${EIGEN_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS})
target_link_libraries(${TARGET} ${PCL_LIBRARIES})
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "yabloc::segment_filter::SegmentFilter"
EXECUTABLE yabloc_segment_filter_node
EXECUTOR SingleThreadedExecutor
)

# lanelet2_overlay
set(TARGET lanelet2_overlay_node)
ament_auto_add_executable(${TARGET}
src/lanelet2_overlay/lanelet2_overlay_core.cpp
src/lanelet2_overlay/lanelet2_overlay_node.cpp)
target_include_directories(${TARGET} PUBLIC include ${EIGEN_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS})
target_link_libraries(${TARGET} ${PCL_LIBRARIES})
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "yabloc::undistort::UndistortNode"
EXECUTABLE yabloc_undistort_node
EXECUTOR SingleThreadedExecutor
)

# ===================================================
ament_auto_package(INSTALL_TO_SHARE config launch)
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GraphSegment : public rclcpp::Node
public:
using PointCloud2 = sensor_msgs::msg::PointCloud2;
using Image = sensor_msgs::msg::Image;
GraphSegment();
explicit GraphSegment(const rclcpp::NodeOptions & options = rclcpp::NodeOptions());

private:
const float target_height_ratio_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Lanelet2Overlay : public rclcpp::Node
using Image = sensor_msgs::msg::Image;
using Float32Array = std_msgs::msg::Float32MultiArray;

Lanelet2Overlay();
explicit Lanelet2Overlay(const rclcpp::NodeOptions & options = rclcpp::NodeOptions());

private:
common::StaticTfSubscriber tf_subscriber_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LineSegmentDetector : public rclcpp::Node
using Image = sensor_msgs::msg::Image;
using PointCloud2 = sensor_msgs::msg::PointCloud2;

LineSegmentDetector();
explicit LineSegmentDetector(const rclcpp::NodeOptions & options = rclcpp::NodeOptions());

private:
rclcpp::Subscription<Image>::SharedPtr sub_image_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LineSegmentsOverlay : public rclcpp::Node
using Image = sensor_msgs::msg::Image;
using LineSegment = pcl::PointXYZLNormal;
using LineSegments = pcl::PointCloud<LineSegment>;
LineSegmentsOverlay();
explicit LineSegmentsOverlay(const rclcpp::NodeOptions & options = rclcpp::NodeOptions());

private:
void on_image(const Image::ConstSharedPtr & img_msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SegmentFilter : public rclcpp::Node
using PointCloud2 = sensor_msgs::msg::PointCloud2;
using Image = sensor_msgs::msg::Image;

SegmentFilter();
explicit SegmentFilter(const rclcpp::NodeOptions & options = rclcpp::NodeOptions());

private:
using ProjectFunc = std::function<std::optional<Eigen::Vector3f>(const Eigen::Vector3f &)>;
Expand Down
Loading

0 comments on commit 5a49d25

Please sign in to comment.