Skip to content

Commit b9f11bb

Browse files
committed
Merge remote-tracking branch 'awf/main' into fix-coonflict-awf-latest-sync-upstream
2 parents 462f624 + f306973 commit b9f11bb

File tree

51 files changed

+828
-412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+828
-412
lines changed

.cppcheck_suppressions

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
*:*/test/*
22

33
checkersReport
4-
constParameterPointer
54
constParameterReference
65
constVariable
76
constVariableReference
@@ -23,8 +22,6 @@ noValidConfiguration
2322
passedByValue
2423
preprocessorErrorDirective
2524
redundantInitialization
26-
returnByReference
27-
shadowArgument
2825
shadowFunction
2926
shadowVariable
3027
syntaxError

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ planning/behavior_velocity_planner/autoware_behavior_velocity_occlusion_spot_mod
185185
planning/behavior_velocity_planner/autoware_behavior_velocity_planner/** kosuke.takeuchi@tier4.jp kyoichi.sugahara@tier4.jp makoto.kurihara@tier4.jp mamoru.sobue@tier4.jp maxime.clement@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp takayuki.murooka@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp
186186
planning/behavior_velocity_planner/autoware_behavior_velocity_planner_common/** fumiya.watanabe@tier4.jp isamu.takagi@tier4.jp mamoru.sobue@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
187187
planning/behavior_velocity_planner/autoware_behavior_velocity_run_out_module/** kosuke.takeuchi@tier4.jp makoto.kurihara@tier4.jp shumpei.wakabayashi@tier4.jp takayuki.murooka@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp
188+
planning/behavior_velocity_planner/autoware_behavior_velocity_speed_bump_module/** mdogru@leodrive.ai shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
188189
planning/behavior_velocity_planner/autoware_behavior_velocity_stop_line_module/** fumiya.watanabe@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp zhe.shen@tier4.jp
189190
planning/behavior_velocity_planner/autoware_behavior_velocity_template_module/** daniel.sanchez@tier4.jp
190191
planning/behavior_velocity_planner/autoware_behavior_velocity_traffic_light_module/** mamoru.sobue@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
191192
planning/behavior_velocity_planner/autoware_behavior_velocity_virtual_traffic_light_module/** kosuke.takeuchi@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
192193
planning/behavior_velocity_planner/autoware_behavior_velocity_walkway_module/** satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp
193-
planning/behavior_velocity_planner/behavior_velocity_speed_bump_module/** mdogru@leodrive.ai shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
194194
planning/motion_velocity_planner/autoware_motion_velocity_dynamic_obstacle_stop_module/** mamoru.sobue@tier4.jp maxime.clement@tier4.jp
195195
planning/motion_velocity_planner/autoware_motion_velocity_obstacle_velocity_limiter_module/** maxime.clement@tier4.jp
196196
planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/** maxime.clement@tier4.jp shumpei.wakabayashi@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp

.github/PULL_REQUEST_TEMPLATE.md

-8
This file was deleted.

.github/PULL_REQUEST_TEMPLATE/small-change.md

-44
This file was deleted.

.github/PULL_REQUEST_TEMPLATE/standard-change.md

-63
This file was deleted.

.github/pull_request_template.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Description
2+
3+
## Related links
4+
5+
**Parent Issue:**
6+
7+
- Link
8+
9+
<!-- ⬇️🟢
10+
**Private Links:**
11+
12+
- [CompanyName internal link]()
13+
⬆️🟢 -->
14+
15+
## How was this PR tested?
16+
17+
## Notes for reviewers
18+
19+
None.
20+
21+
## Interface changes
22+
23+
None.
24+
25+
<!-- ⬇️🔴
26+
27+
### Topic changes
28+
29+
#### Additions and removals
30+
31+
| Change type | Topic Type | Topic Name | Message Type | Description |
32+
|:--------------|:----------------|:--------------|:--------------------|:------------------|
33+
| Added/Removed | Pub/Sub/Srv/Cli | `/topic_name` | `std_msgs/String` | Topic description |
34+
35+
#### Modifications
36+
37+
| Version | Topic Type | Topic Name | Message Type | Description |
38+
|:--------|:----------------|:------------------|:--------------------|:------------------|
39+
| Old | Pub/Sub/Srv/Cli | `/old_topic_name` | `sensor_msgs/Image` | Topic description |
40+
| New | Pub/Sub/Srv/Cli | `/new_topic_name` | `sensor_msgs/Image` | Topic description |
41+
42+
### ROS Parameter Changes
43+
44+
#### Additions and removals
45+
46+
| Change type | Parameter Name | Type | Default Value | Description |
47+
|:--------------|:---------------|:---------|:--------------|:------------------|
48+
| Added/Removed | `param_name` | `double` | `1.0` | Param description |
49+
50+
#### Modifications
51+
52+
| Version | Parameter Name | Type | Default Value | Description |
53+
|:--------|:-----------------|:---------|:--------------|:------------------|
54+
| Old | `old_param_name` | `double` | `1.0` | Param description |
55+
| New | `new_param_name` | `double` | `1.0` | Param description |
56+
57+
🔴⬆️ -->
58+
59+
## Effects on system behavior
60+
61+
None.

.github/sync-files.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
- source: .github/ISSUE_TEMPLATE/bug.yaml
88
- source: .github/ISSUE_TEMPLATE/config.yml
99
- source: .github/ISSUE_TEMPLATE/task.yaml
10-
- source: .github/PULL_REQUEST_TEMPLATE.md
11-
- source: .github/PULL_REQUEST_TEMPLATE/small-change.md
12-
- source: .github/PULL_REQUEST_TEMPLATE/standard-change.md
1310
- source: .github/dependabot.yaml
1411
- source: .github/stale.yml
1512
- source: .github/workflows/cancel-previous-workflows.yaml

.github/workflows/comment_on_pr.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Comment on PR
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
comment-on-pr:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
pull-requests: write
10+
steps:
11+
- name: Check out repository
12+
uses: actions/checkout@v4
13+
14+
- name: Initial PR comment
15+
uses: marocchino/sticky-pull-request-comment@v2
16+
with:
17+
message: |
18+
Thank you for contributing to the Autoware project!
19+
20+
🚧 If your pull request is in progress, [switch it to draft mode](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft).
21+
22+
Please ensure:
23+
- You've checked our [contribution guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/).
24+
- Your PR follows our [pull request guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/).
25+
- All required CI checks pass before [marking the PR ready for review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review).

control/autoware_smart_mpc_trajectory_follower/autoware_smart_mpc_trajectory_follower/scripts/drive_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297
for curDir, dirs, files in os.walk(control_dir_path):
298298
for name in files:
299299
if name == "vehicle_cmd_gate.param.yaml":
300-
if curDir.split("/")[-2] == "vehicle_cmd_gate":
300+
if curDir.split("/")[-2] == "autoware_vehicle_cmd_gate":
301301
limit_yaml_path = curDir + "/" + name
302302
break
303303

control/autoware_smart_mpc_trajectory_follower/autoware_smart_mpc_trajectory_follower/scripts/pympc_trajectory_follower.py

+45-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
# cspell: ignore interp
1818

19+
from enum import Enum
1920
import time
2021

2122
from autoware_adapi_v1_msgs.msg import OperationModeState
@@ -26,6 +27,9 @@
2627
from autoware_smart_mpc_trajectory_follower.scripts import drive_functions
2728
from autoware_vehicle_msgs.msg import SteeringReport
2829
from builtin_interfaces.msg import Duration
30+
from diagnostic_msgs.msg import DiagnosticStatus
31+
import diagnostic_updater
32+
from diagnostic_updater import DiagnosticStatusWrapper
2933
from geometry_msgs.msg import AccelWithCovarianceStamped
3034
from geometry_msgs.msg import PoseStamped
3135
from nav_msgs.msg import Odometry
@@ -42,6 +46,13 @@
4246
from tier4_debug_msgs.msg import Float32Stamped
4347

4448

49+
class ControlStatus(Enum):
50+
DRIVE = 0
51+
STOPPING = 1
52+
STOPPED = 2
53+
EMERGENCY = 3
54+
55+
4556
def getYaw(orientation_xyzw):
4657
return R.from_quat(orientation_xyzw.reshape(-1, 4)).as_euler("xyz")[:, 2]
4758

@@ -272,6 +283,10 @@ def __init__(self):
272283
self.last_steer_cmd = 0.0
273284
self.past_control_trajectory_mode = 1
274285

286+
self.diagnostic_updater = diagnostic_updater.Updater(self)
287+
self.setup_diagnostic_updater()
288+
self.control_state = ControlStatus.STOPPED
289+
275290
def onTrajectory(self, msg):
276291
self._present_trajectory = msg
277292

@@ -421,12 +436,14 @@ def control(self):
421436
orientation_deviation_threshold = 60 * np.pi / 180.0
422437

423438
# The moment the threshold is exceeded, it enters emergency stop mode.
439+
control_state = self.control_state
424440
if is_applying_control:
425441
if (
426442
position_deviation > position_deviation_threshold
427443
or orientation_deviation > orientation_deviation_threshold
428444
):
429445
self.emergency_stop_mode_flag = True
446+
control_state = ControlStatus.EMERGENCY
430447

431448
# Normal return from emergency stop mode when within the threshold value and a request to cancel the stop mode has been received.
432449
if (
@@ -698,12 +715,13 @@ def control(self):
698715
steer_cmd = self.last_steer_cmd + steer_cmd_decrease_limit
699716
else:
700717
steer_cmd = 0.0
718+
control_state = ControlStatus.STOPPING
701719

702720
cmd_msg = Control()
703721
cmd_msg.stamp = cmd_msg.lateral.stamp = cmd_msg.longitudinal.stamp = (
704722
self.get_clock().now().to_msg()
705723
)
706-
cmd_msg.longitudinal.speed = trajectory_longitudinal_velocity[nearestIndex]
724+
cmd_msg.longitudinal.velocity = trajectory_longitudinal_velocity[nearestIndex]
707725
cmd_msg.longitudinal.acceleration = acc_cmd
708726
cmd_msg.lateral.steering_tire_angle = steer_cmd
709727

@@ -722,6 +740,15 @@ def control(self):
722740
self.control_cmd_steer_list.pop(0)
723741
self.control_cmd_acc_list.pop(0)
724742

743+
# [3-6] Update control state
744+
if control_state != ControlStatus.EMERGENCY:
745+
stopped_velocity_threshold = 0.1
746+
if present_linear_velocity[0] <= stopped_velocity_threshold:
747+
control_state = ControlStatus.STOPPED
748+
elif control_state != ControlStatus.STOPPING:
749+
control_state = ControlStatus.DRIVE
750+
self.control_state = control_state
751+
725752
# [4] Update MPC internal variables
726753
if not is_applying_control:
727754
self.controller.send_initialize_input_queue()
@@ -843,6 +870,23 @@ def control(self):
843870
)
844871
)
845872

873+
self.diagnostic_updater.force_update()
874+
875+
def setup_diagnostic_updater(self):
876+
self.diagnostic_updater.setHardwareID("pympc_trajectory_follower")
877+
self.diagnostic_updater.add("control_state", self.check_control_state)
878+
879+
def check_control_state(self, stat: DiagnosticStatusWrapper):
880+
msg = "emergency occurred" if self.control_state == ControlStatus.EMERGENCY else "OK"
881+
level = (
882+
DiagnosticStatus.ERROR
883+
if self.control_state == ControlStatus.EMERGENCY
884+
else DiagnosticStatus.OK
885+
)
886+
stat.summary(level, msg)
887+
stat.add("control_state", str(self.control_state))
888+
return stat
889+
846890

847891
def main(args=None):
848892
rclpy.init(args=args)

control/autoware_smart_mpc_trajectory_follower/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
]
2929
)
3030
setup(
31-
name="smart_mpc_trajectory_follower",
31+
name="autoware_smart_mpc_trajectory_follower",
3232
version="1.0.0",
3333
packages=find_packages(),
3434
package_data={

launch/tier4_control_launch/launch/control.launch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def launch_setup(context, *args, **kwargs):
444444
smart_mpc_trajectory_follower = Node(
445445
package="autoware_smart_mpc_trajectory_follower",
446446
executable="pympc_trajectory_follower.py",
447-
name="pympc_trajectory_follower",
447+
name="controller_node_exe",
448448
)
449449
if trajectory_follower_mode == "trajectory_follower_node":
450450
return [group, control_validator_group]

planning/.pages

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ nav:
2929
- 'No Stopping Area': planning/behavior_velocity_planner/autoware_behavior_velocity_no_stopping_area_module
3030
- 'Occlusion Spot': planning/behavior_velocity_planner/autoware_behavior_velocity_occlusion_spot_module
3131
- 'Run Out': planning/behavior_velocity_planner/autoware_behavior_velocity_run_out_module
32-
- 'Speed Bump': planning/behavior_velocity_planner/behavior_velocity_speed_bump_module
32+
- 'Speed Bump': planning/behavior_velocity_planner/autoware_behavior_velocity_speed_bump_module
3333
- 'Stop Line': planning/behavior_velocity_planner/autoware_behavior_velocity_stop_line_module
3434
- 'Traffic Light': planning/behavior_velocity_planner/autoware_behavior_velocity_traffic_light_module
3535
- 'Virtual Traffic Light': planning/behavior_velocity_planner/autoware_behavior_velocity_virtual_traffic_light_module

0 commit comments

Comments
 (0)