Skip to content

Commit

Permalink
Merge branch 'main' into refactor/ndt_scan_matcher/apply_static_analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
SakodaShintaro authored Jun 5, 2024
2 parents eba7732 + 4daa6a9 commit 3bf7b79
Show file tree
Hide file tree
Showing 991 changed files with 5,942 additions and 5,907 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
Validating CODEOWNERS rules …
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/behavior_velocity_run_out_module/** [email protected] makoto.kur
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
21 changes: 21 additions & 0 deletions .github/workflows/dco.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: DCO
# ref: https://github.com/anchore/syft/pull/2926/files
on:
pull_request:
jobs:
dco:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python 3.x
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Check DCO
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip3 install -U dco-check
dco-check --verbose --exclude-pattern 'pre-commit-ci\[bot\]@users\.noreply\.github\.com'
4 changes: 0 additions & 4 deletions build_depends.repos
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ repositories:
type: git
url: https://github.com/autowarefoundation/autoware_internal_msgs.git
version: main
core/external/autoware_auto_msgs:
type: git
url: https://github.com/tier4/autoware_auto_msgs.git
version: tier4/main
# universe
universe/external/tier4_autoware_msgs:
type: git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
ament_target_dependencies(${PROJECT_NAME} PUBLIC
rviz_common
rviz_rendering
autoware_auto_vehicle_msgs
autoware_vehicle_msgs
tier4_planning_msgs
autoware_perception_msgs
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ This plugin provides a visual and easy-to-understand display of vehicle speed, t

| Name | Type | Description |
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------ |
| `/vehicle/status/velocity_status` | `autoware_auto_vehicle_msgs::msg::VelocityReport` | The topic is vehicle velocity |
| `/vehicle/status/turn_indicators_status` | `autoware_auto_vehicle_msgs::msg::TurnIndicatorsReport` | The topic is status of turn signal |
| `/vehicle/status/hazard_status` | `autoware_auto_vehicle_msgs::msg::HazardReport` | The topic is status of hazard |
| `/vehicle/status/steering_status` | `autoware_auto_vehicle_msgs::msg::SteeringReport` | The topic is status of steering |
| `/vehicle/status/gear_status` | `autoware_auto_vehicle_msgs::msg::GearReport` | The topic is status of gear |
| `/vehicle/status/velocity_status` | `autoware_vehicle_msgs::msg::VelocityReport` | The topic is vehicle velocity |
| `/vehicle/status/turn_indicators_status` | `autoware_vehicle_msgs::msg::TurnIndicatorsReport` | The topic is status of turn signal |
| `/vehicle/status/hazard_status` | `autoware_vehicle_msgs::msg::HazardReport` | The topic is status of hazard |
| `/vehicle/status/steering_status` | `autoware_vehicle_msgs::msg::SteeringReport` | The topic is status of steering |
| `/vehicle/status/gear_status` | `autoware_vehicle_msgs::msg::GearReport` | The topic is status of gear |
| `/planning/scenario_planning/current_max_velocity` | `tier4_planning_msgs::msg::VelocityLimit` | The topic is velocity limit |
| `/perception/traffic_light_recognition/traffic_signals` | `autoware_perception_msgs::msg::TrafficSignalArray` | The topic is status of traffic light |
| `/perception/traffic_light_recognition/traffic_signals` | `autoware_perception_msgs::msg::TrafficLightGroupArray` | The topic is status of traffic light |

## Parameter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <rviz_common/properties/int_property.hpp>
#include <rviz_common/ros_topic_display.hpp>

#include "autoware_auto_vehicle_msgs/msg/gear_report.hpp"
#include "autoware_vehicle_msgs/msg/gear_report.hpp"

#include <OgreColourValue.h>
#include <OgreMaterial.h>
Expand All @@ -37,7 +37,7 @@ class GearDisplay
public:
GearDisplay();
void drawGearIndicator(QPainter & painter, const QRectF & backgroundRect);
void updateGearData(const autoware_auto_vehicle_msgs::msg::GearReport::ConstSharedPtr & msg);
void updateGearData(const autoware_vehicle_msgs::msg::GearReport::ConstSharedPtr & msg);

private:
int current_gear_; // Internal variable to store current gear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,29 @@ private Q_SLOTS:
std::unique_ptr<TrafficDisplay> traffic_display_;
std::unique_ptr<SpeedLimitDisplay> speed_limit_display_;

rclcpp::Subscription<autoware_auto_vehicle_msgs::msg::GearReport>::SharedPtr gear_sub_;
rclcpp::Subscription<autoware_auto_vehicle_msgs::msg::SteeringReport>::SharedPtr steering_sub_;
rclcpp::Subscription<autoware_auto_vehicle_msgs::msg::VelocityReport>::SharedPtr speed_sub_;
rclcpp::Subscription<autoware_auto_vehicle_msgs::msg::TurnIndicatorsReport>::SharedPtr
rclcpp::Subscription<autoware_vehicle_msgs::msg::GearReport>::SharedPtr gear_sub_;
rclcpp::Subscription<autoware_vehicle_msgs::msg::SteeringReport>::SharedPtr steering_sub_;
rclcpp::Subscription<autoware_vehicle_msgs::msg::VelocityReport>::SharedPtr speed_sub_;
rclcpp::Subscription<autoware_vehicle_msgs::msg::TurnIndicatorsReport>::SharedPtr
turn_signals_sub_;
rclcpp::Subscription<autoware_auto_vehicle_msgs::msg::HazardLightsReport>::SharedPtr
rclcpp::Subscription<autoware_vehicle_msgs::msg::HazardLightsReport>::SharedPtr
hazard_lights_sub_;
rclcpp::Subscription<autoware_perception_msgs::msg::TrafficSignal>::SharedPtr traffic_sub_;
rclcpp::Subscription<autoware_perception_msgs::msg::TrafficLightGroupArray>::SharedPtr
traffic_sub_;
rclcpp::Subscription<tier4_planning_msgs::msg::VelocityLimit>::SharedPtr speed_limit_sub_;

std::mutex property_mutex_;

void updateGearData(const autoware_auto_vehicle_msgs::msg::GearReport::ConstSharedPtr & msg);
void updateSteeringData(
const autoware_auto_vehicle_msgs::msg::SteeringReport::ConstSharedPtr & msg);
void updateSpeedData(const autoware_auto_vehicle_msgs::msg::VelocityReport::ConstSharedPtr & msg);
void updateGearData(const autoware_vehicle_msgs::msg::GearReport::ConstSharedPtr & msg);
void updateSteeringData(const autoware_vehicle_msgs::msg::SteeringReport::ConstSharedPtr & msg);
void updateSpeedData(const autoware_vehicle_msgs::msg::VelocityReport::ConstSharedPtr & msg);
void updateTurnSignalsData(
const autoware_auto_vehicle_msgs::msg::TurnIndicatorsReport::ConstSharedPtr & msg);
const autoware_vehicle_msgs::msg::TurnIndicatorsReport::ConstSharedPtr & msg);
void updateHazardLightsData(
const autoware_auto_vehicle_msgs::msg::HazardLightsReport::ConstSharedPtr & msg);
const autoware_vehicle_msgs::msg::HazardLightsReport::ConstSharedPtr & msg);
void updateSpeedLimitData(const tier4_planning_msgs::msg::VelocityLimit::ConstSharedPtr msg);
void updateTrafficLightData(
const autoware_perception_msgs::msg::TrafficSignal::ConstSharedPtr msg);
const autoware_perception_msgs::msg::TrafficLightGroupArray::ConstSharedPtr msg);
void drawWidget(QImage & hud);
};
} // namespace autoware_overlay_rviz_plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <rviz_common/properties/int_property.hpp>
#include <rviz_common/ros_topic_display.hpp>

#include "autoware_auto_vehicle_msgs/msg/velocity_report.hpp"
#include "autoware_vehicle_msgs/msg/velocity_report.hpp"

#include <OgreColourValue.h>
#include <OgreMaterial.h>
Expand All @@ -37,7 +37,7 @@ class SpeedDisplay
public:
SpeedDisplay();
void drawSpeedDisplay(QPainter & painter, const QRectF & backgroundRect);
void updateSpeedData(const autoware_auto_vehicle_msgs::msg::VelocityReport::ConstSharedPtr & msg);
void updateSpeedData(const autoware_vehicle_msgs::msg::VelocityReport::ConstSharedPtr & msg);

private:
float current_speed_; // Internal variable to store current speed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <rviz_common/properties/int_property.hpp>
#include <rviz_common/ros_topic_display.hpp>

#include "autoware_auto_vehicle_msgs/msg/velocity_report.hpp"
#include "autoware_vehicle_msgs/msg/velocity_report.hpp"
#include <tier4_planning_msgs/msg/velocity_limit.hpp>

#include <OgreColourValue.h>
Expand All @@ -39,7 +39,7 @@ class SpeedLimitDisplay
SpeedLimitDisplay();
void drawSpeedLimitIndicator(QPainter & painter, const QRectF & backgroundRect);
void updateSpeedLimitData(const tier4_planning_msgs::msg::VelocityLimit::ConstSharedPtr msg);
void updateSpeedData(const autoware_auto_vehicle_msgs::msg::VelocityReport::ConstSharedPtr & msg);
void updateSpeedData(const autoware_vehicle_msgs::msg::VelocityReport::ConstSharedPtr & msg);

private:
float current_limit; // Internal variable to store current gear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <rviz_common/properties/int_property.hpp>
#include <rviz_common/ros_topic_display.hpp>

#include "autoware_auto_vehicle_msgs/msg/steering_report.hpp"
#include "autoware_vehicle_msgs/msg/steering_report.hpp"

#include <OgreColourValue.h>
#include <OgreMaterial.h>
Expand All @@ -37,8 +37,7 @@ class SteeringWheelDisplay
public:
SteeringWheelDisplay();
void drawSteeringWheel(QPainter & painter, const QRectF & backgroundRect);
void updateSteeringData(
const autoware_auto_vehicle_msgs::msg::SteeringReport::ConstSharedPtr & msg);
void updateSteeringData(const autoware_vehicle_msgs::msg::SteeringReport::ConstSharedPtr & msg);

private:
float steering_angle_ = 0.0f;
Expand Down
Loading

0 comments on commit 3bf7b79

Please sign in to comment.