diff --git a/.github/workflows/Docker.yaml b/.github/workflows/Docker.yaml index e48250f18d0..e8117f9bdfe 100644 --- a/.github/workflows/Docker.yaml +++ b/.github/workflows/Docker.yaml @@ -57,7 +57,7 @@ jobs: - name: Build (${{ matrix.arch }}) if: github.event_name == 'pull_request' - uses: docker/bake-action@v3 + uses: docker/bake-action@v6.3.0 with: files: | ./docker-bake.hcl @@ -71,7 +71,7 @@ jobs: - name: Build and push (${{ matrix.arch }}) if: github.event_name == 'workflow_dispatch' - uses: docker/bake-action@v3 + uses: docker/bake-action@v6.3.0 with: files: | ./docker-bake.hcl diff --git a/.github/workflows/Documentation.yaml b/.github/workflows/Documentation.yaml index 083f5216f78..d719a7835c1 100644 --- a/.github/workflows/Documentation.yaml +++ b/.github/workflows/Documentation.yaml @@ -68,7 +68,7 @@ jobs: run: doxygen Doxyfile - name: Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: api_documentation_site path: html diff --git a/common/math/arithmetic/CHANGELOG.rst b/common/math/arithmetic/CHANGELOG.rst index 0182a116a09..00c54d1a21b 100644 --- a/common/math/arithmetic/CHANGELOG.rst +++ b/common/math/arithmetic/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package arithmetic * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/common/math/arithmetic/package.xml b/common/math/arithmetic/package.xml index 5dc3f051722..96758d13ca5 100644 --- a/common/math/arithmetic/package.xml +++ b/common/math/arithmetic/package.xml @@ -2,7 +2,7 @@ arithmetic - 7.4.7 + 9.0.3 arithmetic library for scenario_simulator_v2 Tatsuya Yamasaki Apache License 2.0 diff --git a/common/math/geometry/CHANGELOG.rst b/common/math/geometry/CHANGELOG.rst index 992b36787d5..9bbf50dd75b 100644 --- a/common/math/geometry/CHANGELOG.rst +++ b/common/math/geometry/CHANGELOG.rst @@ -21,6 +21,74 @@ Changelog for package geometry * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge pull request `#1472 `_ from tier4/ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose + HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* fix(traffic_simulator): fix follow_trajectory_action issue, add orientation to distance calc, remove toCanonicalizedLaneletPose(point...) because it can cause a another issues +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/common/math/geometry/package.xml b/common/math/geometry/package.xml index 564a3ef0169..709f268204a 100644 --- a/common/math/geometry/package.xml +++ b/common/math/geometry/package.xml @@ -2,7 +2,7 @@ geometry - 7.4.7 + 9.0.3 geometry math library for scenario_simulator_v2 application Masaya Kataoka Apache License 2.0 diff --git a/common/scenario_simulator_exception/CHANGELOG.rst b/common/scenario_simulator_exception/CHANGELOG.rst index c245f8a50a0..a93330cc141 100644 --- a/common/scenario_simulator_exception/CHANGELOG.rst +++ b/common/scenario_simulator_exception/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package scenario_simulator_exception * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/common/scenario_simulator_exception/package.xml b/common/scenario_simulator_exception/package.xml index c9a676d3342..30522e48145 100644 --- a/common/scenario_simulator_exception/package.xml +++ b/common/scenario_simulator_exception/package.xml @@ -2,7 +2,7 @@ scenario_simulator_exception - 7.4.7 + 9.0.3 Exception types for scenario simulator Tatsuya Yamasaki Apache License 2.0 diff --git a/common/simple_junit/CHANGELOG.rst b/common/simple_junit/CHANGELOG.rst index a16694786da..3e707e08d1d 100644 --- a/common/simple_junit/CHANGELOG.rst +++ b/common/simple_junit/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package junit_exporter * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/common/simple_junit/package.xml b/common/simple_junit/package.xml index 4e2d88bc814..930627d2650 100644 --- a/common/simple_junit/package.xml +++ b/common/simple_junit/package.xml @@ -2,7 +2,7 @@ simple_junit - 7.4.7 + 9.0.3 Lightweight JUnit library for ROS 2 Masaya Kataoka Tatsuya Yamasaki diff --git a/common/status_monitor/CHANGELOG.rst b/common/status_monitor/CHANGELOG.rst index 91deca738ae..65c1c5314ba 100644 --- a/common/status_monitor/CHANGELOG.rst +++ b/common/status_monitor/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package status_monitor * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/common/status_monitor/package.xml b/common/status_monitor/package.xml index 2d588cbc5f1..89fa1e00a4c 100644 --- a/common/status_monitor/package.xml +++ b/common/status_monitor/package.xml @@ -2,7 +2,7 @@ status_monitor - 7.4.7 + 9.0.3 none Tatsuya Yamasaki Apache License 2.0 diff --git a/dependency_humble.repos b/dependency_humble.repos index 055e9c614e6..ddb733fd99a 100644 --- a/dependency_humble.repos +++ b/dependency_humble.repos @@ -16,6 +16,10 @@ repositories: type: git url: https://github.com/autowarefoundation/autoware_cmake.git version: main + autoware_internal_msgs: + type: git + url: https://github.com/autowarefoundation/autoware_internal_msgs.git + version: main autoware_utils: type: git url: https://github.com/autowarefoundation/autoware_utils.git diff --git a/docs/developer_guide/TrafficSimulator.md b/docs/developer_guide/TrafficSimulator.md index 223a9c0b3bd..4fd980934d2 100644 --- a/docs/developer_guide/TrafficSimulator.md +++ b/docs/developer_guide/TrafficSimulator.md @@ -79,14 +79,15 @@ public: private: void update() { - if (api_.reachPosition("ego", + const auto entity = getEntity("ego"); + if (entity->isNearbyPosition( traffic_simulator::helper::constructLaneletPose(34615, 10.0), 5)) { api_.requestAcquirePosition("ego", traffic_simulator::helper::constructLaneletPose(35026, 0.0) ); api_.setTargetSpeed("npc2", 13, true); } - if (api_.reachPosition("ego", + if (entity->isNearbyPosition( traffic_simulator::helper::constructLaneletPose(34579, 0.0), 5)) { api_.setTargetSpeed("npc2", 3, true); diff --git a/docs/user_guide/QuickStart.md b/docs/user_guide/QuickStart.md index f42ad70ad20..b2e66a8b064 100644 --- a/docs/user_guide/QuickStart.md +++ b/docs/user_guide/QuickStart.md @@ -33,7 +33,7 @@ This guide provides step-by-step instructions for building and running **Scenari ./setup-dev-env.sh ``` !!! note - This step will install necessary dependencies, including ROS 2, if not already installed.
Make sure to confirm and agree with the licenses for NVIDIA libraries like [CUDA](https://docs.nvidia.com/cuda/eula/index.html), [cuDNN](https://docs.nvidia.com/deeplearning/cudnn/latest/reference/eula.html), and [TensorRT](https://docs.nvidia.com/deeplearning/tensorrt/sla/index.html). + This step will install necessary dependencies, including ROS 2, if not already installed.
Make sure to confirm and agree with the licenses for NVIDIA libraries like [CUDA](https://docs.nvidia.com/cuda/eula/index.html), cuDNN, and [TensorRT](https://docs.nvidia.com/deeplearning/tensorrt/sla/index.html). 5. Install dependent ROS packages. ```bash diff --git a/external/concealer/CHANGELOG.rst b/external/concealer/CHANGELOG.rst index c398879d1d1..15b63340b2a 100644 --- a/external/concealer/CHANGELOG.rst +++ b/external/concealer/CHANGELOG.rst @@ -21,6 +21,82 @@ Changelog for package concealer * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Revert "move functions from EgoEntity to FieldOperatorApplication" + This reverts commit 8d90c0e2c2f66795f299859bfa675ef2f11abdd3. +* Revert "remove function shadowing" + This reverts commit 82d6085784271ea59d8fa69f359e0437543e9d57. +* remove function shadowing +* move functions from EgoEntity to FieldOperatorApplication +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Fix concealer local address returning +* feat(ego_entity, sumulator_core): remove asFieldOperatorApplication, develop getEgoEntity and dedicated methods in EgoEntity +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge pull request `#1511 `_ from tier4/RJD-1495/fix + RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/external/concealer/include/concealer/subscriber.hpp b/external/concealer/include/concealer/subscriber.hpp index e08c74cf7b0..ed6843fb1f7 100644 --- a/external/concealer/include/concealer/subscriber.hpp +++ b/external/concealer/include/concealer/subscriber.hpp @@ -27,7 +27,7 @@ struct Subscriber typename rclcpp::Subscription::SharedPtr subscription; - auto operator()() const -> const auto & { return *std::atomic_load(¤t_value); } + auto operator()() const -> Message { return *std::atomic_load(¤t_value); } template explicit Subscriber( @@ -37,7 +37,7 @@ struct Subscriber topic, quality_of_service, [this, callback](const typename Message::ConstSharedPtr & message) { if (std::atomic_store(¤t_value, message); current_value) { - callback(*std::atomic_load(¤t_value)); + callback((*this)()); } })) { diff --git a/external/concealer/package.xml b/external/concealer/package.xml index 9e50045c142..d9b2601478a 100644 --- a/external/concealer/package.xml +++ b/external/concealer/package.xml @@ -2,7 +2,7 @@ concealer - 7.4.7 + 9.0.3 Provides a class 'Autoware' to conceal miscellaneous things to simplify Autoware management of the simulator. Tatsuya Yamasaki Apache License 2.0 diff --git a/external/embree_vendor/CHANGELOG.rst b/external/embree_vendor/CHANGELOG.rst index 29538722366..c40618700aa 100644 --- a/external/embree_vendor/CHANGELOG.rst +++ b/external/embree_vendor/CHANGELOG.rst @@ -24,6 +24,71 @@ Changelog for package embree_vendor * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/external/embree_vendor/package.xml b/external/embree_vendor/package.xml index 973ae0abed8..807aad54149 100644 --- a/external/embree_vendor/package.xml +++ b/external/embree_vendor/package.xml @@ -2,7 +2,7 @@ embree_vendor - 7.4.7 + 9.0.3 vendor packages for intel raytracing kernel library masaya Apache 2.0 diff --git a/map/kashiwanoha_map/CHANGELOG.rst b/map/kashiwanoha_map/CHANGELOG.rst index ba98ed70a75..ad948a4418c 100644 --- a/map/kashiwanoha_map/CHANGELOG.rst +++ b/map/kashiwanoha_map/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package kashiwanoha_map * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/map/kashiwanoha_map/package.xml b/map/kashiwanoha_map/package.xml index 0512ece1106..80c5eee7249 100644 --- a/map/kashiwanoha_map/package.xml +++ b/map/kashiwanoha_map/package.xml @@ -2,7 +2,7 @@ kashiwanoha_map - 7.4.7 + 9.0.3 map package for kashiwanoha Masaya Kataoka Apache License 2.0 diff --git a/map/simple_cross_map/CHANGELOG.rst b/map/simple_cross_map/CHANGELOG.rst index c394e67fcb3..e38a5a15b76 100644 --- a/map/simple_cross_map/CHANGELOG.rst +++ b/map/simple_cross_map/CHANGELOG.rst @@ -9,6 +9,70 @@ Changelog for package simple_cross_map * Merge branch 'master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/map/simple_cross_map/package.xml b/map/simple_cross_map/package.xml index 848fef5504d..0d08ad14166 100644 --- a/map/simple_cross_map/package.xml +++ b/map/simple_cross_map/package.xml @@ -2,7 +2,7 @@ simple_cross_map - 7.4.7 + 9.0.3 map package for simple cross Masaya Kataoka Apache License 2.0 diff --git a/mock/cpp_mock_scenarios/CHANGELOG.rst b/mock/cpp_mock_scenarios/CHANGELOG.rst index 79ec3bb17fb..41dd013208b 100644 --- a/mock/cpp_mock_scenarios/CHANGELOG.rst +++ b/mock/cpp_mock_scenarios/CHANGELOG.rst @@ -21,6 +21,104 @@ Changelog for package cpp_mock_scenarios * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* Merge pull request `#1473 `_ from tier4/RJD-1057-remove-functions-forwarded-to-entity-base-middle + RJD-1057 (3/5): Remove non-API member functions: EntityManager’s member functions forwarded to EntityBase (1/2) +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator, cpp_mock_scenarios): rename isInPosition to isNerbyPosition +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator): rename isEntitySpawned to isEntityExist +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(cpp_mock_scenarios): improve move_backward +* ref(cpp_mock_scenarios): improve overall +* ref(cpp_mock_scenarios): ref random001 +* fix(cpp_mock_scenarios): merge changes in random001 +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Adjust mock scenarios to new API +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Restore previous scenario condition +* Fix mock scenario with invalid entity + resetBehaviorPlugin respawns entity so the pointer stored from before the action is invalid and new one should be obtained +* feat(simulator_core, api, entity_base, cpp_mock): move setEntityStatus to EntityBase, remove from api +* Merge branch 'RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base +* feat(ego_entity, sumulator_core): remove asFieldOperatorApplication, develop getEgoEntity and dedicated methods in EgoEntity +* feat(api, entity_manager, cpp_mock): rename entityExist to isEntitySpawned, move checkCollision directly to API +* feat(entity_manager, behavior_tree, cpp_mock): remove getCurrentAction forwarding, set "waiting" as init action state in behavior_tree +* feat(entity_base, traffic_simulator, simulator_core): remove forwarding request*, move requestLaneChange to EntityBase +* feat(entity_base, traffic_simulator, simulator_core): remove forwarding setBehaviorParameter and setVelocityLimit +* feat(entity_base, traffic_simulator): remove forwarding setters to EntityBase, also some getters, left setVelocityLimit and setBehaviorParameter +* feat(entity_base, traffic_simulator): rename laneMatchingSucceed to isInLanelet, remove forwarding +* feat(entity_base, traffic_simulator): move reachPosition as isInPosition to EntityBase, remove forwarding +* feat(entity_base, traffic_simulator, cpp_mock): move isInLanelet to EntityBase, remove forwarding +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* feat(cpp_mock, traffic_simulator): change getEntity, use getEntityOrNullptr +* Remove forwarding of getStandStillDuration in EntityManager and API +* Remove forwarding of getCurrentAccel in EntityManager and API +* Remove forwarding of getCurrentTwist in EntityManager and API +* Remove forwarding of getEntityStatus in EntityManager and API +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge pull request `#1472 `_ from tier4/ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose + HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(cpp_scenario_mock): remove unused auto_sink variable +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(traffic_simulator): improve Configuration, traffic_rules, lanelet_wrapper +* feat(cpp_mock_scenarios): adapt cpp screnarios for using pose:: from lanelet_wrapper +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/mock/cpp_mock_scenarios/package.xml b/mock/cpp_mock_scenarios/package.xml index a478d74021c..5e440e32c0c 100644 --- a/mock/cpp_mock_scenarios/package.xml +++ b/mock/cpp_mock_scenarios/package.xml @@ -2,7 +2,7 @@ cpp_mock_scenarios - 7.4.7 + 9.0.3 C++ mock scenarios masaya Apache License 2.0 diff --git a/mock/cpp_mock_scenarios/src/behavior_plugin/load_do_nothing_plugin.cpp b/mock/cpp_mock_scenarios/src/behavior_plugin/load_do_nothing_plugin.cpp index 80dff74fea3..07fe4312627 100644 --- a/mock/cpp_mock_scenarios/src/behavior_plugin/load_do_nothing_plugin.cpp +++ b/mock/cpp_mock_scenarios/src/behavior_plugin/load_do_nothing_plugin.cpp @@ -40,14 +40,15 @@ class LoadDoNothingPluginScenario : public cpp_mock_scenarios::CppScenarioNode void onUpdate() override { /// @note When using the do_nothing plugin, the return value of the `getCurrentAction` function is always do_nothing. + if ( - api_.getCurrentAction("ego") != "do_nothing" || - api_.getCurrentAction("pedestrian") != "do_nothing") { + api_.getEntity("ego")->getCurrentAction() != "do_nothing" || + api_.getEntity("pedestrian")->getCurrentAction() != "do_nothing") { stop(cpp_mock_scenarios::Result::FAILURE); } if ( - api_.getCurrentAction("vehicle_spawn_with_behavior_tree") == "do_nothing" || - api_.getCurrentAction("pedestrian_spawn_with_behavior_tree") == "do_nothing") { + api_.getEntity("vehicle_spawn_with_behavior_tree")->getCurrentAction() == "do_nothing" || + api_.getEntity("pedestrian_spawn_with_behavior_tree")->getCurrentAction() == "do_nothing") { stop(cpp_mock_scenarios::Result::FAILURE); } api_.resetBehaviorPlugin( @@ -57,8 +58,8 @@ class LoadDoNothingPluginScenario : public cpp_mock_scenarios::CppScenarioNode "pedestrian_spawn_with_behavior_tree", traffic_simulator::entity::PedestrianEntity::BuiltinBehavior::doNothing()); if ( - api_.getCurrentAction("vehicle_spawn_with_behavior_tree") != "do_nothing" || - api_.getCurrentAction("pedestrian_spawn_with_behavior_tree") != "do_nothing") { + api_.getEntity("vehicle_spawn_with_behavior_tree")->getCurrentAction() != "do_nothing" || + api_.getEntity("pedestrian_spawn_with_behavior_tree")->getCurrentAction() != "do_nothing") { stop(cpp_mock_scenarios::Result::FAILURE); } diff --git a/mock/cpp_mock_scenarios/src/collision/crashing_npc.cpp b/mock/cpp_mock_scenarios/src/collision/crashing_npc.cpp index 4596322662f..743be397e60 100644 --- a/mock/cpp_mock_scenarios/src/collision/crashing_npc.cpp +++ b/mock/cpp_mock_scenarios/src/collision/crashing_npc.cpp @@ -54,17 +54,19 @@ class CrashingNpcScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0.0); - api_.requestSpeedChange("ego", 15, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0.0); + ego_entity->requestSpeedChange(15, true); traffic_simulator_msgs::msg::BehaviorParameter behavior_parameter; behavior_parameter.see_around = false; - api_.setBehaviorParameter("ego", behavior_parameter); + ego_entity->setBehaviorParameter(behavior_parameter); api_.spawn( "npc", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("npc", 0.0); - api_.requestSpeedChange("npc", 5, true); + auto npc_entity = api_.getEntity("npc"); + npc_entity->setLinearVelocity(0.0); + npc_entity->requestSpeedChange(5, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/collision/spawn_with_offset.cpp b/mock/cpp_mock_scenarios/src/collision/spawn_with_offset.cpp index 522145b3de7..703bf010986 100644 --- a/mock/cpp_mock_scenarios/src/collision/spawn_with_offset.cpp +++ b/mock/cpp_mock_scenarios/src/collision/spawn_with_offset.cpp @@ -52,14 +52,16 @@ class SpawnWithOffsetScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.2, 1.3), getVehicleParameters()); - api_.setLinearVelocity("ego", 0); - api_.requestSpeedChange("ego", 0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0); + ego_entity->requestSpeedChange(0, true); api_.spawn( "bob", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, -0.874), getPedestrianParameters()); - api_.setLinearVelocity("bob", 0); - api_.requestSpeedChange("bob", 0, true); + auto bob_entity = api_.getEntity("bob"); + bob_entity->setLinearVelocity(0); + bob_entity->requestSpeedChange(0, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp b/mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp index 884fabf0648..a6443c234c1 100644 --- a/mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp +++ b/mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp @@ -106,7 +106,8 @@ void CppScenarioNode::spawnEgoEntity( api_.updateFrame(); std::this_thread::sleep_for(std::chrono::duration(1.0 / 20.0)); api_.spawn("ego", spawn_lanelet_pose, parameters, traffic_simulator::VehicleBehavior::autoware()); - api_.asFieldOperatorApplication("ego").declare_parameter("allow_goal_modification", true); + auto ego_entity = api_.getEgoEntity("ego"); + ego_entity->setParameter("allow_goal_modification", true); api_.attachLidarSensor("ego", 0.0); api_.attachDetectionSensor("ego", 200.0, true, 0.0, 0, 0.0, 0.0); @@ -125,12 +126,12 @@ void CppScenarioNode::spawnEgoEntity( // clang-format on return configuration; }()); - api_.requestAssignRoute("ego", goal_lanelet_poses); + ego_entity->requestAssignRoute(goal_lanelet_poses); using namespace std::chrono_literals; - while (!api_.asFieldOperatorApplication("ego").engaged()) { - if (api_.asFieldOperatorApplication("ego").engageable()) { - api_.asFieldOperatorApplication("ego").engage(); + while (!ego_entity->isEngaged()) { + if (ego_entity->isEngageable()) { + ego_entity->engage(); } api_.updateFrame(); std::this_thread::sleep_for(std::chrono::duration(1.0 / 20.0)); diff --git a/mock/cpp_mock_scenarios/src/crosswalk/stop_at_crosswalk.cpp b/mock/cpp_mock_scenarios/src/crosswalk/stop_at_crosswalk.cpp index 0072527287c..d12998973c4 100644 --- a/mock/cpp_mock_scenarios/src/crosswalk/stop_at_crosswalk.cpp +++ b/mock/cpp_mock_scenarios/src/crosswalk/stop_at_crosswalk.cpp @@ -40,7 +40,7 @@ class StopAtCrosswalkScenario : public cpp_mock_scenarios::CppScenarioNode { const auto t = api_.getCurrentTime(); // LCOV_EXCL_START - if (api_.entityExists("bob") && api_.checkCollision("ego", "bob")) { + if (api_.isEntityExist("bob") && api_.checkCollision("ego", "bob")) { stop(cpp_mock_scenarios::Result::FAILURE); } /** @@ -50,17 +50,18 @@ class StopAtCrosswalkScenario : public cpp_mock_scenarios::CppScenarioNode * @sa https://wandbox.org/permlink/dSNRX7K2bQiqSI7P */ if (t == 1.0) { - if (t != api_.getCurrentTwist("bob").linear.x) { + if (t != api_.getEntity("bob")->getCurrentTwist().linear.x) { stop(cpp_mock_scenarios::Result::FAILURE); } } + const auto ego_linear_velocity = api_.getEntity("ego")->getCurrentTwist().linear.x; if (t >= 6.6) { if (7.5 >= t) { - if (std::fabs(0.1) <= api_.getCurrentTwist("ego").linear.x) { + if (std::fabs(0.1) <= ego_linear_velocity) { stop(cpp_mock_scenarios::Result::FAILURE); } } else { - if (0.1 >= api_.getCurrentTwist("ego").linear.x) { + if (0.1 >= ego_linear_velocity) { stop(cpp_mock_scenarios::Result::FAILURE); } } @@ -76,19 +77,20 @@ class StopAtCrosswalkScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(120545, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 8, true); - api_.requestAssignRoute( - "ego", std::vector{ - traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0), - traffic_simulator::helper::constructCanonicalizedLaneletPose(34690, 0.0, 0.0)}); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(8, true); + ego_entity->requestAssignRoute(std::vector{ + traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0), + traffic_simulator::helper::constructCanonicalizedLaneletPose(34690, 0.0, 0.0)}); api_.spawn( "bob", traffic_simulator::helper::constructCanonicalizedLaneletPose(34378, 0.0, 0.0), getPedestrianParameters()); - api_.setLinearVelocity("bob", 0); - api_.requestSpeedChange( - "bob", 1.0, traffic_simulator::speed_change::Transition::LINEAR, + auto bob_entity = api_.getEntity("bob"); + bob_entity->setLinearVelocity(0); + bob_entity->requestSpeedChange( + 1.0, traffic_simulator::speed_change::Transition::LINEAR, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0), true); diff --git a/mock/cpp_mock_scenarios/src/follow_front_entity/accelerate_and_follow.cpp b/mock/cpp_mock_scenarios/src/follow_front_entity/accelerate_and_follow.cpp index 4ee77de7bc8..d99a497b8f0 100644 --- a/mock/cpp_mock_scenarios/src/follow_front_entity/accelerate_and_follow.cpp +++ b/mock/cpp_mock_scenarios/src/follow_front_entity/accelerate_and_follow.cpp @@ -39,13 +39,13 @@ class AccelerateAndFollowScenario : public cpp_mock_scenarios::CppScenarioNode private: void onUpdate() override { - double ego_accel = api_.getCurrentAccel("ego").linear.x; - double ego_twist = api_.getCurrentTwist("ego").linear.x; - // double npc_accel = static_cast(api_.getEntityStatus("npc")).action_status.accel.linear.x; - double npc_twist = api_.getCurrentTwist("npc").linear.x; - ; + double ego_linear_acceleration = api_.getEntity("ego")->getCurrentAccel().linear.x; + double ego_linear_velocity = api_.getEntity("ego")->getCurrentTwist().linear.x; + // double npc_linear_acceleration = api_.getEntity("npc")->getCurrentAccel().linear.x; + double npc_linear_velocity = api_.getEntity("npc")->getCurrentTwist().linear.x; + // LCOV_EXCL_START - if (npc_twist > (ego_twist + 1) && ego_accel < 0) { + if (npc_linear_velocity > (ego_linear_velocity + 1) && ego_linear_acceleration < 0) { stop(cpp_mock_scenarios::Result::FAILURE); } if (api_.checkCollision("ego", "npc")) { @@ -61,13 +61,14 @@ class AccelerateAndFollowScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 3); + api_.getEntity("ego")->setLinearVelocity(3); api_.spawn( "npc", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("npc", 10); - api_.requestSpeedChange("npc", 10, true); + auto npc_entity = api_.getEntity("npc"); + npc_entity->setLinearVelocity(10); + npc_entity->requestSpeedChange(10, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/follow_front_entity/decelerate_and_follow.cpp b/mock/cpp_mock_scenarios/src/follow_front_entity/decelerate_and_follow.cpp index c6b833663d4..49fd6d59c6e 100644 --- a/mock/cpp_mock_scenarios/src/follow_front_entity/decelerate_and_follow.cpp +++ b/mock/cpp_mock_scenarios/src/follow_front_entity/decelerate_and_follow.cpp @@ -39,13 +39,13 @@ class DecelerateAndFollowScenario : public cpp_mock_scenarios::CppScenarioNode private: void onUpdate() override { - double ego_accel = api_.getCurrentAccel("ego").linear.x; - double ego_twist = api_.getCurrentTwist("ego").linear.x; - // double npc_accel = static_cast(api_.getEntityStatus("npc")).action_status.accel.linear.x; - double npc_twist = api_.getCurrentTwist("npc").linear.x; - ; + double ego_linear_acceleration = api_.getEntity("ego")->getCurrentAccel().linear.x; + double ego_linear_velocity = api_.getEntity("ego")->getCurrentTwist().linear.x; + // double npc_linear_acceleration = api_.getEntity("npc")->getCurrentAccel().linear.x; + double npc_linear_velocity = api_.getEntity("npc")->getCurrentTwist().linear.x; + // LCOV_EXCL_START - if (ego_twist > (npc_twist + 1) && ego_accel > 0) { + if (ego_linear_velocity > (npc_linear_velocity + 1) && ego_linear_acceleration > 0) { stop(cpp_mock_scenarios::Result::FAILURE); } if (api_.checkCollision("ego", "npc")) { @@ -61,13 +61,14 @@ class DecelerateAndFollowScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 15); + api_.getEntity("ego")->setLinearVelocity(15); api_.spawn( "npc", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 15.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("npc", 10); - api_.requestSpeedChange("npc", 10, true); + auto npc_entity = api_.getEntity("npc"); + npc_entity->setLinearVelocity(10); + npc_entity->requestSpeedChange(10, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/follow_lane/acquire_position_in_world_frame.cpp b/mock/cpp_mock_scenarios/src/follow_lane/acquire_position_in_world_frame.cpp index 01463611f9e..c1aa7be9969 100644 --- a/mock/cpp_mock_scenarios/src/follow_lane/acquire_position_in_world_frame.cpp +++ b/mock/cpp_mock_scenarios/src/follow_lane/acquire_position_in_world_frame.cpp @@ -40,7 +40,7 @@ class AcquirePositionInWorldFrameScenario : public cpp_mock_scenarios::CppScenar bool requested = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34408, 0.1)) { + if (api_.getEntity("ego")->isInLanelet(34408, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } } @@ -49,13 +49,14 @@ class AcquirePositionInWorldFrameScenario : public cpp_mock_scenarios::CppScenar api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 10.0, 0.0), getVehicleParameters()); - api_.setEntityStatus( - "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 0.0, 0.0), + auto ego_entity = api_.getEntity("ego"); + ego_entity->setStatus( + traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 0.0, 0.0), traffic_simulator::helper::constructActionStatus(10)); - api_.requestSpeedChange("ego", 10, true); + ego_entity->requestSpeedChange(10, true); const geometry_msgs::msg::Pose goal_pose = traffic_simulator::pose::toMapPose( traffic_simulator::helper::constructCanonicalizedLaneletPose(34408, 1.0, 0.0)); - api_.requestAcquirePosition("ego", goal_pose); + ego_entity->requestAcquirePosition(goal_pose); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/follow_lane/assign_route_in_world_frame.cpp b/mock/cpp_mock_scenarios/src/follow_lane/assign_route_in_world_frame.cpp index 8df5d2906e4..2b5114efed6 100644 --- a/mock/cpp_mock_scenarios/src/follow_lane/assign_route_in_world_frame.cpp +++ b/mock/cpp_mock_scenarios/src/follow_lane/assign_route_in_world_frame.cpp @@ -40,7 +40,7 @@ class AcquireRouteInWorldFrameScenario : public cpp_mock_scenarios::CppScenarioN bool requested = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34630, 0.1)) { + if (api_.getEntity("ego")->isInLanelet(34630, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } } @@ -49,14 +49,15 @@ class AcquireRouteInWorldFrameScenario : public cpp_mock_scenarios::CppScenarioN api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); std::vector goal_poses; goal_poses.emplace_back(traffic_simulator::pose::toMapPose( traffic_simulator::helper::constructCanonicalizedLaneletPose(34408, 1.0, 0.0))); goal_poses.emplace_back(traffic_simulator::pose::toMapPose( traffic_simulator::helper::constructCanonicalizedLaneletPose(34408, 10, 0.0))); - api_.requestAssignRoute("ego", goal_poses); + ego_entity->requestAssignRoute(goal_poses); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/follow_lane/cancel_request.cpp b/mock/cpp_mock_scenarios/src/follow_lane/cancel_request.cpp index cc09337e277..9e8fa44cc98 100644 --- a/mock/cpp_mock_scenarios/src/follow_lane/cancel_request.cpp +++ b/mock/cpp_mock_scenarios/src/follow_lane/cancel_request.cpp @@ -39,12 +39,13 @@ class CancelRequestScenario : public cpp_mock_scenarios::CppScenarioNode bool canceled = false; void onUpdate() override { - if (api_.reachPosition( - "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 30, 0), 3.0)) { - api_.cancelRequest("ego"); + const auto ego_entity = api_.getEntity("ego"); + if (ego_entity->isNearbyPosition( + traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 30, 0), 3.0)) { + ego_entity->cancelRequest(); canceled = true; } - if (api_.isInLanelet("ego", 34507, 0.1)) { + if (ego_entity->isInLanelet(34507, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } } @@ -53,11 +54,12 @@ class CancelRequestScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 7); - api_.requestSpeedChange("ego", 7, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(7); + ego_entity->requestSpeedChange(7, true); const geometry_msgs::msg::Pose goal_pose = traffic_simulator::pose::toMapPose( traffic_simulator::helper::constructLaneletPose(34408, 0.0, 0.0)); - api_.requestAcquirePosition("ego", goal_pose); + ego_entity->requestAcquirePosition(goal_pose); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/follow_lane/follow_with_offset.cpp b/mock/cpp_mock_scenarios/src/follow_lane/follow_with_offset.cpp index 0c165176e9d..02585060207 100644 --- a/mock/cpp_mock_scenarios/src/follow_lane/follow_with_offset.cpp +++ b/mock/cpp_mock_scenarios/src/follow_lane/follow_with_offset.cpp @@ -40,15 +40,11 @@ class FollowLaneWithOffsetScenario : public cpp_mock_scenarios::CppScenarioNode bool requested = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34507, 0.1)) { - stop(cpp_mock_scenarios::Result::SUCCESS); - } - if (const auto entity = api_.getEntity("ego"); not entity) { + if (const auto ego_entity = api_.getEntity("ego"); !ego_entity->isInLanelet()) { stop(cpp_mock_scenarios::Result::FAILURE); - } else if (const auto lanelet_pose = entity->getCanonicalizedLaneletPose(); not lanelet_pose) { - stop(cpp_mock_scenarios::Result::FAILURE); - } else if ( - std::abs(static_cast(lanelet_pose.value()).offset) <= 2.8) { + } else if (ego_entity->isInLanelet(34507, 0.1)) { + stop(cpp_mock_scenarios::Result::SUCCESS); + } else if (std::abs(ego_entity->getCanonicalizedStatus().getLaneletPose().offset) <= 2.8) { stop(cpp_mock_scenarios::Result::FAILURE); } } @@ -57,8 +53,9 @@ class FollowLaneWithOffsetScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 0.0, 3.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/follow_trajectory/follow_polyline_trajectory_with_do_nothing_plugin.cpp b/mock/cpp_mock_scenarios/src/follow_trajectory/follow_polyline_trajectory_with_do_nothing_plugin.cpp index 001c24f9589..bdfc883a9e8 100644 --- a/mock/cpp_mock_scenarios/src/follow_trajectory/follow_polyline_trajectory_with_do_nothing_plugin.cpp +++ b/mock/cpp_mock_scenarios/src/follow_trajectory/follow_polyline_trajectory_with_do_nothing_plugin.cpp @@ -63,31 +63,33 @@ class FollowPolylineTrajectoryWithDoNothingPluginScenario void onUpdate() override { + const auto ego_entity = api_.getEntity("ego"); // LCOV_EXCL_START if (api_.getCurrentTime() >= 10.0) { stop(cpp_mock_scenarios::Result::FAILURE); } // LCOV_EXCL_STOP - if (equals(api_.getCurrentTime(), 0.0, 0.01) && !api_.reachPosition("ego", spawn_pose, 0.1)) { + if ( + equals(api_.getCurrentTime(), 0.0, 0.01) && !ego_entity->isNearbyPosition(spawn_pose, 0.1)) { stop(cpp_mock_scenarios::Result::FAILURE); } if ( equals(api_.getCurrentTime(), 1.0, 0.01) && - !api_.reachPosition("ego", trajectory_start_pose, 0.1)) { + !ego_entity->isNearbyPosition(trajectory_start_pose, 0.1)) { stop(cpp_mock_scenarios::Result::FAILURE); } if ( equals(api_.getCurrentTime(), 1.5, 0.01) && - !api_.reachPosition("ego", trajectory_waypoint_pose, 0.1)) { + !ego_entity->isNearbyPosition(trajectory_waypoint_pose, 0.1)) { stop(cpp_mock_scenarios::Result::FAILURE); } if ( equals(api_.getCurrentTime(), 2.0, 0.01) && - !api_.reachPosition("ego", trajectory_goal_pose, 0.1)) { + !ego_entity->isNearbyPosition(trajectory_goal_pose, 0.1)) { stop(cpp_mock_scenarios::Result::FAILURE); } if (equals(api_.getCurrentTime(), 2.5, 0.01)) { - if (api_.reachPosition("ego", trajectory_goal_pose, 0.1)) { + if (ego_entity->isNearbyPosition(trajectory_goal_pose, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } else { stop(cpp_mock_scenarios::Result::FAILURE); @@ -99,10 +101,10 @@ class FollowPolylineTrajectoryWithDoNothingPluginScenario api_.spawn( "ego", spawn_pose, getVehicleParameters(), traffic_simulator::entity::VehicleEntity::BuiltinBehavior::doNothing()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); - api_.requestFollowTrajectory( - "ego", + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); + ego_entity->requestFollowTrajectory( std::make_shared( traffic_simulator_msgs::build() .initial_distance_offset(0.0) diff --git a/mock/cpp_mock_scenarios/src/lane_change/lanechange_left.cpp b/mock/cpp_mock_scenarios/src/lane_change/lanechange_left.cpp index 0a0a8ee6bd4..80cc44861d2 100644 --- a/mock/cpp_mock_scenarios/src/lane_change/lanechange_left.cpp +++ b/mock/cpp_mock_scenarios/src/lane_change/lanechange_left.cpp @@ -39,7 +39,7 @@ class LaneChangeLeftScenario : public cpp_mock_scenarios::CppScenarioNode bool requested = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34513, 0.1)) { + if (api_.getEntity("ego")->isInLanelet(34513, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } // LCOV_EXCL_START @@ -53,9 +53,10 @@ class LaneChangeLeftScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34462, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); - api_.requestLaneChange("ego", traffic_simulator::lane_change::Direction::LEFT); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); + ego_entity->requestLaneChange(traffic_simulator::lane_change::Direction::LEFT); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/lane_change/lanechange_left_with_id.cpp b/mock/cpp_mock_scenarios/src/lane_change/lanechange_left_with_id.cpp index 5745bd5eb82..8150980a80a 100644 --- a/mock/cpp_mock_scenarios/src/lane_change/lanechange_left_with_id.cpp +++ b/mock/cpp_mock_scenarios/src/lane_change/lanechange_left_with_id.cpp @@ -39,7 +39,7 @@ class LaneChangeLeftWithIdScenario : public cpp_mock_scenarios::CppScenarioNode bool requested = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34513, 0.1)) { + if (api_.getEntity("ego")->isInLanelet(34513, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } // LCOV_EXCL_START @@ -53,9 +53,10 @@ class LaneChangeLeftWithIdScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34462, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); - api_.requestLaneChange("ego", 34513); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); + ego_entity->requestLaneChange(34513); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear.cpp b/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear.cpp index face1ea094a..d203b50e5f9 100644 --- a/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear.cpp +++ b/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear.cpp @@ -40,10 +40,11 @@ class LaneChangeLinearScenario : public cpp_mock_scenarios::CppScenarioNode bool lanechange_finished = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34513, 0.1)) { + const auto ego_entity = api_.getEntity("ego"); + if (ego_entity->isInLanelet(34513, 0.1)) { lanechange_finished = true; } - if (lanechange_finished && api_.isInLanelet("ego", 34510, 0.1)) { + if (lanechange_finished && ego_entity->isInLanelet(34510, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } // LCOV_EXCL_START @@ -57,10 +58,10 @@ class LaneChangeLinearScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34462, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); - api_.requestLaneChange( - "ego", + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); + ego_entity->requestLaneChange( traffic_simulator::lane_change::RelativeTarget( "ego", traffic_simulator::lane_change::Direction::LEFT, 1, 0), traffic_simulator::lane_change::TrajectoryShape::LINEAR, diff --git a/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear_lateral_velocity.cpp b/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear_lateral_velocity.cpp index 669f38f0640..c5900380f04 100644 --- a/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear_lateral_velocity.cpp +++ b/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear_lateral_velocity.cpp @@ -39,10 +39,11 @@ class LaneChangeLinearLateralVelocityScenario : public cpp_mock_scenarios::CppSc int lanechange_frames = 0; void onUpdate() override { - if (api_.getCurrentAction("ego") == "lane_change") { + const auto ego_entity = api_.getEntity("ego"); + if (ego_entity->getCurrentAction() == "lane_change") { lanechange_frames++; } - if (api_.getCurrentAction("ego") != "lane_change" && api_.getCurrentTime() >= 2.0) { + if (ego_entity->getCurrentAction() != "lane_change" && api_.getCurrentTime() >= 2.0) { double duration = static_cast(lanechange_frames) * 0.05; if (duration >= 3.05 && 3.1 >= duration) { stop(cpp_mock_scenarios::Result::SUCCESS); @@ -61,10 +62,10 @@ class LaneChangeLinearLateralVelocityScenario : public cpp_mock_scenarios::CppSc api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34462, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); - api_.requestLaneChange( - "ego", + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); + ego_entity->requestLaneChange( traffic_simulator::lane_change::RelativeTarget( "ego", traffic_simulator::lane_change::Direction::LEFT, 1, 0), traffic_simulator::lane_change::TrajectoryShape::LINEAR, diff --git a/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear_time.cpp b/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear_time.cpp index 91eb620c7db..a34100d1d11 100644 --- a/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear_time.cpp +++ b/mock/cpp_mock_scenarios/src/lane_change/lanechange_linear_time.cpp @@ -39,10 +39,11 @@ class LaneChangeLinearTimeScenario : public cpp_mock_scenarios::CppScenarioNode int lanechange_frames = 0; void onUpdate() override { - if (api_.getCurrentAction("ego") == "lane_change") { + const auto ego_entity = api_.getEntity("ego"); + if (ego_entity->getCurrentAction() == "lane_change") { lanechange_frames++; } - if (api_.getCurrentAction("ego") != "lane_change" && api_.getCurrentTime() >= 10.0) { + if (ego_entity->getCurrentAction() != "lane_change" && api_.getCurrentTime() >= 10.0) { if (const double step_time = 50e-3, expected_time = 20.0, real_time = static_cast(lanechange_frames) * step_time; expected_time - step_time <= real_time && real_time <= expected_time + step_time) { @@ -62,10 +63,10 @@ class LaneChangeLinearTimeScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34462, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); - api_.requestLaneChange( - "ego", + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); + ego_entity->requestLaneChange( traffic_simulator::lane_change::RelativeTarget( "ego", traffic_simulator::lane_change::Direction::LEFT, 1, 0), traffic_simulator::lane_change::TrajectoryShape::LINEAR, diff --git a/mock/cpp_mock_scenarios/src/lane_change/lanechange_longitudinal_distance.cpp b/mock/cpp_mock_scenarios/src/lane_change/lanechange_longitudinal_distance.cpp index 119c6672db2..ac215129767 100644 --- a/mock/cpp_mock_scenarios/src/lane_change/lanechange_longitudinal_distance.cpp +++ b/mock/cpp_mock_scenarios/src/lane_change/lanechange_longitudinal_distance.cpp @@ -40,7 +40,7 @@ class LaneChangeLongitudinalDistanceScenario : public cpp_mock_scenarios::CppSce bool lanechange_finished = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34513, 0.1)) { + if (api_.getEntity("ego")->isInLanelet(34513, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } } @@ -49,10 +49,10 @@ class LaneChangeLongitudinalDistanceScenario : public cpp_mock_scenarios::CppSce api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34462, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 1); - api_.requestSpeedChange("ego", 1, true); - api_.requestLaneChange( - "ego", + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(1); + ego_entity->requestSpeedChange(1, true); + ego_entity->requestLaneChange( traffic_simulator::lane_change::RelativeTarget( "ego", traffic_simulator::lane_change::Direction::LEFT, 1, 0), traffic_simulator::lane_change::TrajectoryShape::CUBIC, diff --git a/mock/cpp_mock_scenarios/src/lane_change/lanechange_right.cpp b/mock/cpp_mock_scenarios/src/lane_change/lanechange_right.cpp index d0d5c98edc4..577467829df 100644 --- a/mock/cpp_mock_scenarios/src/lane_change/lanechange_right.cpp +++ b/mock/cpp_mock_scenarios/src/lane_change/lanechange_right.cpp @@ -39,7 +39,7 @@ class LaneChangeRightScenario : public cpp_mock_scenarios::CppScenarioNode bool requested = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34462, 0.1)) { + if (api_.getEntity("ego")->isInLanelet(34462, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } // LCOV_EXCL_START @@ -53,10 +53,11 @@ class LaneChangeRightScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); - api_.requestLaneChange("ego", traffic_simulator::lane_change::Direction::RIGHT); - // api_.requestLaneChange("ego", 34462); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); + ego_entity->requestLaneChange(traffic_simulator::lane_change::Direction::RIGHT); + // ego_entity->requestLaneChange(34462); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/lane_change/lanechange_right_with_id.cpp b/mock/cpp_mock_scenarios/src/lane_change/lanechange_right_with_id.cpp index a5566f47f44..03c8de2905b 100644 --- a/mock/cpp_mock_scenarios/src/lane_change/lanechange_right_with_id.cpp +++ b/mock/cpp_mock_scenarios/src/lane_change/lanechange_right_with_id.cpp @@ -39,7 +39,7 @@ class LaneChangeRightWithIdScenario : public cpp_mock_scenarios::CppScenarioNode bool requested = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34462, 0.1)) { + if (api_.getEntity("ego")->isInLanelet(34462, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } // LCOV_EXCL_START @@ -53,9 +53,10 @@ class LaneChangeRightWithIdScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); - api_.requestLaneChange("ego", 34462); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); + ego_entity->requestLaneChange(34462); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/lane_change/lanechange_time.cpp b/mock/cpp_mock_scenarios/src/lane_change/lanechange_time.cpp index 1f07591bf70..e1a4e715cc0 100644 --- a/mock/cpp_mock_scenarios/src/lane_change/lanechange_time.cpp +++ b/mock/cpp_mock_scenarios/src/lane_change/lanechange_time.cpp @@ -39,10 +39,11 @@ class LaneChangeTimeScenario : public cpp_mock_scenarios::CppScenarioNode int lanechange_frames = 0; void onUpdate() override { - if (api_.getCurrentAction("ego") == "lane_change") { + const auto ego_entity = api_.getEntity("ego"); + if (ego_entity->getCurrentAction() == "lane_change") { lanechange_frames++; } - if (api_.getCurrentAction("ego") != "lane_change" && api_.getCurrentTime() >= 10.0) { + if (ego_entity->getCurrentAction() != "lane_change" && api_.getCurrentTime() >= 10.0) { if (const double step_time = 50e-3, expected_time = 20.0, real_time = static_cast(lanechange_frames) * step_time; expected_time - step_time <= real_time && real_time <= expected_time + step_time) { @@ -62,10 +63,10 @@ class LaneChangeTimeScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34462, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 10, true); - api_.requestLaneChange( - "ego", + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(10, true); + ego_entity->requestLaneChange( traffic_simulator::lane_change::RelativeTarget( "ego", traffic_simulator::lane_change::Direction::LEFT, 1, 0), traffic_simulator::lane_change::TrajectoryShape::CUBIC, diff --git a/mock/cpp_mock_scenarios/src/measurement/get_distance_in_lane_coordinate_distance.cpp b/mock/cpp_mock_scenarios/src/measurement/get_distance_in_lane_coordinate_distance.cpp index 4da50aecfe8..b15fd8f96b5 100644 --- a/mock/cpp_mock_scenarios/src/measurement/get_distance_in_lane_coordinate_distance.cpp +++ b/mock/cpp_mock_scenarios/src/measurement/get_distance_in_lane_coordinate_distance.cpp @@ -44,15 +44,13 @@ class GetDistanceInLaneCoordinateScenario : public cpp_mock_scenarios::CppScenar auto lateralDistance(const std::string & from_entity_name, const std::string & to_entity_name) -> std::optional { - if (const auto from_entity = api_.getEntity(from_entity_name); - from_entity && from_entity->laneMatchingSucceed()) { - if (const auto to_entity = api_.getEntity(to_entity_name); - to_entity && to_entity->laneMatchingSucceed()) { - return traffic_simulator::distance::lateralDistance( - from_entity->getCanonicalizedLaneletPose().value(), - to_entity->getCanonicalizedLaneletPose().value(), - traffic_simulator::RoutingConfiguration()); - } + const auto from_entity = api_.getEntity(from_entity_name); + const auto to_entity = api_.getEntity(to_entity_name); + if (from_entity->isInLanelet() && to_entity->isInLanelet()) { + return traffic_simulator::distance::lateralDistance( + from_entity->getCanonicalizedLaneletPose().value(), + to_entity->getCanonicalizedLaneletPose().value(), + traffic_simulator::RoutingConfiguration()); } return std::nullopt; }; @@ -61,16 +59,14 @@ class GetDistanceInLaneCoordinateScenario : public cpp_mock_scenarios::CppScenar const std::string & from_entity_name, const std::string & to_entity_name, const double matching_distance) -> std::optional { - if (const auto from_entity = api_.getEntity(from_entity_name)) { - if (const auto to_entity = api_.getEntity(to_entity_name)) { - auto from_entity_lanelet_pose = from_entity->getCanonicalizedLaneletPose(matching_distance); - auto to_entity_lanelet_pose = to_entity->getCanonicalizedLaneletPose(matching_distance); - if (from_entity_lanelet_pose && to_entity_lanelet_pose) { - return traffic_simulator::distance::lateralDistance( - from_entity_lanelet_pose.value(), to_entity_lanelet_pose.value(), - traffic_simulator::RoutingConfiguration()); - } - } + const auto from_entity_lanelet_pose = + api_.getEntity(from_entity_name)->getCanonicalizedLaneletPose(matching_distance); + const auto to_entity_lanelet_pose = + api_.getEntity(to_entity_name)->getCanonicalizedLaneletPose(matching_distance); + if (from_entity_lanelet_pose && to_entity_lanelet_pose) { + return traffic_simulator::distance::lateralDistance( + from_entity_lanelet_pose.value(), to_entity_lanelet_pose.value(), + traffic_simulator::RoutingConfiguration()); } return std::nullopt; }; @@ -79,15 +75,13 @@ class GetDistanceInLaneCoordinateScenario : public cpp_mock_scenarios::CppScenar const std::string & from_entity_name, const std::string & to_entity_name) -> std::optional { - if (const auto from_entity = api_.getEntity(from_entity_name); - from_entity && from_entity->laneMatchingSucceed()) { - if (const auto to_entity = api_.getEntity(to_entity_name); - to_entity && to_entity->laneMatchingSucceed()) { - return traffic_simulator::distance::longitudinalDistance( - from_entity->getCanonicalizedLaneletPose().value(), - to_entity->getCanonicalizedLaneletPose().value(), false, false, - traffic_simulator::RoutingConfiguration()); - } + const auto from_entity = api_.getEntity(from_entity_name); + const auto to_entity = api_.getEntity(to_entity_name); + if (from_entity->isInLanelet() && to_entity->isInLanelet()) { + return traffic_simulator::distance::longitudinalDistance( + from_entity->getCanonicalizedLaneletPose().value(), + to_entity->getCanonicalizedLaneletPose().value(), false, false, + traffic_simulator::RoutingConfiguration()); } return std::nullopt; } @@ -146,20 +140,23 @@ class GetDistanceInLaneCoordinateScenario : public cpp_mock_scenarios::CppScenar api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 5.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 3, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(3, true); api_.spawn( "front", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 10.0, 1.0), getVehicleParameters()); - api_.setLinearVelocity("front", 10); - api_.requestSpeedChange("front", 3, true); + auto front_entity = api_.getEntity("front"); + front_entity->setLinearVelocity(10); + front_entity->requestSpeedChange(3, true); api_.spawn( "behind", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 0.0, -1.0), getVehicleParameters()); - api_.setLinearVelocity("behind", 10); - api_.requestSpeedChange("behind", 3, true); + auto behind_entity = api_.getEntity("behind"); + behind_entity->setLinearVelocity(10); + behind_entity->requestSpeedChange(3, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/measurement/get_distance_to_lane_bound.cpp b/mock/cpp_mock_scenarios/src/measurement/get_distance_to_lane_bound.cpp index df01425afd9..92e89f5bbb5 100644 --- a/mock/cpp_mock_scenarios/src/measurement/get_distance_to_lane_bound.cpp +++ b/mock/cpp_mock_scenarios/src/measurement/get_distance_to_lane_bound.cpp @@ -44,23 +44,23 @@ class GetDistanceToLaneBoundScenario : public cpp_mock_scenarios::CppScenarioNod if (api_.getCurrentTime() >= 10.0) { stop(cpp_mock_scenarios::Result::SUCCESS); } - if (auto ego_entity = api_.getEntity("ego")) { - const auto distance = traffic_simulator::distance::distanceToLaneBound( - ego_entity->getMapPose(), ego_entity->getBoundingBox(), ego_entity->getRouteLanelets()); - // LCOV_EXCL_START - if (distance <= 0.4 && distance >= 0.52) { - stop(cpp_mock_scenarios::Result::FAILURE); - } - // LCOV_EXCL_STOP + const auto ego_entity = api_.getEntity("ego"); + const auto distance = traffic_simulator::distance::distanceToLaneBound( + ego_entity->getMapPose(), ego_entity->getBoundingBox(), ego_entity->getRouteLanelets()); + // LCOV_EXCL_START + if (distance <= 0.4 && distance >= 0.52) { + stop(cpp_mock_scenarios::Result::FAILURE); } + // LCOV_EXCL_STOP } void onInitialize() override { api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 5.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 3, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(3, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/merge/merge_left.cpp b/mock/cpp_mock_scenarios/src/merge/merge_left.cpp index cf20ad99b84..2f8cbe306ef 100644 --- a/mock/cpp_mock_scenarios/src/merge/merge_left.cpp +++ b/mock/cpp_mock_scenarios/src/merge/merge_left.cpp @@ -39,7 +39,7 @@ class MergeLeftScenario : public cpp_mock_scenarios::CppScenarioNode bool requested = false; void onUpdate() override { - if (api_.isInLanelet("ego", 34510, 0.1)) { + if (api_.getEntity("ego")->isInLanelet(34510, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } // LCOV_EXCL_START @@ -56,14 +56,15 @@ class MergeLeftScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34462, 15.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 5); - api_.requestSpeedChange("ego", 5, true); - api_.requestLaneChange("ego", 34513); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(5); + ego_entity->requestSpeedChange(5, true); + ego_entity->requestLaneChange(34513); api_.spawn( "npc", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("npc", 10); + api_.getEntity("npc")->setLinearVelocity(10); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/metrics/traveled_distance.cpp b/mock/cpp_mock_scenarios/src/metrics/traveled_distance.cpp index 9e842315754..7051624ae1b 100644 --- a/mock/cpp_mock_scenarios/src/metrics/traveled_distance.cpp +++ b/mock/cpp_mock_scenarios/src/metrics/traveled_distance.cpp @@ -44,23 +44,15 @@ class TraveledDistanceScenario : public cpp_mock_scenarios::CppScenarioNode void onUpdate() override { // LCOV_EXCL_START - const auto entity = api_.getEntity("ego"); - if (!entity) { + if (const auto ego_entity = api_.getEntity("ego"); !ego_entity->isInLanelet()) { stop(cpp_mock_scenarios::Result::FAILURE); - } - const auto lanelet_pose = entity->getCanonicalizedLaneletPose(); - const auto traveled_distance = api_.getTraveledDistance("ego"); - if (!lanelet_pose) { - stop(cpp_mock_scenarios::Result::FAILURE); - } - const auto difference = std::abs( - static_cast(lanelet_pose.value()).s - traveled_distance); - if (difference > std::numeric_limits::epsilon()) { + } else if (const auto difference = std::abs( + ego_entity->getCanonicalizedStatus().getLaneletPose().s - + ego_entity->getTraveledDistance()); + difference > std::numeric_limits::epsilon()) { stop(cpp_mock_scenarios::Result::FAILURE); - } - // LCOV_EXCL_STOP - - if (api_.getCurrentTime() >= 12) { + } // LCOV_EXCL_STOP + else if (api_.getCurrentTime() >= 12) { stop(cpp_mock_scenarios::Result::SUCCESS); } } @@ -70,8 +62,9 @@ class TraveledDistanceScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 3); - api_.requestSpeedChange("ego", 3, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(3); + ego_entity->requestSpeedChange(3, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/move_backward/move_backward.cpp b/mock/cpp_mock_scenarios/src/move_backward/move_backward.cpp index eee09676089..ceae8ab34a4 100644 --- a/mock/cpp_mock_scenarios/src/move_backward/move_backward.cpp +++ b/mock/cpp_mock_scenarios/src/move_backward/move_backward.cpp @@ -42,8 +42,7 @@ class MoveBackwardScenario : public cpp_mock_scenarios::CppScenarioNode stop(cpp_mock_scenarios::Result::SUCCESS); } // LCOV_EXCL_START - double ego_twist = api_.getCurrentTwist("ego").linear.x; - if (ego_twist >= -2.9) { + if (api_.getEntity("ego")->getCurrentTwist().linear.x >= -2.9) { stop(cpp_mock_scenarios::Result::FAILURE); } // LCOV_EXCL_STOP @@ -54,8 +53,9 @@ class MoveBackwardScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", -3); - api_.requestSpeedChange("ego", -3, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(-3); + ego_entity->requestSpeedChange(-3, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/pedestrian/walk_straight.cpp b/mock/cpp_mock_scenarios/src/pedestrian/walk_straight.cpp index 82a53ad57ec..ef945222976 100644 --- a/mock/cpp_mock_scenarios/src/pedestrian/walk_straight.cpp +++ b/mock/cpp_mock_scenarios/src/pedestrian/walk_straight.cpp @@ -40,7 +40,7 @@ class WalkStraightScenario : public cpp_mock_scenarios::CppScenarioNode { const auto t = api_.getCurrentTime(); // LCOV_EXCL_START - if (api_.entityExists("bob") && api_.checkCollision("ego", "bob")) { + if (api_.isEntityExist("bob") && api_.checkCollision("ego", "bob")) { stop(cpp_mock_scenarios::Result::FAILURE); } /** @@ -50,13 +50,13 @@ class WalkStraightScenario : public cpp_mock_scenarios::CppScenarioNode * @sa https://wandbox.org/permlink/dSNRX7K2bQiqSI7P */ if (t == 1.0) { - const auto vel = api_.getCurrentTwist("bob").linear.x; + const auto vel = api_.getEntity("bob")->getCurrentTwist().linear.x; if (t != vel) { stop(cpp_mock_scenarios::Result::FAILURE); } } if (t >= 6.65 && 7.25 >= t) { - const auto vel = api_.getCurrentTwist("ego").linear.x; + const auto vel = api_.getEntity("ego")->getCurrentTwist().linear.x; if (std::fabs(0.01) <= vel) { stop(cpp_mock_scenarios::Result::FAILURE); } @@ -72,19 +72,20 @@ class WalkStraightScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(120545, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 8, true); - api_.requestAssignRoute( - "ego", std::vector{ - traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0), - traffic_simulator::helper::constructCanonicalizedLaneletPose(34690, 0.0, 0.0)}); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(8, true); + ego_entity->requestAssignRoute(std::vector{ + traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0), + traffic_simulator::helper::constructCanonicalizedLaneletPose(34690, 0.0, 0.0)}); api_.spawn( "bob", traffic_simulator::helper::constructCanonicalizedLaneletPose(34378, 0.0, 0.0), getPedestrianParameters()); - api_.setLinearVelocity("bob", 0); - api_.requestWalkStraight("bob"); - api_.requestSpeedChange( - "bob", 1.0, traffic_simulator::speed_change::Transition::LINEAR, + auto bob_entity = api_.getEntity("bob"); + bob_entity->setLinearVelocity(0); + bob_entity->requestWalkStraight(); + bob_entity->requestSpeedChange( + 1.0, traffic_simulator::speed_change::Transition::LINEAR, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0), true); diff --git a/mock/cpp_mock_scenarios/src/random_scenario/random001.cpp b/mock/cpp_mock_scenarios/src/random_scenario/random001.cpp index 28375809926..eb43a00d653 100644 --- a/mock/cpp_mock_scenarios/src/random_scenario/random001.cpp +++ b/mock/cpp_mock_scenarios/src/random_scenario/random001.cpp @@ -75,7 +75,7 @@ class RandomScenario : public cpp_mock_scenarios::CppScenarioNode offset), getVehicleParameters( get_entity_subtype(params_.random_parameters.road_parking_vehicle.entity_type))); - api_.requestSpeedChange(entity_name, 0, true); + api_.getEntity(entity_name)->requestSpeedChange(0, true); }; std::uniform_real_distribution<> dist( params_.random_parameters.road_parking_vehicle.min_offset, @@ -98,7 +98,7 @@ class RandomScenario : public cpp_mock_scenarios::CppScenarioNode { for (int i = 0; i < params_.random_parameters.crossing_pedestrian.number_of_pedestrian; i++) { std::string entity_name = "pedestrian" + std::to_string(i); - if (api_.entityExists(entity_name)) { + if (api_.isEntityExist(entity_name)) { api_.despawn(entity_name); } } @@ -106,6 +106,7 @@ class RandomScenario : public cpp_mock_scenarios::CppScenarioNode void onUpdate() override { + const auto ego_entity = api_.getEntity("ego"); { if (param_listener_->is_old(params_)) { /// When the parameter was updated, clear entity before re-spawning entity. @@ -119,7 +120,7 @@ class RandomScenario : public cpp_mock_scenarios::CppScenarioNode }; const auto spawn_and_change_lane = [&](const auto & entity_name, const auto spawn_s_value) { - if (!api_.entityExists(entity_name)) { + if (!api_.isEntityExist(entity_name)) { api_.spawn( entity_name, traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, spawn_s_value, 0.0), @@ -128,24 +129,26 @@ class RandomScenario : public cpp_mock_scenarios::CppScenarioNode params_.random_parameters.lane_following_vehicle.min_speed, params_.random_parameters.lane_following_vehicle.max_speed); const auto speed = speed_distribution(engine_); - api_.requestSpeedChange(entity_name, speed, true); - api_.setLinearVelocity(entity_name, speed); + auto entity = api_.getEntity(entity_name); + entity->requestSpeedChange(speed, true); + entity->setLinearVelocity(speed); std::uniform_real_distribution<> lane_change_position_distribution( 0.0, traffic_simulator::lanelet_map::laneletLength(34684)); lane_change_position = lane_change_position_distribution(engine_); lane_change_requested = false; } /// Checking the ego entity overs the lane change position. - if (const auto entity = api_.getEntity("ego"); entity->laneMatchingSucceed()) { - const auto lanelet_pose = entity->getCanonicalizedStatus().getLaneletPose(); + if (ego_entity->isInLanelet()) { + const auto lanelet_pose = ego_entity->getCanonicalizedStatus().getLaneletPose(); if (lanelet_pose.lanelet_id == 34684 && std::abs(lanelet_pose.s) >= lane_change_position) { - api_.requestLaneChange(entity_name, traffic_simulator::lane_change::Direction::RIGHT); + api_.getEntity(entity_name) + ->requestLaneChange(traffic_simulator::lane_change::Direction::RIGHT); lane_change_requested = true; } } }; - if (api_.isInLanelet("ego", 34684, 0.1)) { + if (ego_entity->isInLanelet(34684, 0.1)) { spawn_and_change_lane("lane_following_0", 0.0); } @@ -154,10 +157,9 @@ class RandomScenario : public cpp_mock_scenarios::CppScenarioNode std::string entity_name = "pedestrian" + std::to_string(entity_index); constexpr lanelet::Id lanelet_id = 34392; if ( - !api_.entityExists(entity_name) && - !api_.reachPosition( - "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34576, 25.0, 0.0), - 5.0)) { + !api_.isEntityExist(entity_name) && + !ego_entity->isNearbyPosition( + traffic_simulator::helper::constructCanonicalizedLaneletPose(34576, 25.0, 0.0), 5.0)) { std::normal_distribution<> offset_distribution( 0.0, params_.random_parameters.crossing_pedestrian.offset_variance); std::uniform_real_distribution<> speed_distribution( @@ -169,10 +171,13 @@ class RandomScenario : public cpp_mock_scenarios::CppScenarioNode lanelet_id, 0.0, offset_distribution(engine_)), getPedestrianParameters()); const auto speed = speed_distribution(engine_); - api_.requestSpeedChange(entity_name, speed, true); - api_.setLinearVelocity(entity_name, speed); + auto entity = api_.getEntity(entity_name); + entity->requestSpeedChange(speed, true); + entity->setLinearVelocity(speed); } - if (api_.entityExists(entity_name) && api_.getStandStillDuration(entity_name) >= 0.5) { + if ( + api_.isEntityExist(entity_name) && + api_.getEntity(entity_name)->getStandStillDuration() >= 0.5) { api_.despawn(entity_name); } }; @@ -180,37 +185,34 @@ class RandomScenario : public cpp_mock_scenarios::CppScenarioNode spawn_and_cross_pedestrian(i); } - { - const auto trigger_position = - traffic_simulator::helper::constructCanonicalizedLaneletPose(34621, 10.0, 0.0); - const auto ego_goal_position = - traffic_simulator::helper::constructCanonicalizedLaneletPose(34606, 0.0, 0.0); - const auto entity_name = "spawn_nearby_ego"; - - if (const auto ego = api_.getEntity("ego")) { - if (api_.reachPosition("ego", trigger_position, 20.0) && !api_.entityExists(entity_name)) { - api_.spawn( - entity_name, - traffic_simulator::pose::transformRelativePoseToGlobal( - ego->getMapPose(), - geometry_msgs::build() - .position(geometry_msgs::build().x(10).y(-5).z(0)) - .orientation(geometry_msgs::msg::Quaternion())), - getVehicleParameters(), - traffic_simulator::entity::VehicleEntity::BuiltinBehavior::doNothing()); - } + const auto trigger_position = + traffic_simulator::helper::constructCanonicalizedLaneletPose(34621, 10.0, 0.0); + const auto ego_goal_position = + traffic_simulator::helper::constructCanonicalizedLaneletPose(34606, 0.0, 0.0); + constexpr auto entity_name = "spawn_nearby_ego"; - if (!api_.reachPosition("ego", trigger_position, 20.0) && api_.entityExists(entity_name)) { - api_.despawn(entity_name); - } - } + if (ego_entity->isNearbyPosition(trigger_position, 20.0) && !api_.isEntityExist(entity_name)) { + api_.spawn( + entity_name, + traffic_simulator::pose::transformRelativePoseToGlobal( + ego_entity->getMapPose(), + geometry_msgs::build() + .position(geometry_msgs::build().x(10.0).y(-5.0).z(0.0)) + .orientation(geometry_msgs::msg::Quaternion())), + getVehicleParameters(), + traffic_simulator::entity::VehicleEntity::BuiltinBehavior::doNothing()); + } - if (api_.reachPosition("ego", ego_goal_position, 1.0)) { - api_.despawn("ego"); - stop(cpp_mock_scenarios::Result::SUCCESS); - } + if (!ego_entity->isNearbyPosition(trigger_position, 20.0) && api_.isEntityExist(entity_name)) { + api_.despawn(entity_name); + } + + if (ego_entity->isNearbyPosition(ego_goal_position, 1.0)) { + api_.despawn("ego"); + stop(cpp_mock_scenarios::Result::SUCCESS); } } + void onInitialize() override { // api_.setVerbose(true); diff --git a/mock/cpp_mock_scenarios/src/spawn/spawn_in_map_frame.cpp b/mock/cpp_mock_scenarios/src/spawn/spawn_in_map_frame.cpp index e31df21eef0..cac0caff70f 100644 --- a/mock/cpp_mock_scenarios/src/spawn/spawn_in_map_frame.cpp +++ b/mock/cpp_mock_scenarios/src/spawn/spawn_in_map_frame.cpp @@ -40,7 +40,7 @@ class SpawnInMapFrameScenario : public cpp_mock_scenarios::CppScenarioNode { const auto map_pose = traffic_simulator::pose::toMapPose( traffic_simulator::helper::constructCanonicalizedLaneletPose(120545, 0.0, 0.0)); - if (api_.reachPosition("ego", map_pose, 0.1)) { + if (api_.getEntity("ego")->isNearbyPosition(map_pose, 0.1)) { stop(cpp_mock_scenarios::Result::SUCCESS); } else { stop(cpp_mock_scenarios::Result::FAILURE); diff --git a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change.cpp b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change.cpp index 9f00065436a..bf47aa048c1 100644 --- a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change.cpp +++ b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change.cpp @@ -39,15 +39,14 @@ class RequestSpeedChangeScenario : public cpp_mock_scenarios::CppScenarioNode private: void onUpdate() override { - if (api_.getCurrentTwist("front").linear.x < 10.0) { + const auto ego_linear_velocity = api_.getEntity("ego")->getCurrentTwist().linear.x; + if (api_.getEntity("front")->getCurrentTwist().linear.x < 10.0) { stop(cpp_mock_scenarios::Result::FAILURE); } - if (api_.getCurrentTime() <= 0.9 && api_.getCurrentTwist("ego").linear.x > 10.0) { + if (api_.getCurrentTime() <= 0.9 && ego_linear_velocity > 10.0) { stop(cpp_mock_scenarios::Result::FAILURE); } - if ( - api_.getCurrentTime() >= 1.0 && api_.getCurrentTwist("ego").linear.x <= 10.0 && - api_.getCurrentTwist("ego").linear.x >= 9.9) { + if (api_.getCurrentTime() >= 1.0 && ego_linear_velocity <= 10.0 && ego_linear_velocity >= 9.9) { stop(cpp_mock_scenarios::Result::SUCCESS); } } @@ -57,9 +56,10 @@ class RequestSpeedChangeScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0); - api_.requestSpeedChange( - "ego", 10.0, traffic_simulator::speed_change::Transition::LINEAR, + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0); + ego_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::LINEAR, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 10.0), true); @@ -67,9 +67,10 @@ class RequestSpeedChangeScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "front", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("front", 0); - api_.requestSpeedChange( - "front", 10.0, traffic_simulator::speed_change::Transition::STEP, + auto front_entity = api_.getEntity("front"); + front_entity->setLinearVelocity(0); + front_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::STEP, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 10.0), true); diff --git a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_continuous_false.cpp b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_continuous_false.cpp index a83a987e2f8..981e3745789 100644 --- a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_continuous_false.cpp +++ b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_continuous_false.cpp @@ -43,17 +43,16 @@ class RequestSpeedChangeContinuousFalseScenario : public cpp_mock_scenarios::Cpp /** * @brief checking linear speed */ + const auto ego_linear_velocity = api_.getEntity("ego")->getCurrentTwist().linear.x; if (api_.getCurrentTime() <= 0.95) { - if (!equals(api_.getCurrentTime() * 10.0, api_.getCurrentTwist("ego").linear.x, 0.01)) { + if (!equals(api_.getCurrentTime() * 10.0, ego_linear_velocity, 0.01)) { stop(cpp_mock_scenarios::Result::FAILURE); } } - if (api_.getCurrentTime() >= 1.0 && api_.getCurrentTwist("ego").linear.x <= 10.0) { + if (api_.getCurrentTime() >= 1.0 && ego_linear_velocity <= 10.0) { speed_reached = true; } - if ( - speed_reached && api_.getCurrentTime() >= 1.5 && - api_.getCurrentTwist("ego").linear.x >= 13.88) { + if (speed_reached && api_.getCurrentTime() >= 1.5 && ego_linear_velocity >= 13.88) { stop(cpp_mock_scenarios::Result::SUCCESS); } } @@ -64,9 +63,10 @@ class RequestSpeedChangeContinuousFalseScenario : public cpp_mock_scenarios::Cpp api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0); - api_.requestSpeedChange( - "ego", 10.0, traffic_simulator::speed_change::Transition::LINEAR, + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0); + ego_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::LINEAR, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 10.0), false); diff --git a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_relative.cpp b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_relative.cpp index f65f1f28e83..b53583e9f3b 100644 --- a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_relative.cpp +++ b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_relative.cpp @@ -45,12 +45,11 @@ class RequestSpeedChangeRelativeScenario : public cpp_mock_scenarios::CppScenari api_.updateFrame(); const double current_time = api_.getCurrentTime(); - const double current_speed = api_.getCurrentTwist("front").linear.x; + auto front_entity = api_.getEntity("front"); if (current_time >= 0.0 and not request_sent) { request_sent = true; - api_.requestSpeedChange( - "front", + front_entity->requestSpeedChange( traffic_simulator::speed_change::RelativeTargetSpeed( "ego", traffic_simulator::speed_change::RelativeTargetSpeed::Type::DELTA, 2.0), traffic_simulator::speed_change::Transition::LINEAR, @@ -59,6 +58,7 @@ class RequestSpeedChangeRelativeScenario : public cpp_mock_scenarios::CppScenari true); } + const double current_speed = front_entity->getCurrentTwist().linear.x; static constexpr double speed_tolerance = 0.05; if (current_time >= 0.0 and current_time < 2.0) { if (not equals(current_time + 3.0, current_speed, speed_tolerance)) { @@ -78,13 +78,14 @@ class RequestSpeedChangeRelativeScenario : public cpp_mock_scenarios::CppScenari api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 3); - api_.requestSpeedChange("ego", 3.0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(3); + ego_entity->requestSpeedChange(3.0, true); api_.spawn( "front", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("front", 3); + api_.getEntity("front")->setLinearVelocity(3); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_step.cpp b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_step.cpp index a9d6755a600..414c2df08fc 100644 --- a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_step.cpp +++ b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_step.cpp @@ -40,8 +40,9 @@ class RequestSpeedChangeStepScenario : public cpp_mock_scenarios::CppScenarioNod void onUpdate() override { if ( - api_.getCurrentTime() <= 0.999 && !equals(api_.getCurrentTwist("ego").linear.x, 10.0, 0.01) && - !equals(api_.getCurrentTwist("front").linear.x, 10.0, 0.01)) { + api_.getCurrentTime() <= 0.999 && + !equals(api_.getEntity("ego")->getCurrentTwist().linear.x, 10.0, 0.01) && + !equals(api_.getEntity("front")->getCurrentTwist().linear.x, 10.0, 0.01)) { stop(cpp_mock_scenarios::Result::FAILURE); } if (api_.getCurrentTime() >= 1.0) { @@ -54,9 +55,10 @@ class RequestSpeedChangeStepScenario : public cpp_mock_scenarios::CppScenarioNod api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0); - api_.requestSpeedChange( - "ego", 10.0, traffic_simulator::speed_change::Transition::STEP, + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0); + ego_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::STEP, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 10.0), true); @@ -64,9 +66,10 @@ class RequestSpeedChangeStepScenario : public cpp_mock_scenarios::CppScenarioNod api_.spawn( "front", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("front", 0); - api_.requestSpeedChange( - "front", 10.0, traffic_simulator::speed_change::Transition::STEP, + auto front_entity = api_.getEntity("front"); + front_entity->setLinearVelocity(0); + front_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::STEP, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::TIME, 0.0), true); diff --git a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_limit.cpp b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_limit.cpp index d63a10f746f..1e2b366fca1 100644 --- a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_limit.cpp +++ b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_limit.cpp @@ -39,12 +39,11 @@ class RequestSpeedChangeWithLimitScenario : public cpp_mock_scenarios::CppScenar private: void onUpdate() override { - if (api_.getCurrentTime() <= 0.9 && api_.getCurrentTwist("ego").linear.x > 10.0) { + const auto ego_linear_velocity = api_.getEntity("ego")->getCurrentTwist().linear.x; + if (api_.getCurrentTime() <= 0.9 && ego_linear_velocity > 10.0) { stop(cpp_mock_scenarios::Result::FAILURE); } - if ( - api_.getCurrentTime() >= 1.0 && api_.getCurrentTwist("ego").linear.x <= 5.1 && - api_.getCurrentTwist("ego").linear.x >= 4.9) { + if (api_.getCurrentTime() >= 1.0 && ego_linear_velocity <= 5.1 && ego_linear_velocity >= 4.9) { stop(cpp_mock_scenarios::Result::SUCCESS); } } @@ -54,10 +53,11 @@ class RequestSpeedChangeWithLimitScenario : public cpp_mock_scenarios::CppScenar api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0); - api_.setVelocityLimit("ego", 5.0); - api_.requestSpeedChange( - "ego", 10.0, traffic_simulator::speed_change::Transition::LINEAR, + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0); + ego_entity->setVelocityLimit(5.0); + ego_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::LINEAR, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 10.0), true); diff --git a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint.cpp b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint.cpp index c3b47049b38..44bfaecc5d4 100644 --- a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint.cpp +++ b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint.cpp @@ -39,13 +39,12 @@ class RequestSpeedChangeWithTimeConstraintScenario : public cpp_mock_scenarios:: private: void onUpdate() override { - if (api_.getCurrentTime() <= 3.9 && api_.getCurrentTwist("ego").linear.x > 10.0) { + const auto ego_linear_velocity = api_.getEntity("ego")->getCurrentTwist().linear.x; + if (api_.getCurrentTime() <= 3.9 && ego_linear_velocity > 10.0) { stop(cpp_mock_scenarios::Result::FAILURE); } if (api_.getCurrentTime() >= 3.999) { - if ( - api_.getCurrentTwist("ego").linear.x <= 10.0 && - api_.getCurrentTwist("ego").linear.x >= 9.9) { + if (ego_linear_velocity <= 10.0 && ego_linear_velocity >= 9.9) { stop(cpp_mock_scenarios::Result::SUCCESS); } else { stop(cpp_mock_scenarios::Result::FAILURE); @@ -58,9 +57,10 @@ class RequestSpeedChangeWithTimeConstraintScenario : public cpp_mock_scenarios:: api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0); - api_.requestSpeedChange( - "ego", 10.0, traffic_simulator::speed_change::Transition::AUTO, + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0); + ego_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::AUTO, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::TIME, 4.0), false); @@ -68,9 +68,10 @@ class RequestSpeedChangeWithTimeConstraintScenario : public cpp_mock_scenarios:: api_.spawn( "front", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("front", 10); - api_.requestSpeedChange( - "front", 10.0, traffic_simulator::speed_change::Transition::LINEAR, + auto front_entity = api_.getEntity("front"); + front_entity->setLinearVelocity(10); + front_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::LINEAR, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 4.0), true); diff --git a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint_linear.cpp b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint_linear.cpp index a077508ba0f..66c7bbe8579 100644 --- a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint_linear.cpp +++ b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint_linear.cpp @@ -41,7 +41,8 @@ class RequestSpeedChangeWithTimeConstraintLinearScenario void onUpdate() override { if (api_.getCurrentTime() <= 3.999) { - if (!equals(api_.getCurrentTime() * 2.5, api_.getCurrentTwist("ego").linear.x, 0.01)) { + if (!equals( + api_.getCurrentTime() * 2.5, api_.getEntity("ego")->getCurrentTwist().linear.x, 0.01)) { stop(cpp_mock_scenarios::Result::FAILURE); } } else if (api_.getCurrentTime() >= 4.0) { @@ -54,9 +55,11 @@ class RequestSpeedChangeWithTimeConstraintLinearScenario api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0); - api_.requestSpeedChange( - "ego", 10.0, traffic_simulator::speed_change::Transition::LINEAR, + auto ego_entity = api_.getEntity("ego"); + + ego_entity->setLinearVelocity(0); + ego_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::LINEAR, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::TIME, 4.0), false); diff --git a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint_relative.cpp b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint_relative.cpp index ba8e3eceee9..19e16ee0b50 100644 --- a/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint_relative.cpp +++ b/mock/cpp_mock_scenarios/src/speed_planning/request_speed_change_with_time_constraint_relative.cpp @@ -40,13 +40,12 @@ class RequestSpeedChangeWithTimeConstraintRelativeScenario private: void onUpdate() override { - if (api_.getCurrentTime() <= 3.9 && api_.getCurrentTwist("ego").linear.x >= 3.0) { + const auto ego_linear_velocity = api_.getEntity("ego")->getCurrentTwist().linear.x; + if (api_.getCurrentTime() <= 3.9 && ego_linear_velocity >= 3.0) { stop(cpp_mock_scenarios::Result::FAILURE); } if (api_.getCurrentTime() >= 3.9999) { - if ( - api_.getCurrentTwist("ego").linear.x <= 3.1 && - api_.getCurrentTwist("ego").linear.x >= 2.9) { + if (ego_linear_velocity <= 3.1 && ego_linear_velocity >= 2.9) { stop(cpp_mock_scenarios::Result::SUCCESS); } else { stop(cpp_mock_scenarios::Result::FAILURE); @@ -59,9 +58,9 @@ class RequestSpeedChangeWithTimeConstraintRelativeScenario api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 1.0); - api_.requestSpeedChange( - "ego", + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(1.0); + ego_entity->requestSpeedChange( traffic_simulator::speed_change::RelativeTargetSpeed( "ego", traffic_simulator::speed_change::RelativeTargetSpeed::Type::DELTA, 2.0), traffic_simulator::speed_change::Transition::AUTO, @@ -72,9 +71,10 @@ class RequestSpeedChangeWithTimeConstraintRelativeScenario api_.spawn( "front", traffic_simulator::helper::constructCanonicalizedLaneletPose(34741, 10.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("front", 10); - api_.requestSpeedChange( - "front", 10.0, traffic_simulator::speed_change::Transition::LINEAR, + auto front_entity = api_.getEntity("front"); + front_entity->setLinearVelocity(10); + front_entity->requestSpeedChange( + 10.0, traffic_simulator::speed_change::Transition::LINEAR, traffic_simulator::speed_change::Constraint( traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 4.0), true); diff --git a/mock/cpp_mock_scenarios/src/synchronized_action/synchronized_action.cpp b/mock/cpp_mock_scenarios/src/synchronized_action/synchronized_action.cpp index f55fb1a6ae5..cc014d55261 100644 --- a/mock/cpp_mock_scenarios/src/synchronized_action/synchronized_action.cpp +++ b/mock/cpp_mock_scenarios/src/synchronized_action/synchronized_action.cpp @@ -44,11 +44,14 @@ class SynchronizedAction : public cpp_mock_scenarios::CppScenarioNode void onUpdate() override { + auto npc = api_.getEntity("npc"); + auto ego = api_.getEntity("ego"); + // SUCCESS if ( - api_.requestSynchronize("npc", "ego", ego_target, npc_target, 0, 0.5) && - api_.reachPosition("ego", ego_target, 1.0) && api_.reachPosition("npc", npc_target, 1.0) && - api_.getCurrentTwist("npc").linear.x < 0.5) { + npc->requestSynchronize("ego", ego_target, npc_target, 0, 0.5) && + ego->isNearbyPosition(ego_target, 1.0) && npc->isNearbyPosition(npc_target, 1.0) && + npc->getCurrentTwist().linear.x < 0.5) { stop(cpp_mock_scenarios::Result::SUCCESS); } @@ -65,22 +68,27 @@ class SynchronizedAction : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34976, 20, 0), getVehicleParameters()); - api_.setLinearVelocity("ego", 3); - api_.requestSpeedChange("ego", 3, true); + + auto ego = api_.getEntity("ego"); + ego->setLinearVelocity(3); + ego->requestSpeedChange(3, true); std::vector goal_poses; goal_poses.emplace_back( traffic_simulator::helper::constructCanonicalizedLaneletPose(34579, 20, 0)); - api_.requestAssignRoute("ego", goal_poses); + ego->requestAssignRoute(goal_poses); api_.spawn( "npc", traffic_simulator::helper::constructCanonicalizedLaneletPose(34576, 0, 0), getVehicleParameters()); + + auto npc = api_.getEntity("npc"); + std::vector npc_goal_poses; npc_goal_poses.emplace_back( traffic_simulator::helper::constructCanonicalizedLaneletPose(34564, 20, 0)); - api_.requestAssignRoute("npc", npc_goal_poses); - api_.setLinearVelocity("npc", 6); + npc->requestAssignRoute(npc_goal_poses); + npc->setLinearVelocity(6); } auto getSampleLaneletPose(const traffic_simulator::LaneletPose & lanelet_pose) diff --git a/mock/cpp_mock_scenarios/src/synchronized_action/synchronized_action_with_speed.cpp b/mock/cpp_mock_scenarios/src/synchronized_action/synchronized_action_with_speed.cpp index 30c62fadda5..009c9f01335 100644 --- a/mock/cpp_mock_scenarios/src/synchronized_action/synchronized_action_with_speed.cpp +++ b/mock/cpp_mock_scenarios/src/synchronized_action/synchronized_action_with_speed.cpp @@ -44,11 +44,14 @@ class SynchronizedActionWithSpeed : public cpp_mock_scenarios::CppScenarioNode void onUpdate() override { + auto npc = api_.getEntity("npc"); + auto ego = api_.getEntity("ego"); + // SUCCESS if ( - api_.requestSynchronize("npc", "ego", ego_target, npc_target, 2, 0.5) && - api_.reachPosition("ego", ego_target, 1.0) && api_.reachPosition("npc", npc_target, 1.0) && - api_.getCurrentTwist("npc").linear.x < 2.5) { + npc->requestSynchronize("ego", ego_target, npc_target, 2, 0.5) && + ego->isNearbyPosition(ego_target, 1.0) && npc->isNearbyPosition(npc_target, 1.0) && + npc->getCurrentTwist().linear.x < 2.5) { stop(cpp_mock_scenarios::Result::SUCCESS); } @@ -65,22 +68,27 @@ class SynchronizedActionWithSpeed : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34976, 20, 0), getVehicleParameters()); - api_.setLinearVelocity("ego", 3); - api_.requestSpeedChange("ego", 3, true); + + auto ego = api_.getEntity("ego"); + ego->setLinearVelocity(3); + ego->requestSpeedChange(3, true); std::vector goal_poses; goal_poses.emplace_back( traffic_simulator::helper::constructCanonicalizedLaneletPose(34579, 20, 0)); - api_.requestAssignRoute("ego", goal_poses); + ego->requestAssignRoute(goal_poses); api_.spawn( "npc", traffic_simulator::helper::constructCanonicalizedLaneletPose(34576, 0, 0), getVehicleParameters()); + + auto npc = api_.getEntity("npc"); + std::vector npc_goal_poses; npc_goal_poses.emplace_back( traffic_simulator::helper::constructCanonicalizedLaneletPose(34564, 20, 0)); - api_.requestAssignRoute("npc", npc_goal_poses); - api_.setLinearVelocity("npc", 6); + npc->requestAssignRoute(npc_goal_poses); + npc->setLinearVelocity(6); } auto getSampleLaneletPose(const traffic_simulator::LaneletPose & lanelet_pose) diff --git a/mock/cpp_mock_scenarios/src/traffic_simulation_demo.cpp b/mock/cpp_mock_scenarios/src/traffic_simulation_demo.cpp index ce6ed50fe33..bfd3f33e646 100644 --- a/mock/cpp_mock_scenarios/src/traffic_simulation_demo.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_simulation_demo.cpp @@ -42,43 +42,43 @@ class TrafficSimulationDemoScenario : public cpp_mock_scenarios::CppScenarioNode if (api_.getCurrentTime() >= 60) { stop(cpp_mock_scenarios::Result::SUCCESS); } - if (api_.getCurrentTime() >= 4 && api_.entityExists("tom")) { + if (api_.getCurrentTime() >= 4 && api_.isEntityExist("tom")) { api_.despawn("tom"); } - if (api_.getCurrentTime() >= 4 && api_.entityExists("obstacle")) { - api_.setEntityStatus( - "obstacle", traffic_simulator::helper::constructCanonicalizedLaneletPose(120545, 0.0, 0.0), - traffic_simulator::helper::constructActionStatus(10)); + if (api_.getCurrentTime() >= 4 && api_.isEntityExist("obstacle")) { + api_.getEntity("obstacle") + ->setStatus( + traffic_simulator::helper::constructCanonicalizedLaneletPose(120545, 0.0, 0.0), + traffic_simulator::helper::constructActionStatus(10)); } - if (api_.getCurrentTime() >= 6 && api_.entityExists("obstacle")) { + if (api_.getCurrentTime() >= 6 && api_.isEntityExist("obstacle")) { api_.despawn("obstacle"); } - if (api_.reachPosition( - "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34615, 10.0, 0.0), - 5)) { - api_.requestAcquirePosition( - "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(35026, 0.0, 0.0)); - if (api_.entityExists("npc2")) { - api_.requestSpeedChange("npc2", 13, true); + const auto ego_entity = api_.getEntity("ego"); + const auto npc2_entity = api_.getEntity("npc2"); + if (ego_entity->isNearbyPosition( + traffic_simulator::helper::constructCanonicalizedLaneletPose(34615, 10.0, 0.0), 5)) { + ego_entity->requestAcquirePosition( + traffic_simulator::helper::constructCanonicalizedLaneletPose(35026, 0.0, 0.0)); + if (api_.isEntityExist("npc2")) { + npc2_entity->requestSpeedChange(13, true); } } - if (api_.reachPosition( - "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34579, 0.0, 0.0), - 5)) { - api_.requestAcquirePosition( - "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0)); - if (api_.entityExists("npc2")) { - api_.requestSpeedChange("npc2", 3, true); + if (ego_entity->isNearbyPosition( + traffic_simulator::helper::constructCanonicalizedLaneletPose(34579, 0.0, 0.0), 5)) { + ego_entity->requestAcquirePosition( + traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0)); + if (api_.isEntityExist("npc2")) { + npc2_entity->requestSpeedChange(3, true); } } - if (api_.reachPosition( - "npc2", traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 0.0, 0.0), - 5)) { - api_.requestAcquirePosition( - "npc2", traffic_simulator::helper::constructCanonicalizedLaneletPose(34630, 0.0, 0.0)); - api_.requestSpeedChange("npc2", 13, true); + if (npc2_entity->isNearbyPosition( + traffic_simulator::helper::constructCanonicalizedLaneletPose(34513, 0.0, 0.0), 5)) { + npc2_entity->requestAcquirePosition( + traffic_simulator::helper::constructCanonicalizedLaneletPose(34630, 0.0, 0.0)); + npc2_entity->requestSpeedChange(13, true); } - if (api_.getCurrentTime() > 10.0 && api_.entityExists("bob")) { + if (api_.getCurrentTime() > 10.0 && api_.isEntityExist("bob")) { api_.despawn("bob"); } } @@ -90,53 +90,59 @@ class TrafficSimulationDemoScenario : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(120545, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 10); - api_.requestSpeedChange("ego", 8, true); - api_.requestAssignRoute( - "ego", std::vector{ - traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0), - traffic_simulator::helper::constructCanonicalizedLaneletPose(34690, 0.0, 0.0)}); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(10); + ego_entity->requestSpeedChange(8, true); + ego_entity->requestAssignRoute(std::vector{ + traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0), + traffic_simulator::helper::constructCanonicalizedLaneletPose(34690, 0.0, 0.0)}); api_.spawn( "tom", traffic_simulator::helper::constructPose(10, 3, 0, 0, 0, -1.57), getPedestrianParameters()); - api_.setEntityStatus( - "tom", "ego", traffic_simulator::helper::constructPose(10, 3, 0, 0, 0, -1.57), + api_.getEntity("tom")->setStatus( + ego_entity->getMapPose(), traffic_simulator::helper::constructPose(10, 3, 0, 0, 0, -1.57), traffic_simulator::helper::constructActionStatus()); - api_.requestWalkStraight("tom"); - api_.requestSpeedChange("tom", 3, true); + auto tom_entity = api_.getEntity("tom"); + tom_entity->requestWalkStraight(); + tom_entity->requestSpeedChange(3, true); api_.spawn( "bob", traffic_simulator::helper::constructCanonicalizedLaneletPose(34378, 0.0, 0.0), getPedestrianParameters()); - api_.setLinearVelocity("bob", 1.0); - api_.requestSpeedChange("bob", 1, true); + auto bob_entity = api_.getEntity("bob"); + bob_entity->setLinearVelocity(1.0); + bob_entity->requestSpeedChange(1, true); api_.spawn( "npc1", traffic_simulator::helper::constructCanonicalizedLaneletPose(34579, 20.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("npc1", 5.0); - api_.requestSpeedChange("npc1", 5, true); - api_.requestAcquirePosition( - "npc1", traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0)); + auto npc1_entity = api_.getEntity("npc1"); + npc1_entity->setLinearVelocity(5.0); + npc1_entity->requestSpeedChange(5, true); + npc1_entity->requestAcquirePosition( + traffic_simulator::helper::constructCanonicalizedLaneletPose(34675, 0.0, 0.0)); api_.spawn( "npc2", traffic_simulator::helper::constructCanonicalizedLaneletPose(34606, 20.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("npc2", 5); - api_.requestSpeedChange("npc2", 0, true); + auto npc2_entity = api_.getEntity("npc1"); + npc2_entity->setLinearVelocity(5); + npc2_entity->requestSpeedChange(0, true); api_.spawn( "npc3", traffic_simulator::helper::constructCanonicalizedLaneletPose(34468, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("npc3", 10); + auto npc3_entity = api_.getEntity("npc3"); + npc3_entity->setLinearVelocity(10); api_.spawn( "obstacle", traffic_simulator::helper::constructPose(10, 5, 0, 0, 0, -1.57), getMiscObjectParameters()); - api_.setEntityStatus( - "obstacle", "ego", traffic_simulator::helper::constructPose(10, 5, 0, 0, 0, -1.57), - traffic_simulator::helper::constructActionStatus()); + api_.getEntity("obstacle") + ->setStatus( + ego_entity->getMapPose(), traffic_simulator::helper::constructPose(10, 5, 0, 0, 0, -1.57), + traffic_simulator::helper::constructActionStatus()); api_.getConventionalTrafficLights()->setTrafficLightsColor( 34802, traffic_simulator::TrafficLight::Color::green); diff --git a/mock/cpp_mock_scenarios/src/traffic_sink/auto_sink_vehicle.cpp b/mock/cpp_mock_scenarios/src/traffic_sink/auto_sink_vehicle.cpp index 66743054cba..78c2e5829a2 100644 --- a/mock/cpp_mock_scenarios/src/traffic_sink/auto_sink_vehicle.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_sink/auto_sink_vehicle.cpp @@ -40,7 +40,7 @@ class AutoSinkVehicleScenario : public cpp_mock_scenarios::CppScenarioNode void onUpdate() override { if (api_.getCurrentTime() >= 0.1) { - if (api_.entityExists("car") and not api_.entityExists("bob")) { + if (api_.isEntityExist("car") and not api_.isEntityExist("bob")) { stop(cpp_mock_scenarios::Result::SUCCESS); } else { stop(cpp_mock_scenarios::Result::FAILURE); diff --git a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_delay.cpp b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_delay.cpp index 739e39b2c45..d1b8843b940 100644 --- a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_delay.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_delay.cpp @@ -75,12 +75,13 @@ class DefineTrafficSourceDelay : public cpp_mock_scenarios::CppScenarioNode stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } for (const auto & name : names) { - if (const auto entity = api_.getEntity(name)) { + const auto entity = api_.getEntity(name); + if (!entity->isInLanelet()) { + stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE + } else { const bool valid_vehicle_lanelet = - api_.isInLanelet(name, static_cast(34705), 50.0) || - api_.isInLanelet(name, static_cast(34696), 50.0); - - if (!entity->laneMatchingSucceed() || !valid_vehicle_lanelet || !isVehicle(name)) { + entity->isInLanelet(34705, 50.0) || entity->isInLanelet(34696, 50.0); + if (!valid_vehicle_lanelet || !isVehicle(name)) { stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } } @@ -94,8 +95,9 @@ class DefineTrafficSourceDelay : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34570, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0.0); - api_.requestSpeedChange("ego", 0.0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0.0); + ego_entity->requestSpeedChange(0.0, true); } bool traffic_source_added_ = false; diff --git a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_high_rate.cpp b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_high_rate.cpp index 7b5e818196c..143f22694b1 100644 --- a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_high_rate.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_high_rate.cpp @@ -52,12 +52,13 @@ class DefineTrafficSourceHighRate : public cpp_mock_scenarios::CppScenarioNode stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } for (const auto & name : names) { - if (const auto entity = api_.getEntity(name)) { + const auto entity = api_.getEntity(name); + if (!entity->isInLanelet()) { + stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE + } else { const bool valid_vehicle_lanelet = - api_.isInLanelet(name, static_cast(34705), 50.0) || - api_.isInLanelet(name, static_cast(34696), 50.0); - - if (!entity->laneMatchingSucceed() || !valid_vehicle_lanelet || !isVehicle(name)) { + entity->isInLanelet(34705, 50.0) || entity->isInLanelet(34696, 50.0); + if (!valid_vehicle_lanelet || !isVehicle(name)) { stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } } @@ -84,8 +85,9 @@ class DefineTrafficSourceHighRate : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34570, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0.0); - api_.requestSpeedChange("ego", 0.0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0.0); + ego_entity->requestSpeedChange(0.0, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_large.cpp b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_large.cpp index 31b1b884f3d..0925be43b88 100644 --- a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_large.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_large.cpp @@ -52,10 +52,10 @@ class DefineTrafficSourceLarge : public cpp_mock_scenarios::CppScenarioNode stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } for (const auto & name : names) { - if (const auto entity = api_.getEntity(name)) { - if (!entity->laneMatchingSucceed() || !isVehicle(name)) { - stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE - } + const auto entity = api_.getEntity(name); + + if (!entity->isInLanelet() || !isVehicle(name)) { + stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } } stop(cpp_mock_scenarios::Result::SUCCESS); @@ -80,8 +80,9 @@ class DefineTrafficSourceLarge : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34570, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0.0); - api_.requestSpeedChange("ego", 0.0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0.0); + ego_entity->requestSpeedChange(0.0, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_mixed.cpp b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_mixed.cpp index 8eb2927d3bd..e7ecfe42e25 100644 --- a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_mixed.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_mixed.cpp @@ -53,18 +53,19 @@ class DefineTrafficSourceMixed : public cpp_mock_scenarios::CppScenarioNode } unsigned int vehicle_count = 0u, pedestrian_count = 0u; for (const auto & name : names) { - if (const auto entity = api_.getEntity(name)) { + const auto entity = api_.getEntity(name); + if (!entity->isInLanelet()) { + stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE + } else { const bool valid_vehicle_lanelet = - api_.isInLanelet(name, static_cast(34705), 50.0) || - api_.isInLanelet(name, static_cast(34696), 50.0); - + entity->isInLanelet(34705, 50.0) || entity->isInLanelet(34696, 50.0); if (isVehicle(name)) { ++vehicle_count; } else if (isPedestrian(name)) { ++pedestrian_count; } - if (!entity->laneMatchingSucceed() || !valid_vehicle_lanelet) { + if (!valid_vehicle_lanelet) { stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } } @@ -95,8 +96,9 @@ class DefineTrafficSourceMixed : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34570, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0.0); - api_.requestSpeedChange("ego", 0.0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0.0); + ego_entity->requestSpeedChange(0.0, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_multiple.cpp b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_multiple.cpp index 685637fbac0..290f95d56ec 100644 --- a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_multiple.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_multiple.cpp @@ -53,14 +53,13 @@ class DefineTrafficSourceMultiple : public cpp_mock_scenarios::CppScenarioNode } unsigned int vehicle_count = 0u, pedestrian_count = 0u; for (const auto & name : names) { - if (const auto entity = api_.getEntity(name)) { + const auto entity = api_.getEntity(name); + if (!entity->isInLanelet()) { + stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE + } else { const bool valid_vehicle_lanelet = - api_.isInLanelet(name, static_cast(34705), 50.0) || - api_.isInLanelet(name, static_cast(34696), 50.0); - - const bool valid_pedestrian_lanelet = - api_.isInLanelet(name, static_cast(34385), 10.0); - + entity->isInLanelet(34705, 50.0) || entity->isInLanelet(34696, 50.0); + const bool valid_pedestrian_lanelet = entity->isInLanelet(34385, 10.0); if (isVehicle(name)) { ++vehicle_count; } else if (isPedestrian(name)) { @@ -68,12 +67,8 @@ class DefineTrafficSourceMultiple : public cpp_mock_scenarios::CppScenarioNode } if ( - // clang-format off - !entity->laneMatchingSucceed() || - (isVehicle(name) && !valid_vehicle_lanelet) || - (isPedestrian(name) && !valid_pedestrian_lanelet)) - // clang-format on - { + (isVehicle(name) && !valid_vehicle_lanelet) || + (isPedestrian(name) && !valid_pedestrian_lanelet)) { stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } } @@ -117,8 +112,9 @@ class DefineTrafficSourceMultiple : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34570, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0.0); - api_.requestSpeedChange("ego", 0.0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0.0); + ego_entity->requestSpeedChange(0.0, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_outside_lane.cpp b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_outside_lane.cpp index d7d924387a1..081af47ecca 100644 --- a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_outside_lane.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_outside_lane.cpp @@ -52,10 +52,10 @@ class DefineTrafficSourceOutsideLane : public cpp_mock_scenarios::CppScenarioNod stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } for (const auto & name : names) { - if (const auto entity = api_.getEntity(name)) { - if (entity->laneMatchingSucceed() || !isPedestrian(name)) { - stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE - } + const auto entity = api_.getEntity(name); + + if (entity->isInLanelet() || !isPedestrian(name)) { + stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } stop(cpp_mock_scenarios::Result::SUCCESS); } @@ -81,8 +81,9 @@ class DefineTrafficSourceOutsideLane : public cpp_mock_scenarios::CppScenarioNod api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34570, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0.0); - api_.requestSpeedChange("ego", 0.0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0.0); + ego_entity->requestSpeedChange(0.0, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_pedestrian.cpp b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_pedestrian.cpp index 7f05f3d80a9..c1694ec22f4 100644 --- a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_pedestrian.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_pedestrian.cpp @@ -52,11 +52,12 @@ class DefineTrafficSourcePedestrian : public cpp_mock_scenarios::CppScenarioNode stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } for (const auto & name : names) { - if (const auto entity = api_.getEntity(name)) { - const bool valid_pedestrian_lanelet = - api_.isInLanelet(name, static_cast(34385), 10.0); - - if (!entity->laneMatchingSucceed() || !valid_pedestrian_lanelet || !isPedestrian(name)) { + const auto entity = api_.getEntity(name); + if (!entity->isInLanelet()) { + stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE + } else { + const bool valid_pedestrian_lanelet = entity->isInLanelet(34385, 10.0); + if (!valid_pedestrian_lanelet || !isPedestrian(name)) { stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } } @@ -84,8 +85,9 @@ class DefineTrafficSourcePedestrian : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34570, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0.0); - api_.requestSpeedChange("ego", 0.0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0.0); + ego_entity->requestSpeedChange(0.0, true); } }; } // namespace cpp_mock_scenarios diff --git a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_vehicle.cpp b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_vehicle.cpp index 72c2e146c37..2e5740d19d9 100644 --- a/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_vehicle.cpp +++ b/mock/cpp_mock_scenarios/src/traffic_source/define_traffic_source_vehicle.cpp @@ -52,12 +52,13 @@ class DefineTrafficSourceVehicle : public cpp_mock_scenarios::CppScenarioNode stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } for (const auto & name : names) { - if (const auto entity = api_.getEntity(name)) { + const auto entity = api_.getEntity(name); + if (!entity->isInLanelet()) { + stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE + } else { const bool valid_vehicle_lanelet = - api_.isInLanelet(name, static_cast(34705), 50.0) || - api_.isInLanelet(name, static_cast(34696), 50.0); - - if (!entity->laneMatchingSucceed() || !valid_vehicle_lanelet || !isVehicle(name)) { + entity->isInLanelet(34705, 50.0) || entity->isInLanelet(34696, 50.0); + if (!valid_vehicle_lanelet || !isVehicle(name)) { stop(cpp_mock_scenarios::Result::FAILURE); // LCOV_EXCL_LINE } } @@ -84,8 +85,9 @@ class DefineTrafficSourceVehicle : public cpp_mock_scenarios::CppScenarioNode api_.spawn( "ego", traffic_simulator::helper::constructCanonicalizedLaneletPose(34570, 0.0, 0.0), getVehicleParameters()); - api_.setLinearVelocity("ego", 0.0); - api_.requestSpeedChange("ego", 0.0, true); + auto ego_entity = api_.getEntity("ego"); + ego_entity->setLinearVelocity(0.0); + ego_entity->requestSpeedChange(0.0, true); } }; } // namespace cpp_mock_scenarios diff --git a/openscenario/openscenario_experimental_catalog/CHANGELOG.rst b/openscenario/openscenario_experimental_catalog/CHANGELOG.rst index 177be56afb6..1fac03ccbb0 100644 --- a/openscenario/openscenario_experimental_catalog/CHANGELOG.rst +++ b/openscenario/openscenario_experimental_catalog/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package openscenario_experimental_catalog * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/openscenario/openscenario_experimental_catalog/package.xml b/openscenario/openscenario_experimental_catalog/package.xml index c53e2541c23..709a71a5604 100644 --- a/openscenario/openscenario_experimental_catalog/package.xml +++ b/openscenario/openscenario_experimental_catalog/package.xml @@ -2,7 +2,7 @@ openscenario_experimental_catalog - 7.4.7 + 9.0.3 TIER IV experimental catalogs for OpenSCENARIO Tatsuya Yamasaki Apache License 2.0 diff --git a/openscenario/openscenario_interpreter/CHANGELOG.rst b/openscenario/openscenario_interpreter/CHANGELOG.rst index 9a78f393758..ba74d28fb1b 100644 --- a/openscenario/openscenario_interpreter/CHANGELOG.rst +++ b/openscenario/openscenario_interpreter/CHANGELOG.rst @@ -32,6 +32,92 @@ Changelog for package openscenario_interpreter * add publish_empty_context parameter * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* Merge pull request `#1473 `_ from tier4/RJD-1057-remove-functions-forwarded-to-entity-base-middle + RJD-1057 (3/5): Remove non-API member functions: EntityManager’s member functions forwarded to EntityBase (1/2) +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator, simulator_core): improve overall +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* feat(simulator_core, api, entity_base, cpp_mock): move setEntityStatus to EntityBase, remove from api +* feat(api, simulator_core): emove getTimeHeadway from API, use directly in calc it directly in evaluateTimeHeadway +* Merge branch 'RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base +* feat(ego_entity, sumulator_core): remove asFieldOperatorApplication, develop getEgoEntity and dedicated methods in EgoEntity +* feat(entity_manager, simulator_core): remove activateOutOfRangeJob forwarding +* feat(entity_manager, behavior_tree, cpp_mock): remove getCurrentAction forwarding, set "waiting" as init action state in behavior_tree +* feat(entity_base, traffic_simulator, simulator_core): remove forwarding request*, move requestLaneChange to EntityBase +* feat(entity_base, traffic_simulator, simulator_core): remove forwarding setBehaviorParameter and setVelocityLimit +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* feat(cpp_mock, traffic_simulator): change getEntity, use getEntityOrNullptr +* Remove forwarding of getStandStillDuration in EntityManager and API +* Remove forwarding of getCurrentAccel in EntityManager and API +* Clean unused template +* Remove forwarding of getCurrentTwist in EntityManager and API +* Remove forwarding of getBehaviorParameter in EntityManager and API +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge pull request `#1472 `_ from tier4/ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose + HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(traffic_simulator): improve Configuration, traffic_rules, lanelet_wrapper +* feat(traffic_simulator, openscenario_interpreter, behavior_tree_plugin, simple_sensor_simulator): use pose:: from lanelet_wrapper instead of hdmap_utils methods +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp b/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp index cd04a85e0d4..24f5a8a1863 100644 --- a/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp +++ b/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp @@ -109,8 +109,8 @@ class SimulatorCore static auto makeNativeRelativeWorldPosition( const std::string & from_entity_name, const std::string & to_entity_name) { - if (const auto from_entity = core->getEntity(from_entity_name)) { - if (const auto to_entity = core->getEntity(to_entity_name)) { + if (const auto from_entity = core->getEntityOrNullptr(from_entity_name)) { + if (const auto to_entity = core->getEntityOrNullptr(to_entity_name)) { if ( const auto relative_pose = traffic_simulator::pose::relativePose( from_entity->getMapPose(), to_entity->getMapPose())) @@ -123,7 +123,7 @@ class SimulatorCore static auto makeNativeRelativeWorldPosition( const std::string & from_entity_name, const NativeWorldPosition & to_map_pose) { - if (const auto from_entity = core->getEntity(from_entity_name)) { + if (const auto from_entity = core->getEntityOrNullptr(from_entity_name)) { if ( const auto relative_pose = traffic_simulator::pose::relativePose(from_entity->getMapPose(), to_map_pose)) { @@ -136,7 +136,7 @@ class SimulatorCore static auto makeNativeRelativeWorldPosition( const NativeWorldPosition & from_map_pose, const std::string & to_entity_name) { - if (const auto to_entity = core->getEntity(to_entity_name)) { + if (const auto to_entity = core->getEntityOrNullptr(to_entity_name)) { if ( const auto relative_pose = traffic_simulator::pose::relativePose(from_map_pose, to_entity->getMapPose())) { @@ -151,7 +151,7 @@ class SimulatorCore const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined) -> traffic_simulator::LaneletPose { - if (const auto to_entity = core->getEntity(to_entity_name)) { + if (const auto to_entity = core->getEntityOrNullptr(to_entity_name)) { if (const auto to_lanelet_pose = to_entity->getCanonicalizedLaneletPose()) { return makeNativeRelativeLanePosition( from_entity_name, to_lanelet_pose.value(), routing_algorithm); @@ -165,7 +165,7 @@ class SimulatorCore const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined) -> traffic_simulator::LaneletPose { - if (const auto from_entity = core->getEntity(from_entity_name)) { + if (const auto from_entity = core->getEntityOrNullptr(from_entity_name)) { if (const auto from_lanelet_pose = from_entity->getCanonicalizedLaneletPose()) { return makeNativeRelativeLanePosition( from_lanelet_pose.value(), to_lanelet_pose, routing_algorithm); @@ -190,8 +190,8 @@ class SimulatorCore const std::string & from_entity_name, const std::string & to_entity_name, const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined) { - if (const auto from_entity = core->getEntity(from_entity_name)) { - if (const auto to_entity = core->getEntity(to_entity_name)) { + if (const auto from_entity = core->getEntityOrNullptr(from_entity_name)) { + if (const auto to_entity = core->getEntityOrNullptr(to_entity_name)) { if (const auto from_lanelet_pose = from_entity->getCanonicalizedLaneletPose()) { if (const auto to_lanelet_pose = to_entity->getCanonicalizedLaneletPose()) { return makeNativeBoundingBoxRelativeLanePosition( @@ -208,7 +208,7 @@ class SimulatorCore const std::string & from_entity_name, const NativeLanePosition & to_lanelet_pose, const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined) { - if (const auto from_entity = core->getEntity(from_entity_name)) { + if (const auto from_entity = core->getEntityOrNullptr(from_entity_name)) { if (const auto from_lanelet_pose = from_entity->getCanonicalizedLaneletPose()) { return makeNativeBoundingBoxRelativeLanePosition( from_lanelet_pose.value(), from_entity->getBoundingBox(), to_lanelet_pose, @@ -237,8 +237,8 @@ class SimulatorCore static auto makeNativeBoundingBoxRelativeWorldPosition( const std::string & from_entity_name, const std::string & to_entity_name) { - if (const auto from_entity = core->getEntity(from_entity_name)) { - if (const auto to_entity = core->getEntity(to_entity_name)) { + if (const auto from_entity = core->getEntityOrNullptr(from_entity_name)) { + if (const auto to_entity = core->getEntityOrNullptr(to_entity_name)) { if ( const auto relative_pose = traffic_simulator::pose::boundingBoxRelativePose( from_entity->getMapPose(), from_entity->getBoundingBox(), to_entity->getMapPose(), @@ -253,7 +253,7 @@ class SimulatorCore static auto makeNativeBoundingBoxRelativeWorldPosition( const std::string & from_entity_name, const NativeWorldPosition & to_map_pose) { - if (const auto from_entity = core->getEntity(from_entity_name)) { + if (const auto from_entity = core->getEntityOrNullptr(from_entity_name)) { if ( const auto relative_pose = traffic_simulator::pose::boundingBoxRelativePose( from_entity->getMapPose(), from_entity->getBoundingBox(), to_map_pose, @@ -293,8 +293,7 @@ class SimulatorCore template static auto applyAcquirePositionAction(const std::string & entity_ref, Ts &&... xs) { - core->requestClearRoute(entity_ref); - return core->requestAcquirePosition(entity_ref, std::forward(xs)...); + return core->getEntity(entity_ref)->requestAcquirePosition(std::forward(xs)...); } template @@ -307,8 +306,9 @@ class SimulatorCore static auto applyProfileAction( const EntityRef & entity_ref, const DynamicConstraints & dynamic_constraints) -> void { - return core->setBehaviorParameter(entity_ref, [&]() { - auto behavior_parameter = core->getBehaviorParameter(entity_ref); + auto entity = core->getEntity(entity_ref); + entity->setBehaviorParameter([&]() { + auto behavior_parameter = entity->getBehaviorParameter(); if (not std::isinf(dynamic_constraints.max_speed)) { behavior_parameter.dynamic_constraints.max_speed = dynamic_constraints.max_speed; @@ -342,12 +342,12 @@ class SimulatorCore static auto applyAssignControllerAction( const std::string & entity_ref, Controller && controller) -> void { - core->setVelocityLimit( - entity_ref, controller.properties.template get( - "maxSpeed", std::numeric_limits::max())); + auto entity = core->getEntity(entity_ref); + entity->setVelocityLimit(controller.properties.template get( + "maxSpeed", std::numeric_limits::max())); - core->setBehaviorParameter(entity_ref, [&]() { - auto message = core->getBehaviorParameter(entity_ref); + entity->setBehaviorParameter([&]() { + auto message = entity->getBehaviorParameter(); message.see_around = not controller.properties.template get("isBlind"); /// The default values written in https://github.com/tier4/scenario_simulator_v2/blob/master/simulation/traffic_simulator_msgs/msg/DynamicConstraints.msg message.dynamic_constraints.max_acceleration = @@ -445,10 +445,11 @@ class SimulatorCore return configuration; }()); - core->asFieldOperatorApplication(entity_ref) - .declare_parameter( - "allow_goal_modification", - controller.properties.template get("allowGoalModification")); + auto ego_entity = core->getEgoEntity(entity_ref); + + ego_entity->setParameter( + "allow_goal_modification", + controller.properties.template get("allowGoalModification")); for (const auto & module : [](std::string manual_modules_string) { @@ -468,8 +469,7 @@ class SimulatorCore }(controller.properties.template get( "featureIdentifiersRequiringExternalPermissionForAutonomousDecisions"))) { try { - core->asFieldOperatorApplication(entity_ref) - .requestAutoModeForCooperation(module, false); + ego_entity->requestAutoModeForCooperation(module, false); } catch (const Error & error) { throw Error( "featureIdentifiersRequiringExternalPermissionForAutonomousDecisions is not " @@ -483,8 +483,7 @@ class SimulatorCore template static auto applyAssignRouteAction(const std::string & entity_ref, Ts &&... xs) { - core->requestClearRoute(entity_ref); - return core->requestAssignRoute(entity_ref, std::forward(xs)...); + return core->getEntity(entity_ref)->requestAssignRoute(std::forward(xs)...); } template @@ -494,33 +493,48 @@ class SimulatorCore } template - static auto applyFollowTrajectoryAction(Ts &&... xs) + static auto applyFollowTrajectoryAction(const std::string & entity_ref, Ts &&... xs) { - return core->requestFollowTrajectory(std::forward(xs)...); + return core->getEntity(entity_ref) + ->requestFollowTrajectory(std::forward(xs)...); } template - static auto applyLaneChangeAction(Ts &&... xs) + static auto applyLaneChangeAction(const std::string & entity_ref, Ts &&... xs) { - return core->requestLaneChange(std::forward(xs)...); + return core->getEntity(entity_ref)->requestLaneChange(std::forward(xs)...); } template - static auto applySpeedAction(Ts &&... xs) + static auto applySpeedAction(const std::string & entity_ref, Ts &&... xs) + { + return core->getEntity(entity_ref)->requestSpeedChange(std::forward(xs)...); + } + + template < + typename PoseType, typename... Ts, + typename = std::enable_if_t< + std::is_same_v, geometry_msgs::msg::Pose> || + std::is_same_v, traffic_simulator::LaneletPose> || + std::is_same_v, traffic_simulator::CanonicalizedLaneletPose>>> + static auto applyTeleportAction(const std::string & name, const PoseType & pose, Ts &&... xs) { - return core->requestSpeedChange(std::forward(xs)...); + return core->getEntity(name)->setStatus(pose, std::forward(xs)...); } template - static auto applyTeleportAction(Ts &&... xs) + static auto applyTeleportAction( + const std::string & name, const std::string & reference_entity_name, Ts &&... xs) { - return core->setEntityStatus(std::forward(xs)...); + const auto reference_entity = core->getEntity(reference_entity_name); + return core->getEntity(name)->setStatus( + reference_entity->getMapPose(), std::forward(xs)...); } template - static auto applyWalkStraightAction(Ts &&... xs) + static auto applyWalkStraightAction(const std::string & entity_ref, Ts &&... xs) { - return core->requestWalkStraight(std::forward(xs)...); + return core->getEntity(entity_ref)->requestWalkStraight(std::forward(xs)...); } }; @@ -528,10 +542,9 @@ class SimulatorCore class ConditionEvaluation : protected CoordinateSystemConversion { protected: - template - static auto evaluateAcceleration(Ts &&... xs) + static auto evaluateAcceleration(const std::string & name) { - return core->getCurrentAccel(std::forward(xs)...).linear.x; + return core->getEntity(name)->getCurrentAccel().linear.x; } template @@ -544,8 +557,8 @@ class SimulatorCore const std::string & from_entity_name, const std::string & to_entity_name) // for RelativeDistanceCondition { - if (const auto from_entity = core->getEntity(from_entity_name)) { - if (const auto to_entity = core->getEntity(to_entity_name)) { + if (const auto from_entity = core->getEntityOrNullptr(from_entity_name)) { + if (const auto to_entity = core->getEntityOrNullptr(to_entity_name)) { if ( const auto distance = traffic_simulator::distance::boundingBoxDistance( from_entity->getMapPose(), from_entity->getBoundingBox(), to_entity->getMapPose(), @@ -589,8 +602,7 @@ class SimulatorCore } } - template - static auto evaluateSpeed(Ts &&... xs) + static auto evaluateSpeed(const std::string & name) { /* The function name "evaluateSpeed" stands for "evaluate SpeedCondition" @@ -600,25 +612,31 @@ class SimulatorCore please note that this function returns velocity, that is, a vector, rather than speed, contrary to the name "evaluateSpeed". */ - const auto linear = core->getCurrentTwist(std::forward(xs)...).linear; + const auto linear = core->getEntity(name)->getCurrentTwist().linear; return Eigen::Vector3d(linear.x, linear.y, linear.z); } - template - static auto evaluateStandStill(Ts &&... xs) + static auto evaluateStandStill(const std::string & name) { - return core->getStandStillDuration(std::forward(xs)...); + return core->getEntity(name)->getStandStillDuration(); } - template - static auto evaluateTimeHeadway(Ts &&... xs) + static auto evaluateTimeHeadway( + const std::string & from_entity_name, const std::string & to_entity_name) { - if (const auto result = core->getTimeHeadway(std::forward(xs)...); result) { - return result.value(); - } else { - using value_type = typename std::decay::type::value_type; - return std::numeric_limits::quiet_NaN(); + if (const auto from_entity = core->getEntityOrNullptr(from_entity_name)) { + if (const auto to_entity = core->getEntityOrNullptr(to_entity_name)) { + if (const auto relative_pose = traffic_simulator::pose::relativePose( + from_entity->getMapPose(), to_entity->getMapPose()); + relative_pose && relative_pose->position.x <= 0) { + const double time_headway = + (relative_pose->position.x * -1) / to_entity->getCurrentTwist().linear.x; + return std::isnan(time_headway) ? std::numeric_limits::infinity() + : time_headway; + } + } } + return std::numeric_limits::quiet_NaN(); } }; @@ -630,16 +648,12 @@ class SimulatorCore const std::string & entity_ref, const Performance & performance, const Properties & properties) { - core->activateOutOfRangeJob( - entity_ref, -performance.max_speed, +performance.max_speed, -performance.max_deceleration, - +performance.max_acceleration, properties.template get("minJerk", Double::lowest()), - properties.template get("maxJerk", Double::max())); - } - - template - static auto asFieldOperatorApplication(Ts &&... xs) -> decltype(auto) - { - return core->asFieldOperatorApplication(std::forward(xs)...); + core->getEntity(entity_ref) + ->activateOutOfRangeJob( + -performance.max_speed, +performance.max_speed, -performance.max_deceleration, + +performance.max_acceleration, + properties.template get("minJerk", Double::lowest()), + properties.template get("maxJerk", Double::max())); } static auto activateNonUserDefinedControllers() -> decltype(auto) @@ -648,16 +662,16 @@ class SimulatorCore } template - static auto evaluateCurrentState(Ts &&... xs) -> decltype(auto) + static auto evaluateCurrentState(const std::string & entity_ref, Ts &&... xs) -> decltype(auto) { - return core->getCurrentAction(std::forward(xs)...); + return core->getEntity(entity_ref)->getCurrentAction(std::forward(xs)...); } template static auto evaluateRelativeHeading( const EntityRef & entity_ref, const OSCLanePosition & osc_lane_position) { - if (const auto entity = core->getEntity(entity_ref)) { + if (const auto entity = core->getEntityOrNullptr(entity_ref)) { const auto from_map_pose = entity->getMapPose(); const auto to_map_pose = static_cast(osc_lane_position); if ( @@ -673,7 +687,7 @@ class SimulatorCore template static auto evaluateRelativeHeading(const EntityRef & entity_ref) { - if (const auto entity = core->getEntity(entity_ref)) { + if (const auto entity = core->getEntityOrNullptr(entity_ref)) { if (const auto canonicalized_lanelet_pose = entity->getCanonicalizedLaneletPose()) { return static_cast(std::abs( static_cast(canonicalized_lanelet_pose.value()).rpy.z)); @@ -682,11 +696,46 @@ class SimulatorCore return Double::nan(); } + static auto engage(const std::string & ego_ref) -> decltype(auto) + { + return core->getEgoEntity(ego_ref)->engage(); + } + + static auto isEngageable(const std::string & ego_ref) -> decltype(auto) + { + return core->getEgoEntity(ego_ref)->isEngageable(); + } + + static auto isEngaged(const std::string & ego_ref) -> decltype(auto) + { + return core->getEgoEntity(ego_ref)->isEngaged(); + } + template static auto sendCooperateCommand(Ts &&... xs) -> decltype(auto) { - return asFieldOperatorApplication(core->getEgoName()) - .sendCooperateCommand(std::forward(xs)...); + /// @note here ego name is not passed from OpenScenarioInterpreter, it uses first found + return core->getEgoEntity()->sendCooperateCommand(std::forward(xs)...); + } + + static auto getMinimumRiskManeuverBehaviorName(const std::string & ego_ref) -> decltype(auto) + { + return core->getEgoEntity(ego_ref)->getMinimumRiskManeuverBehaviorName(); + } + + static auto getMinimumRiskManeuverStateName(const std::string & ego_ref) -> decltype(auto) + { + return core->getEgoEntity(ego_ref)->getMinimumRiskManeuverStateName(); + } + + static auto getEmergencyStateName(const std::string & ego_ref) -> decltype(auto) + { + return core->getEgoEntity(ego_ref)->getEmergencyStateName(); + } + + static auto getTurnIndicatorsCommandName(const std::string & ego_ref) -> decltype(auto) + { + return core->getEgoEntity(ego_ref)->getTurnIndicatorsCommandName(); } // TrafficLights - Conventional and V2I diff --git a/openscenario/openscenario_interpreter/package.xml b/openscenario/openscenario_interpreter/package.xml index 9c3006ab4a8..c87bebd0df7 100644 --- a/openscenario/openscenario_interpreter/package.xml +++ b/openscenario/openscenario_interpreter/package.xml @@ -2,7 +2,7 @@ openscenario_interpreter - 7.4.7 + 9.0.3 OpenSCENARIO 1.2.0 interpreter package for Autoware Tatsuya Yamasaki Apache License 2.0 diff --git a/openscenario/openscenario_interpreter/src/openscenario_interpreter.cpp b/openscenario/openscenario_interpreter/src/openscenario_interpreter.cpp index 74fdf7ca028..c9caf9b221e 100644 --- a/openscenario/openscenario_interpreter/src/openscenario_interpreter.cpp +++ b/openscenario/openscenario_interpreter/src/openscenario_interpreter.cpp @@ -145,7 +145,7 @@ auto Interpreter::engage() const -> void scenario_object.template is() and scenario_object.template as().is_added and scenario_object.template as().object_controller.isAutoware()) { - asFieldOperatorApplication(name).engage(); + NonStandardOperation::engage(name); } } } @@ -159,7 +159,7 @@ auto Interpreter::engageable() const -> bool return not scenario_object.template is() or not scenario_object.template as().is_added or not scenario_object.template as().object_controller.isAutoware() or - asFieldOperatorApplication(name).engageable(); + NonStandardOperation::isEngageable(name); }); } @@ -172,7 +172,7 @@ auto Interpreter::engaged() const -> bool return not scenario_object.template is() or not scenario_object.template as().is_added or not scenario_object.template as().object_controller.isAutoware() or - asFieldOperatorApplication(name).engaged(); + NonStandardOperation::isEngaged(name); }); } diff --git a/openscenario/openscenario_interpreter/src/syntax/user_defined_value_condition.cpp b/openscenario/openscenario_interpreter/src/syntax/user_defined_value_condition.cpp index 93e2a126cfb..9486322b623 100644 --- a/openscenario/openscenario_interpreter/src/syntax/user_defined_value_condition.cpp +++ b/openscenario/openscenario_interpreter/src/syntax/user_defined_value_condition.cpp @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include #include #include @@ -129,38 +128,16 @@ UserDefinedValueCondition::UserDefinedValueCondition(const pugi::xml_node & node }), std::make_pair( "currentMinimumRiskManeuverState.behavior", - [result]() { - return make( - asFieldOperatorApplication(result.str(1)).minimum_risk_maneuver_behavior); - }), + [result]() { return make(getMinimumRiskManeuverBehaviorName(result.str(1))); }), std::make_pair( "currentMinimumRiskManeuverState.state", - [result]() { - return make( - asFieldOperatorApplication(result.str(1)).minimum_risk_maneuver_state); - }), + [result]() { return make(getMinimumRiskManeuverStateName(result.str(1))); }), std::make_pair( "currentEmergencyState", - [result]() { - return make( - asFieldOperatorApplication(result.str(1)).minimum_risk_maneuver_state); - }), + [result]() { return make(getEmergencyStateName(result.str(1))); }), std::make_pair( "currentTurnIndicatorsState", - [result]() { - switch (asFieldOperatorApplication(result.str(1)).getTurnIndicatorsCommand().command) { - case autoware_vehicle_msgs::msg::TurnIndicatorsCommand::DISABLE: - return make("DISABLE"); - case autoware_vehicle_msgs::msg::TurnIndicatorsCommand::ENABLE_LEFT: - return make("ENABLE_LEFT"); - case autoware_vehicle_msgs::msg::TurnIndicatorsCommand::ENABLE_RIGHT: - return make("ENABLE_RIGHT"); - case autoware_vehicle_msgs::msg::TurnIndicatorsCommand::NO_COMMAND: - return make("NO_COMMAND"); - default: - return make(); - } - }), + [result]() { return make(getTurnIndicatorsCommandName(result.str(1))); }), }; evaluate_value = dispatch.at(result.str(2)); // XXX catch } else if (std::regex_match(name, result, FunctionCallExpression::pattern())) { diff --git a/openscenario/openscenario_interpreter_example/CHANGELOG.rst b/openscenario/openscenario_interpreter_example/CHANGELOG.rst index 9ea19ba94cf..1bd6c901fc1 100644 --- a/openscenario/openscenario_interpreter_example/CHANGELOG.rst +++ b/openscenario/openscenario_interpreter_example/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package openscenario_interpreter_example * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/openscenario/openscenario_interpreter_example/package.xml b/openscenario/openscenario_interpreter_example/package.xml index cecd544df67..58762c83185 100644 --- a/openscenario/openscenario_interpreter_example/package.xml +++ b/openscenario/openscenario_interpreter_example/package.xml @@ -3,7 +3,7 @@ openscenario_interpreter_example - 7.4.7 + 9.0.3 Examples for some TIER IV OpenSCENARIO Interpreter's features Tatsuya Yamasaki Apache License 2.0 diff --git a/openscenario/openscenario_interpreter_msgs/CHANGELOG.rst b/openscenario/openscenario_interpreter_msgs/CHANGELOG.rst index ac9f3ba6620..22b68ba1a56 100644 --- a/openscenario/openscenario_interpreter_msgs/CHANGELOG.rst +++ b/openscenario/openscenario_interpreter_msgs/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package openscenario_interpreter_msgs * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/openscenario/openscenario_interpreter_msgs/package.xml b/openscenario/openscenario_interpreter_msgs/package.xml index 11ee020473c..63a938bfaac 100644 --- a/openscenario/openscenario_interpreter_msgs/package.xml +++ b/openscenario/openscenario_interpreter_msgs/package.xml @@ -2,7 +2,7 @@ openscenario_interpreter_msgs - 7.4.7 + 9.0.3 ROS message types for package openscenario_interpreter Yamasaki Tatsuya Apache License 2.0 diff --git a/openscenario/openscenario_preprocessor/CHANGELOG.rst b/openscenario/openscenario_preprocessor/CHANGELOG.rst index 719cf15cd9c..d63287c8891 100644 --- a/openscenario/openscenario_preprocessor/CHANGELOG.rst +++ b/openscenario/openscenario_preprocessor/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package openscenario_preprocessor * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/openscenario/openscenario_preprocessor/package.xml b/openscenario/openscenario_preprocessor/package.xml index 547605bd508..1233532a9a2 100644 --- a/openscenario/openscenario_preprocessor/package.xml +++ b/openscenario/openscenario_preprocessor/package.xml @@ -3,7 +3,7 @@ openscenario_preprocessor - 7.4.7 + 9.0.3 Example package for TIER IV OpenSCENARIO Interpreter Kotaro Yoshimoto Apache License 2.0 diff --git a/openscenario/openscenario_preprocessor_msgs/CHANGELOG.rst b/openscenario/openscenario_preprocessor_msgs/CHANGELOG.rst index 99ec1e7f60f..842a5f4ac3e 100644 --- a/openscenario/openscenario_preprocessor_msgs/CHANGELOG.rst +++ b/openscenario/openscenario_preprocessor_msgs/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package openscenario_preprocessor_msgs * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/openscenario/openscenario_preprocessor_msgs/package.xml b/openscenario/openscenario_preprocessor_msgs/package.xml index b9e101ae325..f3e455f3027 100644 --- a/openscenario/openscenario_preprocessor_msgs/package.xml +++ b/openscenario/openscenario_preprocessor_msgs/package.xml @@ -2,7 +2,7 @@ openscenario_preprocessor_msgs - 7.4.7 + 9.0.3 ROS message types for package openscenario_preprocessor Kotaro Yoshimoto Apache License 2.0 diff --git a/openscenario/openscenario_utility/CHANGELOG.rst b/openscenario/openscenario_utility/CHANGELOG.rst index 4748b10e56c..5c88a46eac0 100644 --- a/openscenario/openscenario_utility/CHANGELOG.rst +++ b/openscenario/openscenario_utility/CHANGELOG.rst @@ -24,6 +24,71 @@ Changelog for package openscenario_utility * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/openscenario/openscenario_utility/package.xml b/openscenario/openscenario_utility/package.xml index ff481f0df10..2b78e04d162 100644 --- a/openscenario/openscenario_utility/package.xml +++ b/openscenario/openscenario_utility/package.xml @@ -2,7 +2,7 @@ openscenario_utility - 7.4.7 + 9.0.3 Utility tools for ASAM OpenSCENARIO 1.2.0 Tatsuya Yamasaki Apache License 2.0 diff --git a/openscenario/openscenario_validator/CHANGELOG.rst b/openscenario/openscenario_validator/CHANGELOG.rst index 1ac922132bd..19025dd9b10 100644 --- a/openscenario/openscenario_validator/CHANGELOG.rst +++ b/openscenario/openscenario_validator/CHANGELOG.rst @@ -10,6 +10,71 @@ Changelog for package openscenario_validator * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/openscenario/openscenario_validator/package.xml b/openscenario/openscenario_validator/package.xml index 3d10a7647d7..980f59ca97d 100644 --- a/openscenario/openscenario_validator/package.xml +++ b/openscenario/openscenario_validator/package.xml @@ -2,7 +2,7 @@ openscenario_validator - 7.4.7 + 9.0.3 Validator for OpenSCENARIO 1.3 Kotaro Yoshimoto Apache License 2.0 diff --git a/rviz_plugins/openscenario_visualization/CHANGELOG.rst b/rviz_plugins/openscenario_visualization/CHANGELOG.rst index dbd9052b85d..b41ae9e1784 100644 --- a/rviz_plugins/openscenario_visualization/CHANGELOG.rst +++ b/rviz_plugins/openscenario_visualization/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package openscenario_visualization * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/rviz_plugins/openscenario_visualization/package.xml b/rviz_plugins/openscenario_visualization/package.xml index 36a541ae9af..61f70abad0d 100644 --- a/rviz_plugins/openscenario_visualization/package.xml +++ b/rviz_plugins/openscenario_visualization/package.xml @@ -2,7 +2,7 @@ openscenario_visualization - 7.4.7 + 9.0.3 Visualization tools for simulation results Masaya Kataoka Kyoichi Sugahara diff --git a/rviz_plugins/real_time_factor_control_rviz_plugin/CHANGELOG.rst b/rviz_plugins/real_time_factor_control_rviz_plugin/CHANGELOG.rst index c172007450e..28799322145 100644 --- a/rviz_plugins/real_time_factor_control_rviz_plugin/CHANGELOG.rst +++ b/rviz_plugins/real_time_factor_control_rviz_plugin/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package real_time_factor_control_rviz_plugin * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/rviz_plugins/real_time_factor_control_rviz_plugin/package.xml b/rviz_plugins/real_time_factor_control_rviz_plugin/package.xml index 8849a6a2cb0..fbe77094b82 100644 --- a/rviz_plugins/real_time_factor_control_rviz_plugin/package.xml +++ b/rviz_plugins/real_time_factor_control_rviz_plugin/package.xml @@ -2,7 +2,7 @@ real_time_factor_control_rviz_plugin - 7.4.7 + 9.0.3 Slider controlling real time factor value. Paweł Lech Apache License 2.0 diff --git a/scenario_simulator_v2/CHANGELOG.rst b/scenario_simulator_v2/CHANGELOG.rst index d0b5334b048..1f9d6587c93 100644 --- a/scenario_simulator_v2/CHANGELOG.rst +++ b/scenario_simulator_v2/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package scenario_simulator_v2 * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/scenario_simulator_v2/package.xml b/scenario_simulator_v2/package.xml index 959875c6c80..fce689384a1 100644 --- a/scenario_simulator_v2/package.xml +++ b/scenario_simulator_v2/package.xml @@ -2,7 +2,7 @@ scenario_simulator_v2 - 7.4.7 + 9.0.3 scenario testing framework for Autoware Masaya Kataoka Apache License 2.0 diff --git a/simulation/behavior_tree_plugin/CHANGELOG.rst b/simulation/behavior_tree_plugin/CHANGELOG.rst index 1ecc369ad0b..da20beca70b 100644 --- a/simulation/behavior_tree_plugin/CHANGELOG.rst +++ b/simulation/behavior_tree_plugin/CHANGELOG.rst @@ -21,6 +21,87 @@ Changelog for package behavior_tree_plugin * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* Merge pull request `#1473 `_ from tier4/RJD-1057-remove-functions-forwarded-to-entity-base-middle + RJD-1057 (3/5): Remove non-API member functions: EntityManager’s member functions forwarded to EntityBase (1/2) +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(behavior_tree_plugin): rename default value of current_action\_: "waiting" -> "none" + Co-authored-by: Masaya Kataoka +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator, simulator_core): improve overall +* ref(behavior_tree,traffic_simulator): improve code by basing on sonarcloud +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base +* feat(entity_manager, behavior_tree, cpp_mock): remove getCurrentAction forwarding, set "waiting" as init action state in behavior_tree +* feat(entity_base, traffic_simulator): rename laneMatchingSucceed to isInLanelet, remove forwarding +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge pull request `#1472 `_ from tier4/ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose + HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(traffic_simulator): refactor laneletAltitude and isAltitudeMatching after merge +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(traffic_simulator): apply sonar recommendations to lanelet_wrapper and utils +* feat(traffic_simulator, behavior_tree_plugin): use lanelet_wrapper::lanelet_map in parts previusly overlooked +* feat(traffic_simulator, behavior_tree_plugin): use lanelet_wrapper::pose in parts previously overlooked +* feat(traffic_simulator, openscenario_interpreter, behavior_tree_plugin, simple_sensor_simulator): use pose:: from lanelet_wrapper instead of hdmap_utils methods +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge pull request `#1507 `_ from tier4/RJD-1511/bug_fix diff --git a/simulation/behavior_tree_plugin/include/behavior_tree_plugin/transition_events/transition_event.hpp b/simulation/behavior_tree_plugin/include/behavior_tree_plugin/transition_events/transition_event.hpp index 04a38a1e3c9..e2c13e09a29 100644 --- a/simulation/behavior_tree_plugin/include/behavior_tree_plugin/transition_events/transition_event.hpp +++ b/simulation/behavior_tree_plugin/include/behavior_tree_plugin/transition_events/transition_event.hpp @@ -36,7 +36,7 @@ class TransitionEvent BT::TimePoint first_timestamp_; std::vector subscribers_; BT::TimestampType type_; - std::string current_action_; + std::string current_action_{"none"}; }; } // namespace behavior_tree_plugin diff --git a/simulation/behavior_tree_plugin/package.xml b/simulation/behavior_tree_plugin/package.xml index 9e9a0f6195b..f7a78122327 100644 --- a/simulation/behavior_tree_plugin/package.xml +++ b/simulation/behavior_tree_plugin/package.xml @@ -2,7 +2,7 @@ behavior_tree_plugin - 7.4.7 + 9.0.3 Behavior tree plugin for traffic_simulator masaya Apache 2.0 diff --git a/simulation/behavior_tree_plugin/src/pedestrian/follow_lane_action.cpp b/simulation/behavior_tree_plugin/src/pedestrian/follow_lane_action.cpp index 274fa95e52b..956bf05ff7b 100644 --- a/simulation/behavior_tree_plugin/src/pedestrian/follow_lane_action.cpp +++ b/simulation/behavior_tree_plugin/src/pedestrian/follow_lane_action.cpp @@ -39,7 +39,7 @@ BT::NodeStatus FollowLaneAction::tick() request != traffic_simulator::behavior::Request::FOLLOW_LANE) { return BT::NodeStatus::FAILURE; } - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { stopEntity(); return BT::NodeStatus::RUNNING; } diff --git a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_front_entity_action.cpp b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_front_entity_action.cpp index 04fa72e7249..1ee5ca6245a 100644 --- a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_front_entity_action.cpp +++ b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_front_entity_action.cpp @@ -54,7 +54,7 @@ FollowFrontEntityAction::calculateObstacle(const traffic_simulator_msgs::msg::Wa const traffic_simulator_msgs::msg::WaypointsArray FollowFrontEntityAction::calculateWaypoints() { - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { THROW_SIMULATION_ERROR("failed to assign lane"); } if (canonicalized_entity_status->getTwist().linear.x >= 0) { diff --git a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_lane_action.cpp b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_lane_action.cpp index a511567c148..c5b96759aae 100644 --- a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_lane_action.cpp +++ b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/follow_lane_action.cpp @@ -41,7 +41,7 @@ const std::optional FollowLaneAction::cal const traffic_simulator_msgs::msg::WaypointsArray FollowLaneAction::calculateWaypoints() { - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { THROW_SIMULATION_ERROR("failed to assign lane"); } if (canonicalized_entity_status->getTwist().linear.x >= 0) { @@ -76,7 +76,7 @@ BT::NodeStatus FollowLaneAction::tick() request != traffic_simulator::behavior::Request::FOLLOW_LANE) { return BT::NodeStatus::FAILURE; } - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { stopEntity(); const auto waypoints = traffic_simulator_msgs::msg::WaypointsArray{}; setOutput("waypoints", waypoints); diff --git a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/move_backward_action.cpp b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/move_backward_action.cpp index e5f0b3dbd27..6ba2443022b 100644 --- a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/move_backward_action.cpp +++ b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/move_backward_action.cpp @@ -60,7 +60,7 @@ BT::NodeStatus MoveBackwardAction::tick() request != traffic_simulator::behavior::Request::FOLLOW_LANE) { return BT::NodeStatus::FAILURE; } - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { return BT::NodeStatus::FAILURE; } const auto waypoints = calculateWaypoints(); diff --git a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_crossing_entity_action.cpp b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_crossing_entity_action.cpp index 6198dd54d67..9b58e0630b1 100644 --- a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_crossing_entity_action.cpp +++ b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_crossing_entity_action.cpp @@ -56,7 +56,7 @@ StopAtCrossingEntityAction::calculateObstacle(const traffic_simulator_msgs::msg: const traffic_simulator_msgs::msg::WaypointsArray StopAtCrossingEntityAction::calculateWaypoints() { - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { THROW_SIMULATION_ERROR("failed to assign lane"); } if (canonicalized_entity_status->getTwist().linear.x >= 0) { @@ -94,7 +94,7 @@ BT::NodeStatus StopAtCrossingEntityAction::tick() in_stop_sequence_ = false; return BT::NodeStatus::FAILURE; } - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { in_stop_sequence_ = false; return BT::NodeStatus::FAILURE; } diff --git a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_stop_line_action.cpp b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_stop_line_action.cpp index b405bca13eb..c18731f1fcd 100644 --- a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_stop_line_action.cpp +++ b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_stop_line_action.cpp @@ -55,7 +55,7 @@ const std::optional StopAtStopLineAction: const traffic_simulator_msgs::msg::WaypointsArray StopAtStopLineAction::calculateWaypoints() { - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { THROW_SIMULATION_ERROR("failed to assign lane"); } if (canonicalized_entity_status->getTwist().linear.x >= 0) { diff --git a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_traffic_light_action.cpp b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_traffic_light_action.cpp index 198a4b784bf..db2777d1e7a 100644 --- a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_traffic_light_action.cpp +++ b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/stop_at_traffic_light_action.cpp @@ -54,7 +54,7 @@ StopAtTrafficLightAction::calculateObstacle(const traffic_simulator_msgs::msg::W const traffic_simulator_msgs::msg::WaypointsArray StopAtTrafficLightAction::calculateWaypoints() { - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { THROW_SIMULATION_ERROR("failed to assign lane"); } if (canonicalized_entity_status->getTwist().linear.x >= 0) { @@ -94,7 +94,7 @@ BT::NodeStatus StopAtTrafficLightAction::tick() request != traffic_simulator::behavior::Request::FOLLOW_LANE) { return BT::NodeStatus::FAILURE; } - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { return BT::NodeStatus::FAILURE; } if (!behavior_parameter.see_around) { diff --git a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/yield_action.cpp b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/yield_action.cpp index 2a331786a1c..0b903c422bc 100644 --- a/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/yield_action.cpp +++ b/simulation/behavior_tree_plugin/src/vehicle/follow_lane_sequence/yield_action.cpp @@ -54,7 +54,7 @@ const std::optional YieldAction::calculat const traffic_simulator_msgs::msg::WaypointsArray YieldAction::calculateWaypoints() { - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { THROW_SIMULATION_ERROR("failed to assign lane"); } if (canonicalized_entity_status->getTwist().linear.x >= 0) { @@ -98,7 +98,7 @@ BT::NodeStatus YieldAction::tick() if (!behavior_parameter.see_around) { return BT::NodeStatus::FAILURE; } - if (!canonicalized_entity_status->laneMatchingSucceed()) { + if (!canonicalized_entity_status->isInLanelet()) { return BT::NodeStatus::FAILURE; } if (!traffic_simulator::route::isNeedToRightOfWay( diff --git a/simulation/do_nothing_plugin/CHANGELOG.rst b/simulation/do_nothing_plugin/CHANGELOG.rst index a0ea791a672..0eb82686fd6 100644 --- a/simulation/do_nothing_plugin/CHANGELOG.rst +++ b/simulation/do_nothing_plugin/CHANGELOG.rst @@ -21,6 +21,75 @@ Changelog for package do_nothing_plugin * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge pull request `#1472 `_ from tier4/ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose + HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* feat(traffic_simulator, openscenario_interpreter, behavior_tree_plugin, simple_sensor_simulator): use pose:: from lanelet_wrapper instead of hdmap_utils methods +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/simulation/do_nothing_plugin/package.xml b/simulation/do_nothing_plugin/package.xml index 4e16f77445a..a0a6297d7e8 100644 --- a/simulation/do_nothing_plugin/package.xml +++ b/simulation/do_nothing_plugin/package.xml @@ -2,7 +2,7 @@ do_nothing_plugin - 7.4.7 + 9.0.3 Behavior plugin for do nothing Masaya Kataoka Apache 2.0 diff --git a/simulation/simple_sensor_simulator/CHANGELOG.rst b/simulation/simple_sensor_simulator/CHANGELOG.rst index f43a4837a7a..58299f2eb47 100644 --- a/simulation/simple_sensor_simulator/CHANGELOG.rst +++ b/simulation/simple_sensor_simulator/CHANGELOG.rst @@ -21,6 +21,86 @@ Changelog for package simple_sensor_simulator * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge pull request `#1509 `_ from tier4/RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* chore: fix a mistake during solving the merge conflict +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Revert "Port calculating ego pitch angle from lanelets" + This reverts commit b517bf177e824104262f17c805de04105bf3b338. +* Port calculating ego pitch angle from lanelets +* Remove not needed comment +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Change sign of slope acceleration and check canonicalization status in acceleration calculation +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge pull request `#1516 `_ from tier4/feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* feat(simple_sensor_simulator): use vel state for acc state calculation +* Contributors: Kotaro Yoshimoto, kosuke55 + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base +* feat(entity_base, traffic_simulator): rename laneMatchingSucceed to isInLanelet, remove forwarding +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge pull request `#1472 `_ from tier4/ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose + HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* fix(traffic_simulator, simple_sensor_simulator): fix after merge, apply sonar recommendations +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* feat(traffic_simulator, openscenario_interpreter, behavior_tree_plugin, simple_sensor_simulator): use pose:: from lanelet_wrapper instead of hdmap_utils methods +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/simulation/simple_sensor_simulator/include/simple_sensor_simulator/vehicle_simulation/vehicle_model/sim_model_delay_steer_vel.hpp b/simulation/simple_sensor_simulator/include/simple_sensor_simulator/vehicle_simulation/vehicle_model/sim_model_delay_steer_vel.hpp index f3835ac554a..883913390f0 100644 --- a/simulation/simple_sensor_simulator/include/simple_sensor_simulator/vehicle_simulation/vehicle_model/sim_model_delay_steer_vel.hpp +++ b/simulation/simple_sensor_simulator/include/simple_sensor_simulator/vehicle_simulation/vehicle_model/sim_model_delay_steer_vel.hpp @@ -72,7 +72,6 @@ class SimModelDelaySteerVel : public SimModelInterface const double steer_lim_; //!< @brief steering limit [rad] const double steer_rate_lim_; //!< @brief steering angular velocity limit [rad/s] const double wheelbase_; //!< @brief vehicle wheelbase length [m] - double prev_vx_ = 0.0; double current_ax_ = 0.0; std::deque vx_input_queue_; //!< @brief buffer for velocity command diff --git a/simulation/simple_sensor_simulator/package.xml b/simulation/simple_sensor_simulator/package.xml index 5d1fa752b74..24e05fe718d 100644 --- a/simulation/simple_sensor_simulator/package.xml +++ b/simulation/simple_sensor_simulator/package.xml @@ -1,7 +1,7 @@ simple_sensor_simulator - 7.4.7 + 9.0.3 simple_sensor_simulator package masaya kataoka diff --git a/simulation/simple_sensor_simulator/src/vehicle_simulation/ego_entity_simulation.cpp b/simulation/simple_sensor_simulator/src/vehicle_simulation/ego_entity_simulation.cpp index fe891fa3336..8616711b800 100644 --- a/simulation/simple_sensor_simulator/src/vehicle_simulation/ego_entity_simulation.cpp +++ b/simulation/simple_sensor_simulator/src/vehicle_simulation/ego_entity_simulation.cpp @@ -317,26 +317,7 @@ void EgoEntitySimulation::update( case VehicleModelType::DELAY_STEER_MAP_ACC_GEARED: case VehicleModelType::IDEAL_STEER_ACC: case VehicleModelType::IDEAL_STEER_ACC_GEARED: - /* - TODO FIX THIS!!! - - THIS IS MAYBE INCORRECT. - - SHOULD BE - gear_sign * acceleration + acceleration_by_slope - OR - signed_acceleration + acceleration_by_slope - - Currently, acceleration is obtained as an unsigned value - (`acceleration`) and a signed value (`gear_sign`), but this is for - historical reasons and there is no longer any reason to do so. - - Therefore, when resolving this TODO comment, the assignee should - remove `gear_sign` from the tuple returned by - `AutowareUniverse::getVehicleCommand`, and at the same time change - `acceleration` to a signed value. - */ - input(0) = gear_sign * (acceleration + acceleration_by_slope); + input(0) = gear_sign * acceleration + acceleration_by_slope; input(1) = tire_angle; break; @@ -364,7 +345,7 @@ void EgoEntitySimulation::update( auto EgoEntitySimulation::calculateAccelerationBySlope() const -> double { - if (consider_acceleration_by_road_slope_) { + if (consider_acceleration_by_road_slope_ && status_.isInLanelet()) { constexpr double gravity_acceleration = -9.81; /// @todo why there is a need to recalculate orientation using getLaneletPose? /// status_.getMapPose().orientation already contains the orientation diff --git a/simulation/simple_sensor_simulator/src/vehicle_simulation/vehicle_model/sim_model_delay_steer_vel.cpp b/simulation/simple_sensor_simulator/src/vehicle_simulation/vehicle_model/sim_model_delay_steer_vel.cpp index 6f32c30693a..9d887029cea 100644 --- a/simulation/simple_sensor_simulator/src/vehicle_simulation/vehicle_model/sim_model_delay_steer_vel.cpp +++ b/simulation/simple_sensor_simulator/src/vehicle_simulation/vehicle_model/sim_model_delay_steer_vel.cpp @@ -57,9 +57,9 @@ void SimModelDelaySteerVel::update(const double & dt) delayed_input(IDX_U::STEER_DES) = steer_input_queue_.front(); steer_input_queue_.pop_front(); // do not use deadzone_delta_steer (Steer IF does not exist in this model) + const double prev_vx = state_(IDX::VX); updateRungeKutta(dt, delayed_input); - current_ax_ = (input_(IDX_U::VX_DES) - prev_vx_) / dt; - prev_vx_ = input_(IDX_U::VX_DES); + current_ax_ = (state_(IDX::VX) - prev_vx) / dt; } void SimModelDelaySteerVel::initializeInputQueue(const double & dt) diff --git a/simulation/simulation_interface/CHANGELOG.rst b/simulation/simulation_interface/CHANGELOG.rst index 2a04b91a132..fd49e050e38 100644 --- a/simulation/simulation_interface/CHANGELOG.rst +++ b/simulation/simulation_interface/CHANGELOG.rst @@ -21,6 +21,74 @@ Changelog for package simulation_interface * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator, simulator_interface): revert format unexpected changes +* ref(traffic_simulator, cpp_mock_scenarios): rename isInPosition to isNerbyPosition +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/simulation/simulation_interface/package.xml b/simulation/simulation_interface/package.xml index 081ed327775..91b1648eac9 100644 --- a/simulation/simulation_interface/package.xml +++ b/simulation/simulation_interface/package.xml @@ -2,7 +2,7 @@ simulation_interface - 7.4.7 + 9.0.3 packages to define interface between simulator and scenario interpreter Masaya Kataoka Apache License 2.0 diff --git a/simulation/traffic_simulator/CHANGELOG.rst b/simulation/traffic_simulator/CHANGELOG.rst index a9dc6b7d21d..315fe8f22d0 100644 --- a/simulation/traffic_simulator/CHANGELOG.rst +++ b/simulation/traffic_simulator/CHANGELOG.rst @@ -21,6 +21,210 @@ Changelog for package traffic_simulator * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge pull request `#1509 `_ from tier4/RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* chore: fix a mistake during solving the merge conflict +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Remove noexcept +* Change sign of slope acceleration and check canonicalization status in acceleration calculation +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* Merge pull request `#1473 `_ from tier4/RJD-1057-remove-functions-forwarded-to-entity-base-middle + RJD-1057 (3/5): Remove non-API member functions: EntityManager’s member functions forwarded to EntityBase (1/2) +* remove double canonicalization +* merge 8.0.2 +* remove recursive calls after merge +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Revert "move functions from EgoEntity to FieldOperatorApplication" + This reverts commit 8d90c0e2c2f66795f299859bfa675ef2f11abdd3. +* Revert "remove function shadowing" + This reverts commit 82d6085784271ea59d8fa69f359e0437543e9d57. +* remove function shadowing +* move functions from EgoEntity to FieldOperatorApplication +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator, simulator_interface): revert format unexpected changes +* ref(traffic_simulator, cpp_mock_scenarios): rename isInPosition to isNerbyPosition +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator): rename isEntitySpawned to isEntityExist +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator): tiny formatting change +* ref(traffic_simulator): improve requestClearRoute call for ego_entity +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator): add const to LongitudinalSpeedPlanner::isTargetSpeedReached arguments +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator): improve requestLaneChange, getEgoName +* ref(traffic_simulator, simulator_core): improve overall +* ref(cpp_mock_scenarios): improve overall +* ref(behavior_tree,traffic_simulator): improve code by basing on sonarcloud +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* feat(entity_base, entity_status): improve ::setStatus +* Fix concealer local address returning +* feat(simulator_core, api, entity_base, cpp_mock): move setEntityStatus to EntityBase, remove from api +* feat(api, simulator_core): emove getTimeHeadway from API, use directly in calc it directly in evaluateTimeHeadway +* Merge branch 'RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base +* feat(ego_entity, sumulator_core): remove asFieldOperatorApplication, develop getEgoEntity and dedicated methods in EgoEntity +* feat(api, entity_manager, cpp_mock): rename entityExist to isEntitySpawned, move checkCollision directly to API +* feat(entity_manager, simulator_core): remove activateOutOfRangeJob forwarding +* feat(entity_manager, behavior_tree, cpp_mock): remove getCurrentAction forwarding, set "waiting" as init action state in behavior_tree +* feat(entity_base, traffic_simulator, simulator_core): remove forwarding request*, move requestLaneChange to EntityBase +* feat(entity_base, traffic_simulator, simulator_core): remove forwarding setBehaviorParameter and setVelocityLimit +* feat(entity_base, traffic_simulator): move isStopping to EntityBase, develop templated is() in EntityBase and use it, rename isEgoSpawned to isAnyEgoSpawned, refactor +* feat(entity_base, traffic_simulator): remove forwarding setters to EntityBase, also some getters, left setVelocityLimit and setBehaviorParameter +* feat(entity_base, traffic_simulator): rename laneMatchingSucceed to isInLanelet, remove forwarding +* feat(entity_base, traffic_simulator): move reachPosition as isInPosition to EntityBase, remove forwarding +* feat(entity_base, traffic_simulator, cpp_mock): move isInLanelet to EntityBase, remove forwarding +* Merge remote-tracking branch 'origin/RJD-1056-remove-npc-logic-started' into RJD-1057-remove-functions-forwarded-to-entity-base +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* feat(cpp_mock, traffic_simulator): change getEntity, use getEntityOrNullptr +* Remove forwarding of getStandStillDuration in EntityManager and API +* Remove forwarding of get2DPolygon in EntityManager +* Remove forwarding of getBoundingBox in EntityManager and API +* Remove forwarding of getLinearJerk in EntityManager and API +* Remove forwarding of getCurrentAccel in EntityManager and API +* Remove forwarding of getCurrentTwist in EntityManager and API +* Remove forwarding of getBehaviorParameter in EntityManager and API +* Remove forwarding of getEntityStatusBeforeUpdate in EntityManager and API +* Add const +* Remove forwarding of getEntityStatus in EntityManager and API +* Forward getEntityOrThrow from API to EntityManager +* Remove forwarding of getEntityType in EntityManager +* Add getEntityOrThrow function to mimic forwarding functionality where exceptions were thrown +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge pull request `#1472 `_ from tier4/ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose + HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose +* Add reader functions to cache classes to mitigate direct data members access and having to lock the mutex in different places +* Revert "Refactor lanelet_wrapper cache classes: make top level public member functions acquire resources and make non-public member functions NOT thread safe" + This reverts commit 41f9dd1e226ea827444aed1d01c207d10b9b61fa. +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Remove unnecessary comments +* Adjust comments to use "/// @note" convention +* Refactor lanelet_wrapper cache classes: make top level public member functions acquire resources and make non-public member functions NOT thread safe + This change is a proposal of improving thread safety - now the whole bodies of public member functions can be executed at once without the risk of resources being modified in the middle of the function execution +* Clean cache code - move cache classes member variables to the end of class declaration +* Move lanelet_wrapper cache classes member values and some functions to private +* Add comment explaining parameters +* Rename variable to match function name change +* Rename `borderlinePoses` -> `noNextLaneletPoses` +* Add comment explaining what `lanelet_map::borderlinePoses` does +* Perform calculations at compile time in lanelet_wrapper::pose::toLaneletPose +* Fix lanelet pose matching calculation bug +* fix(lanelet_wrapper): fix toLaneletPose +* doc(lanelet_wrapper): improve lanelet_wrappe::pose::canonicalizeLaneletPose description +* fix(lanelet_wrapper): fix pose toLaneletPose typo ";" +* fix(lanelet_wrapper): fix typo centerline +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(lanelet_wrapper): add toLaneletPose yaw_threshold description +* ref(traffic_simulator): add comments to lanelet_wrapper::pose, reduce the number of intermediate variables +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Update simulation/traffic_simulator/src/traffic/traffic_controller.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_map.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/pose.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/pose.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_loader.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_wrapper.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_loader.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_loader.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_loader.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_loader.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_loader.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_loader.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/lanelet_loader.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/utils/pose.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/utils/pose.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/pose.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/lanelet_wrapper/pose.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/src/utils/pose.cpp + Co-authored-by: Masaya Kataoka +* Update simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/lanelet_wrapper.hpp + Co-authored-by: Masaya Kataoka +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(traffic_simulator): apply solar changes +* ref(traffic_simulator): apply sonar required changes +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(traffic_simulator): refactor laneletAltitude and isAltitudeMatching after merge +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* fix(traffic_simulator): fix follow_trajectory_action issue, add orientation to distance calc, remove toCanonicalizedLaneletPose(point...) because it can cause a another issues +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(traffic_simulator): improve hdmaputils::countLaneChanges +* fix(traffic_simulator): adapt lanelet-wapper::pose to changes in hdmap_utils +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* fix(traffic_simulator): fix lanelet_wrapper::pose::alternativeLaneletPoses +* fix(traffic_simulator, simple_sensor_simulator): fix after merge, apply sonar recommendations +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(traffic_simulator): apply sonar recommendations to lanelet_wrapper and utils +* feat(traffic_simulator): separate lanelet_loader, provide const TrafficRulesWithRoutingGraph +* ref(traffic_simulator): improve Configuration, traffic_rules, lanelet_wrapper +* fix(traffic_simulator): fix hdmap_utils tests +* fix(traffic_simulator): add EOF to traffic_rules +* fix(traffic_simmulator): fix spell check +* feat(traffic_simulator): use lanelet_wrapper::lanelet_map in the rest of hdmap_utils, adapt hdmap_utils test to lanelet_wrapper::lanelet_map +* feat(traffic_simulator, behavior_tree_plugin): use lanelet_wrapper::lanelet_map in parts previusly overlooked +* feat(traffic_simulator): use lanelet_wrapper::pose in the rest of hdmap_utils, adapt hdmap_utils test to lanelet_wrapper::pose +* feat(traffic_simulator, behavior_tree_plugin): use lanelet_wrapper::pose in parts previously overlooked +* ref(traffic_simulator): remove unused parts lanelet_wrapper +* feat(traffic_simulator, random_test_runner): adapt tests for using pose:: from lanelet_wrapper +* feat(traffic_simulator, openscenario_interpreter, behavior_tree_plugin, simple_sensor_simulator): use pose:: from lanelet_wrapper instead of hdmap_utils methods +* feat(traffic_simulator): add lanelet_wrapper as a replacement for hdmap_utils, at this point mainly for pose calculations +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/simulation/traffic_simulator/include/traffic_simulator/api/api.hpp b/simulation/traffic_simulator/include/traffic_simulator/api/api.hpp index aae891f9239..74b492a4dfd 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/api/api.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/api/api.hpp @@ -139,7 +139,7 @@ class API { auto register_to_entity_manager = [&]() { if (behavior == VehicleBehavior::autoware()) { - return entity_manager_ptr_->entityExists(name) or + return entity_manager_ptr_->isEntityExist(name) or entity_manager_ptr_->spawnEntity( name, pose, parameters, getCurrentTime(), configuration, node_parameters_); } else { @@ -151,7 +151,7 @@ class API auto register_to_environment_simulator = [&]() { if (configuration.standalone_mode) { return true; - } else if (const auto entity = entity_manager_ptr_->getEntity(name); not entity) { + } else if (const auto entity = entity_manager_ptr_->getEntityOrNullptr(name); not entity) { throw common::SemanticError( "Entity ", name, " can not be registered in simulator - it has not been spawned yet."); } else { @@ -185,7 +185,7 @@ class API auto register_to_environment_simulator = [&]() { if (configuration.standalone_mode) { return true; - } else if (const auto entity = entity_manager_ptr_->getEntity(name); not entity) { + } else if (const auto entity = entity_manager_ptr_->getEntityOrNullptr(name); not entity) { throw common::SemanticError( "Entity ", name, " can not be registered in simulator - it has not been spawned yet."); } else { @@ -215,7 +215,7 @@ class API auto register_to_environment_simulator = [&]() { if (configuration.standalone_mode) { return true; - } else if (const auto entity = entity_manager_ptr_->getEntity(name); not entity) { + } else if (const auto entity = entity_manager_ptr_->getEntityOrNullptr(name); not entity) { throw common::SemanticError( "Entity ", name, " can not be registered in simulator - it has not been spawned yet."); } else { @@ -234,34 +234,12 @@ class API bool despawn(const std::string & name); bool despawnEntities(); - auto setEntityStatus(const std::string & name, const EntityStatus & status) -> void; + bool checkCollision( + const std::string & first_entity_name, const std::string & second_entity_name); + auto respawn( const std::string & name, const geometry_msgs::msg::PoseWithCovarianceStamped & new_pose, const geometry_msgs::msg::PoseStamped & goal_pose) -> void; - auto setEntityStatus( - const std::string & name, const geometry_msgs::msg::Pose & map_pose, - const traffic_simulator_msgs::msg::ActionStatus & action_status = - helper::constructActionStatus()) -> void; - auto setEntityStatus( - const std::string & name, const LaneletPose & lanelet_pose, - const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void; - auto setEntityStatus( - const std::string & name, const CanonicalizedLaneletPose & canonicalized_lanelet_pose, - const traffic_simulator_msgs::msg::ActionStatus & action_status = - helper::constructActionStatus()) -> void; - auto setEntityStatus( - const std::string & name, const std::string & reference_entity_name, - const geometry_msgs::msg::Pose & relative_pose, - const traffic_simulator_msgs::msg::ActionStatus & action_status = - helper::constructActionStatus()) -> void; - auto setEntityStatus( - const std::string & name, const std::string & reference_entity_name, - const geometry_msgs::msg::Point & relative_position, - const geometry_msgs::msg::Vector3 & relative_rpy, - const traffic_simulator_msgs::msg::ActionStatus & action_status = - helper::constructActionStatus()) -> void; - - std::optional getTimeHeadway(const std::string & from, const std::string & to); auto attachImuSensor( const std::string &, const simulation_api_schema::ImuSensorConfiguration & configuration) @@ -289,22 +267,6 @@ class API void startNpcLogic(); - void requestLaneChange(const std::string & name, const lanelet::Id lanelet_id); - - void requestLaneChange(const std::string & name, const lane_change::Direction & direction); - - void requestLaneChange(const std::string & name, const lane_change::Parameter &); - - void requestLaneChange( - const std::string & name, const lane_change::RelativeTarget & target, - const lane_change::TrajectoryShape trajectory_shape, - const lane_change::Constraint & constraint); - - void requestLaneChange( - const std::string & name, const lane_change::AbsoluteTarget & target, - const lane_change::TrajectoryShape trajectory_shape, - const lane_change::Constraint & constraint); - /** * @brief Add a traffic source to the simulation * @param radius The radius defining the area on which entities will be spawned @@ -355,49 +317,13 @@ class API static_assert(true, "") // clang-format on - FORWARD_TO_ENTITY_MANAGER(activateOutOfRangeJob); - FORWARD_TO_ENTITY_MANAGER(asFieldOperatorApplication); - FORWARD_TO_ENTITY_MANAGER(cancelRequest); - FORWARD_TO_ENTITY_MANAGER(checkCollision); - FORWARD_TO_ENTITY_MANAGER(entityExists); - FORWARD_TO_ENTITY_MANAGER(getBehaviorParameter); - FORWARD_TO_ENTITY_MANAGER(getBoundingBox); - FORWARD_TO_ENTITY_MANAGER(getCurrentAccel); - FORWARD_TO_ENTITY_MANAGER(getCurrentAction); - FORWARD_TO_ENTITY_MANAGER(getCurrentTwist); - FORWARD_TO_ENTITY_MANAGER(getEgoName); + FORWARD_TO_ENTITY_MANAGER(isEntityExist); + FORWARD_TO_ENTITY_MANAGER(getEgoEntity); FORWARD_TO_ENTITY_MANAGER(getEntityNames); - FORWARD_TO_ENTITY_MANAGER(getEntityStatus); - FORWARD_TO_ENTITY_MANAGER(getCanonicalizedStatusBeforeUpdate); - FORWARD_TO_ENTITY_MANAGER(getLinearJerk); - FORWARD_TO_ENTITY_MANAGER(getStandStillDuration); - FORWARD_TO_ENTITY_MANAGER(getTraveledDistance); - FORWARD_TO_ENTITY_MANAGER(isEgoSpawned); - FORWARD_TO_ENTITY_MANAGER(isInLanelet); + FORWARD_TO_ENTITY_MANAGER(getEntityOrNullptr); + FORWARD_TO_ENTITY_MANAGER(isAnyEgoSpawned); FORWARD_TO_ENTITY_MANAGER(isNpcLogicStarted); - FORWARD_TO_ENTITY_MANAGER(laneMatchingSucceed); - FORWARD_TO_ENTITY_MANAGER(reachPosition); - FORWARD_TO_ENTITY_MANAGER(requestAcquirePosition); - FORWARD_TO_ENTITY_MANAGER(requestAssignRoute); - FORWARD_TO_ENTITY_MANAGER(requestFollowTrajectory); - FORWARD_TO_ENTITY_MANAGER(requestSpeedChange); - FORWARD_TO_ENTITY_MANAGER(requestSynchronize); - FORWARD_TO_ENTITY_MANAGER(requestWalkStraight); - FORWARD_TO_ENTITY_MANAGER(requestClearRoute); FORWARD_TO_ENTITY_MANAGER(resetBehaviorPlugin); - FORWARD_TO_ENTITY_MANAGER(setAcceleration); - FORWARD_TO_ENTITY_MANAGER(setAccelerationLimit); - FORWARD_TO_ENTITY_MANAGER(setAccelerationRateLimit); - FORWARD_TO_ENTITY_MANAGER(setBehaviorParameter); - FORWARD_TO_ENTITY_MANAGER(setDecelerationLimit); - FORWARD_TO_ENTITY_MANAGER(setDecelerationRateLimit); - FORWARD_TO_ENTITY_MANAGER(setLinearVelocity); - FORWARD_TO_ENTITY_MANAGER(setMapPose); - FORWARD_TO_ENTITY_MANAGER(setTwist); - FORWARD_TO_ENTITY_MANAGER(setVelocityLimit); - -private: - FORWARD_TO_ENTITY_MANAGER(getDefaultMatchingDistanceForLaneletPoseCalculation); public: #undef FORWARD_TO_ENTITY_MANAGER diff --git a/simulation/traffic_simulator/include/traffic_simulator/behavior/longitudinal_speed_planning.hpp b/simulation/traffic_simulator/include/traffic_simulator/behavior/longitudinal_speed_planning.hpp index 95df82b7990..3c020e164c1 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/behavior/longitudinal_speed_planning.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/behavior/longitudinal_speed_planning.hpp @@ -50,8 +50,8 @@ class LongitudinalSpeedPlanner auto isDecelerating(double target_speed, const geometry_msgs::msg::Twist & current_twist) const -> bool; auto isTargetSpeedReached( - double target_speed, const geometry_msgs::msg::Twist & current_twist, - double tolerance = 0.01) const noexcept -> bool; + const double target_speed, const geometry_msgs::msg::Twist & current_twist, + const double tolerance = 0.01) const noexcept -> bool; const double step_time; const std::string entity; diff --git a/simulation/traffic_simulator/include/traffic_simulator/data_type/entity_status.hpp b/simulation/traffic_simulator/include/traffic_simulator/data_type/entity_status.hpp index 482a693d732..0d675ab7d89 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/data_type/entity_status.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/data_type/entity_status.hpp @@ -33,7 +33,7 @@ class CanonicalizedEntityStatus explicit CanonicalizedEntityStatus( const EntityStatus & may_non_canonicalized_entity_status, const std::optional & canonicalized_lanelet_pose); - explicit CanonicalizedEntityStatus(const CanonicalizedEntityStatus & obj); + CanonicalizedEntityStatus(const CanonicalizedEntityStatus & obj); explicit operator EntityStatus() const noexcept { return entity_status_; } auto set(const CanonicalizedEntityStatus & status) -> void; @@ -64,10 +64,10 @@ class CanonicalizedEntityStatus auto getLinearJerk() const noexcept -> double; auto setLinearJerk(double) -> void; - auto laneMatchingSucceed() const noexcept -> bool; - auto getLaneletId() const noexcept -> lanelet::Id; - auto getLaneletIds() const noexcept -> lanelet::Ids; - auto getLaneletPose() const noexcept -> const LaneletPose &; + auto isInLanelet() const noexcept -> bool; + auto getLaneletId() const -> lanelet::Id; + auto getLaneletIds() const -> lanelet::Ids; + auto getLaneletPose() const -> const LaneletPose &; auto getCanonicalizedLaneletPose() const noexcept -> const std::optional &; auto getName() const noexcept -> const std::string & { return entity_status_.name; } diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/ego_entity.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/ego_entity.hpp index 8353163aa80..21948a78e0c 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/ego_entity.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/ego_entity.hpp @@ -56,8 +56,6 @@ class EgoEntity : public VehicleEntity, private concealer::FieldOperatorApplicat auto operator=(const EgoEntity &) -> EgoEntity & = delete; - auto asFieldOperatorApplication() -> concealer::FieldOperatorApplication & override; - auto getCurrentAction() const -> std::string override; auto getCurrentPose() const -> const geometry_msgs::msg::Pose &; @@ -92,9 +90,9 @@ class EgoEntity : public VehicleEntity, private concealer::FieldOperatorApplicat auto requestFollowTrajectory( const std::shared_ptr &) -> void override; - void requestLaneChange(const lanelet::Id) override; + auto requestLaneChange(const lanelet::Id) -> void override; - auto requestLaneChange(const traffic_simulator::lane_change::Parameter &) -> void override; + auto requestLaneChange(const lane_change::Parameter &) -> void override; auto requestSpeedChange( const double, const speed_change::Transition, const speed_change::Constraint, @@ -104,7 +102,11 @@ class EgoEntity : public VehicleEntity, private concealer::FieldOperatorApplicat const speed_change::RelativeTargetSpeed &, const speed_change::Transition, const speed_change::Constraint, const bool continuous) -> void override; - void requestClearRoute() override; + auto requestClearRoute() -> void; + + auto requestReplanRoute(const std::vector & route) -> void; + + auto requestAutoModeForCooperation(const std::string & module_name, bool enable) -> void; auto isControlledBySimulator() const -> bool override; @@ -125,8 +127,15 @@ class EgoEntity : public VehicleEntity, private concealer::FieldOperatorApplicat auto setMapPose(const geometry_msgs::msg::Pose & map_pose) -> void override; + template + auto setParameter(const std::string & name, const ParameterType & default_value = {}) + -> ParameterType + { + return declare_parameter(name, default_value); + } + template - auto setStatus(Ts &&... xs) + auto setStatus(Ts &&... xs) -> void { if (status_->getTime() > 0 && not isControlledBySimulator()) { THROW_SEMANTIC_ERROR( @@ -136,8 +145,16 @@ class EgoEntity : public VehicleEntity, private concealer::FieldOperatorApplicat EntityBase::setStatus(std::forward(xs)...); } } + + auto engage() -> void; + auto isEngaged() const -> bool; + auto isEngageable() const -> bool; + auto sendCooperateCommand(const std::string & module_name, const std::string & command) -> void; + auto getMinimumRiskManeuverBehaviorName() const -> std::string; + auto getMinimumRiskManeuverStateName() const -> std::string; + auto getEmergencyStateName() const -> std::string; + auto getTurnIndicatorsCommandName() const -> std::string; }; } // namespace entity } // namespace traffic_simulator - #endif // TRAFFIC_SIMULATOR__ENTITY__EGO_ENTITY_HPP_ diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp index 49d149c7813..e28eb964deb 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_base.hpp @@ -53,9 +53,13 @@ class EntityBase virtual ~EntityBase() = default; - virtual void appendDebugMarker(visualization_msgs::msg::MarkerArray & /*unused*/); + template + /* */ auto is() const -> bool + { + return dynamic_cast(this) != nullptr; + } - virtual auto asFieldOperatorApplication() -> concealer::FieldOperatorApplication &; + virtual void appendDebugMarker(visualization_msgs::msg::MarkerArray & /*unused*/); virtual void cancelRequest(); @@ -80,20 +84,10 @@ class EntityBase DEFINE_GETTER(MapPose, const geometry_msgs::msg::Pose &, status_->getMapPose()) DEFINE_GETTER(StandStillDuration, double, stand_still_duration_) DEFINE_GETTER(TraveledDistance, double, traveled_distance_) + DEFINE_GETTER(Name, const std::string &, status_->getName()) // clang-format on #undef DEFINE_GETTER - // clang-format off -#define DEFINE_CHECK_FUNCTION(FUNCTION_NAME, BOOL_VARIABLE) \ - /** \ - @note This function was defined by DEFINE_CHECK_FUNCTION function. \ - */ \ - /* */ auto FUNCTION_NAME() const->bool { return BOOL_VARIABLE; } - - DEFINE_CHECK_FUNCTION(laneMatchingSucceed, status_->laneMatchingSucceed()) - // clang-format on -#undef DEFINE_CHECK_FUNCTION - /* */ auto get2DPolygon() const -> std::vector; virtual auto getCurrentAction() const -> std::string = 0; @@ -107,6 +101,19 @@ class EntityBase virtual auto getGoalPoses() -> std::vector = 0; + /* */ auto isStopped() const -> bool; + + /* */ auto isNearbyPosition(const geometry_msgs::msg::Pose & pose, const double tolerance) const + -> bool; + + /* */ auto isNearbyPosition( + const CanonicalizedLaneletPose & lanelet_pose, const double tolerance) const -> bool; + + /* */ auto isInLanelet() const -> bool { return status_->isInLanelet(); }; + + /* */ auto isInLanelet( + const lanelet::Id lanelet_id, std::optional tolerance = std::nullopt) const -> bool; + /* */ auto getCanonicalizedLaneletPose() const -> std::optional; /* */ auto getCanonicalizedLaneletPose(const double matching_distance) const @@ -138,7 +145,7 @@ class EntityBase virtual void requestAssignRoute(const std::vector &) = 0; - virtual void requestLaneChange(const lanelet::Id) + virtual auto requestLaneChange(const lanelet::Id) -> void { /** * @note There are Entities such as MiscObjectEntity for which lane change is not possible, @@ -146,7 +153,7 @@ class EntityBase */ } - virtual void requestLaneChange(const traffic_simulator::lane_change::Parameter &) + virtual auto requestLaneChange(const lane_change::Parameter &) -> void { /** * @note There are Entities such as MiscObjectEntity for which lane change is not possible, @@ -154,17 +161,19 @@ class EntityBase */ } - /* */ void requestLaneChange( + /* */ auto requestLaneChange(const lane_change::Direction & direction) -> void; + + /* */ auto requestLaneChange( const lane_change::AbsoluteTarget & target, const lane_change::TrajectoryShape trajectory_shape, - const lane_change::Constraint & constraint); + const lane_change::Constraint & constraint) -> void; - /* */ void requestLaneChange( + /* */ auto requestLaneChange( const lane_change::RelativeTarget & target, const lane_change::TrajectoryShape trajectory_shape, - const lane_change::Constraint & constraint); + const lane_change::Constraint & constraint) -> void; - virtual void requestSpeedChange( - const double target_speed, const speed_change::Transition transition, - const speed_change::Constraint constraint, const bool continuous); + virtual auto requestSpeedChange( + const double target_speed, const speed_change::Transition, + const speed_change::Constraint constraint, const bool continuous) -> void; virtual void requestSpeedChange( const speed_change::RelativeTargetSpeed & target_speed, @@ -176,14 +185,6 @@ class EntityBase virtual void requestSpeedChange( const speed_change::RelativeTargetSpeed & target_speed, const bool continuous); - virtual void requestClearRoute() - { - /** - * @note Since there are Entities such as MiscObjectEntity that do not perform routing, - * and routing methods differ from Entity to Entity, this function performs no operation in the base type. - */ - } - virtual auto isControlledBySimulator() const -> bool; virtual auto setControlledBySimulator(const bool /*unused*/) -> void; @@ -209,11 +210,38 @@ class EntityBase /* */ void setOtherStatus( const std::unordered_map & status); - virtual auto setStatus(const EntityStatus & status, const lanelet::Ids & lanelet_ids) -> void; + /* */ auto setCanonicalizedStatus(const CanonicalizedEntityStatus & status) -> void; virtual auto setStatus(const EntityStatus & status) -> void; - /* */ auto setCanonicalizedStatus(const CanonicalizedEntityStatus & status) -> void; + virtual auto setStatus(const EntityStatus & status, const lanelet::Ids & lanelet_ids) -> void; + + virtual auto setStatus( + const geometry_msgs::msg::Pose & map_pose, + const traffic_simulator_msgs::msg::ActionStatus & action_status = + helper::constructActionStatus()) -> void; + + virtual auto setStatus( + const geometry_msgs::msg::Pose & reference_pose, const geometry_msgs::msg::Pose & relative_pose, + const traffic_simulator_msgs::msg::ActionStatus & action_status = + helper::constructActionStatus()) -> void; + + virtual auto setStatus( + const geometry_msgs::msg::Pose & reference_pose, + const geometry_msgs::msg::Point & relative_position, + const geometry_msgs::msg::Vector3 & relative_rpy, + const traffic_simulator_msgs::msg::ActionStatus & action_status = + helper::constructActionStatus()) -> void; + + virtual auto setStatus( + const CanonicalizedLaneletPose & canonicalized_lanelet_pose, + const traffic_simulator_msgs::msg::ActionStatus & action_status = + helper::constructActionStatus()) -> void; + + virtual auto setStatus( + const LaneletPose & lanelet_pose, + const traffic_simulator_msgs::msg::ActionStatus & action_status = + helper::constructActionStatus()) -> void; virtual auto setLinearAcceleration(const double linear_acceleration) -> void; @@ -242,14 +270,6 @@ class EntityBase /* */ void updateEntityStatusTimestamp(const double current_time); - /* */ bool reachPosition( - const geometry_msgs::msg::Pose & target_pose, const double tolerance) const; - - /* */ bool reachPosition( - const CanonicalizedLaneletPose & lanelet_pose, const double tolerance) const; - - /* */ bool reachPosition(const std::string & target_name, const double tolerance) const; - /* */ auto requestSynchronize( const std::string & target_name, const CanonicalizedLaneletPose & target_sync_pose, const CanonicalizedLaneletPose & entity_target, const double target_speed, diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_manager.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_manager.hpp index db979ad1e07..4f8a2f779e0 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_manager.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_manager.hpp @@ -132,67 +132,6 @@ class EntityManager ~EntityManager() = default; public: - // clang-format off -#define FORWARD_TO_ENTITY(IDENTIFIER, ...) \ - /*! \ - @brief Forward to arguments to the EntityBase::IDENTIFIER function. \ - @return return value of the EntityBase::IDENTIFIER function. \ - @note This function was defined by FORWARD_TO_ENTITY macro.         \ - */ \ - template \ - decltype(auto) IDENTIFIER(const std::string & name, Ts &&... xs) __VA_ARGS__ \ - try { \ - return entities_.at(name)->IDENTIFIER(std::forward(xs)...); \ - } catch (const std::out_of_range &) { \ - THROW_SEMANTIC_ERROR("entity : ", name, "does not exist"); \ - } \ - static_assert(true, "") - // clang-format on - - FORWARD_TO_ENTITY(activateOutOfRangeJob, ); - FORWARD_TO_ENTITY(asFieldOperatorApplication, const); - FORWARD_TO_ENTITY(cancelRequest, ); - FORWARD_TO_ENTITY(get2DPolygon, const); - FORWARD_TO_ENTITY(getBehaviorParameter, const); - FORWARD_TO_ENTITY(getBoundingBox, const); - FORWARD_TO_ENTITY(getCanonicalizedStatusBeforeUpdate, const); - FORWARD_TO_ENTITY(getCurrentAccel, const); - FORWARD_TO_ENTITY(getCurrentTwist, const); - FORWARD_TO_ENTITY(getDefaultMatchingDistanceForLaneletPoseCalculation, const); - FORWARD_TO_ENTITY(getEntityType, const); - FORWARD_TO_ENTITY(getEntityTypename, const); - FORWARD_TO_ENTITY(getLinearJerk, const); - FORWARD_TO_ENTITY(getRouteLanelets, const); - FORWARD_TO_ENTITY(getStandStillDuration, const); - FORWARD_TO_ENTITY(getTraveledDistance, const); - FORWARD_TO_ENTITY(isControlledBySimulator, ); - FORWARD_TO_ENTITY(laneMatchingSucceed, const); - FORWARD_TO_ENTITY(reachPosition, const); - FORWARD_TO_ENTITY(requestAcquirePosition, ); - FORWARD_TO_ENTITY(requestAssignRoute, ); - FORWARD_TO_ENTITY(requestClearRoute, ); - FORWARD_TO_ENTITY(requestFollowTrajectory, ); - FORWARD_TO_ENTITY(requestLaneChange, ); - FORWARD_TO_ENTITY(requestSynchronize, ); - FORWARD_TO_ENTITY(requestWalkStraight, ); - FORWARD_TO_ENTITY(setAcceleration, ); - FORWARD_TO_ENTITY(setAccelerationLimit, ); - FORWARD_TO_ENTITY(setAccelerationRateLimit, ); - FORWARD_TO_ENTITY(setBehaviorParameter, ); - FORWARD_TO_ENTITY(setControlledBySimulator, ); - FORWARD_TO_ENTITY(setDecelerationLimit, ); - FORWARD_TO_ENTITY(setDecelerationRateLimit, ); - FORWARD_TO_ENTITY(setLinearJerk, ); - FORWARD_TO_ENTITY(setLinearVelocity, ); - FORWARD_TO_ENTITY(setMapPose, ); - FORWARD_TO_ENTITY(setTwist, ); - FORWARD_TO_ENTITY(setVelocityLimit, ); - FORWARD_TO_ENTITY(requestSpeedChange, ); - -#undef FORWARD_TO_ENTITY - - auto getCurrentAction(const std::string & name) const -> std::string; - visualization_msgs::msg::MarkerArray makeDebugMarker() const; auto updateNpcLogic(const std::string & name, const double current_time, const double step_time) @@ -203,19 +142,22 @@ class EntityManager void broadcastTransform( const geometry_msgs::msg::PoseStamped & pose, const bool static_transform = true); - bool checkCollision( - const std::string & first_entity_name, const std::string & second_entity_name); - bool despawnEntity(const std::string & name); - bool entityExists(const std::string & name); + auto isEntityExist(const std::string & name) const -> bool; auto getEntityNames() const -> const std::vector; + auto getEntityOrNullptr(const std::string & name) const + -> std::shared_ptr; + auto getEntity(const std::string & name) const -> std::shared_ptr; - auto getEntityStatus(const std::string & name) const -> const CanonicalizedEntityStatus &; + auto getEgoEntity() const -> std::shared_ptr; + + auto getEgoEntity(const std::string & name) const + -> std::shared_ptr; auto getNumberOfEgo() const -> std::size_t; @@ -252,22 +194,9 @@ class EntityManager } } - template - bool is(const std::string & name) const - { - return dynamic_cast(entities_.at(name).get()) != nullptr; - } - - bool isEgoSpawned() const; - - const std::string getEgoName() const; - - bool isInLanelet(const std::string & name, const lanelet::Id lanelet_id, const double tolerance); - - bool isStopping(const std::string & name) const; + auto isAnyEgoSpawned() const -> bool; - void requestLaneChange( - const std::string & name, const traffic_simulator::lane_change::Direction & direction); + auto getEgoName() const -> const std::string &; /** * @brief Reset behavior plugin of the target entity. @@ -296,10 +225,7 @@ class EntityManager EntityStatus entity_status; if constexpr (std::is_same_v, EgoEntity>) { - if (auto iter = std::find_if( - std::begin(entities_), std::end(entities_), - [this](auto && each) { return is(each.first); }); - iter != std::end(entities_)) { + if (isAnyEgoSpawned()) { THROW_SEMANTIC_ERROR("multi ego simulation does not support yet"); } else { entity_status.type.type = traffic_simulator_msgs::msg::EntityType::EGO; diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/vehicle_entity.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/vehicle_entity.hpp index d306546a410..30b2028d99c 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/vehicle_entity.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/vehicle_entity.hpp @@ -106,9 +106,9 @@ class VehicleEntity : public EntityBase auto requestFollowTrajectory( const std::shared_ptr &) -> void override; - void requestLaneChange(const lanelet::Id to_lanelet_id) override; + auto requestLaneChange(const lanelet::Id to_lanelet_id) -> void override; - void requestLaneChange(const traffic_simulator::lane_change::Parameter &) override; + auto requestLaneChange(const traffic_simulator::lane_change::Parameter &) -> void override; void setVelocityLimit(double linear_velocity) override; diff --git a/simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/distance.hpp b/simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/distance.hpp index cf217e7687b..d7de5bea4f5 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/distance.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/distance.hpp @@ -45,7 +45,7 @@ auto distanceToStopLine( auto distanceToStopLine(const std::vector & route_waypoints, const lanelet::Id stop_line_id) -> std::optional; -// TrafficLigthStopLine +// TrafficLightStopLine auto distanceToTrafficLightStopLine( const SplineInterface & route_spline, const lanelet::Id traffic_light_id) -> std::optional; diff --git a/simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/lanelet_wrapper.hpp b/simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/lanelet_wrapper.hpp index 74ad7b4d3e8..3a32598ae74 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/lanelet_wrapper.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/lanelet_wrapper/lanelet_wrapper.hpp @@ -163,7 +163,7 @@ class CenterPointsCache } auto getCenterPoints(const lanelet::Id lanelet_id, const lanelet::LaneletMapPtr & lanelet_map) - -> std::vector + -> decltype(auto) { if (!exists(lanelet_id)) { appendData(lanelet_id, centerPoints(lanelet_id, lanelet_map)); @@ -172,8 +172,7 @@ class CenterPointsCache } auto getCenterPointsSpline( - const lanelet::Id lanelet_id, const lanelet::LaneletMapPtr & lanelet_map) - -> std::shared_ptr + const lanelet::Id lanelet_id, const lanelet::LaneletMapPtr & lanelet_map) -> decltype(auto) { if (!exists(lanelet_id)) { appendData(lanelet_id, centerPoints(lanelet_id, lanelet_map)); @@ -188,7 +187,7 @@ class CenterPointsCache return data_.find(lanelet_id) != data_.end(); } - auto readData(const lanelet::Id lanelet_id) -> std::vector + auto readData(const lanelet::Id lanelet_id) -> const std::vector & { std::lock_guard lock(mutex_); return data_.at(lanelet_id); @@ -237,7 +236,7 @@ class CenterPointsCache class LaneletLengthCache { public: - auto getLength(lanelet::Id lanelet_id) + auto getLength(lanelet::Id lanelet_id) -> double { if (!exists(lanelet_id)) { THROW_SIMULATION_ERROR("length of : ", lanelet_id, " does not exists on route cache."); diff --git a/simulation/traffic_simulator/package.xml b/simulation/traffic_simulator/package.xml index 23ed8e72257..6641ef9c25b 100644 --- a/simulation/traffic_simulator/package.xml +++ b/simulation/traffic_simulator/package.xml @@ -1,7 +1,7 @@ traffic_simulator - 7.4.7 + 9.0.3 control traffic flow masaya kataoka diff --git a/simulation/traffic_simulator/src/api/api.cpp b/simulation/traffic_simulator/src/api/api.cpp index 3aa4856bad3..09c74226e5e 100644 --- a/simulation/traffic_simulator/src/api/api.cpp +++ b/simulation/traffic_simulator/src/api/api.cpp @@ -14,6 +14,7 @@ #include +#include #include #include #include @@ -46,7 +47,7 @@ bool API::despawn(const std::string & name) bool API::despawnEntities() { - auto entities = getEntityNames(); + const auto entities = entity_manager_ptr_->getEntityNames(); return std::all_of( entities.begin(), entities.end(), [&](const auto & entity) { return despawn(entity); }); } @@ -55,22 +56,22 @@ auto API::respawn( const std::string & name, const geometry_msgs::msg::PoseWithCovarianceStamped & new_pose, const geometry_msgs::msg::PoseStamped & goal_pose) -> void { - if (not entity_manager_ptr_->is(name)) { - throw std::runtime_error("Respawn of any entities other than EGO is not supported."); - } else if (new_pose.header.frame_id != "map") { + if (new_pose.header.frame_id != "map") { throw std::runtime_error("Respawn request with frame id other than map not supported."); } else { + auto ego_entity = entity_manager_ptr_->getEgoEntity(name); // set new pose and default action status in EntityManager - entity_manager_ptr_->setControlledBySimulator(name, true); - setEntityStatus(name, new_pose.pose.pose, helper::constructActionStatus()); + ego_entity->setControlledBySimulator(true); + ego_entity->setStatus(new_pose.pose.pose, helper::constructActionStatus()); // read status from EntityManager, then send it to SimpleSensorSimulator simulation_api_schema::UpdateEntityStatusRequest req; simulation_interface::toProto( - static_cast(entity_manager_ptr_->getEntityStatus(name)), *req.add_status()); + static_cast(entity_manager_ptr_->getEntity(name)->getCanonicalizedStatus()), + *req.add_status()); req.set_npc_logic_started(entity_manager_ptr_->isNpcLogicStarted()); - req.set_overwrite_ego_status(entity_manager_ptr_->isControlledBySimulator(name)); - entity_manager_ptr_->setControlledBySimulator(name, false); + req.set_overwrite_ego_status(ego_entity->isControlledBySimulator()); + ego_entity->setControlledBySimulator(false); // check response if (const auto res = zeromq_client_.call(req); not res.result().success()) { @@ -85,124 +86,35 @@ auto API::respawn( res_name + "\"."); } else { // if valid, set response in EntityManager, then plan path and engage - auto entity_status = static_cast(entity_manager_ptr_->getEntityStatus(name)); + auto entity_status = static_cast(ego_entity->getCanonicalizedStatus()); simulation_interface::toMsg(res_status->pose(), entity_status.pose); simulation_interface::toMsg(res_status->action_status(), entity_status.action_status); - setMapPose(name, entity_status.pose); - setTwist(name, entity_status.action_status.twist); - setAcceleration(name, entity_status.action_status.accel); - - entity_manager_ptr_->asFieldOperatorApplication(name).clearRoute(); - entity_manager_ptr_->asFieldOperatorApplication(name).plan({goal_pose}); - entity_manager_ptr_->asFieldOperatorApplication(name).enableAutowareControl(); - entity_manager_ptr_->asFieldOperatorApplication(name).engage(); + ego_entity->setMapPose(entity_status.pose); + ego_entity->setTwist(entity_status.action_status.twist); + ego_entity->setAcceleration(entity_status.action_status.accel); + ego_entity->requestReplanRoute({goal_pose}); } } } -auto API::getEntity(const std::string & name) const -> std::shared_ptr +bool API::checkCollision( + const std::string & first_entity_name, const std::string & second_entity_name) { - return entity_manager_ptr_->getEntity(name); -} - -auto API::setEntityStatus( - const std::string & name, const CanonicalizedLaneletPose & canonicalized_lanelet_pose, - const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void -{ - if (const auto entity = getEntity(name)) { - auto status = static_cast(entity->getCanonicalizedStatus()); - status.action_status = action_status; - status.pose = static_cast(canonicalized_lanelet_pose); - status.lanelet_pose = static_cast(canonicalized_lanelet_pose); - status.lanelet_pose_valid = true; - entity->setCanonicalizedStatus(CanonicalizedEntityStatus(status, canonicalized_lanelet_pose)); - } else { - THROW_SIMULATION_ERROR("Cannot set entity \"", name, "\" status - such entity does not exist."); - } -} - -auto API::setEntityStatus(const std::string & name, const EntityStatus & status) -> void -{ - if (const auto entity = getEntity(name)) { - entity->setStatus(status); - } else { - THROW_SIMULATION_ERROR("Cannot set entity \"", name, "\" status - such entity does not exist."); - } -} - -/// @todo it probably should be moved to SimulatorCore -std::optional API::getTimeHeadway( - const std::string & from_entity_name, const std::string & to_entity_name) -{ - if (auto from_entity = getEntity(from_entity_name); from_entity) { - if (auto to_entity = getEntity(to_entity_name); to_entity) { - if (auto relative_pose = - pose::relativePose(from_entity->getMapPose(), to_entity->getMapPose()); - relative_pose && relative_pose->position.x <= 0) { - const double time_headway = - (relative_pose->position.x * -1) / getCurrentTwist(to_entity_name).linear.x; - return std::isnan(time_headway) ? std::numeric_limits::infinity() : time_headway; - } + if (first_entity_name != second_entity_name) { + const auto first_entity = getEntityOrNullptr(first_entity_name); + const auto second_entity = getEntityOrNullptr(second_entity_name); + if (first_entity && second_entity) { + return math::geometry::checkCollision2D( + first_entity->getMapPose(), first_entity->getBoundingBox(), second_entity->getMapPose(), + second_entity->getBoundingBox()); } } - return std::nullopt; -} - -auto API::setEntityStatus( - const std::string & name, const LaneletPose & lanelet_pose, - const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void -{ - if (const auto canonicalized_lanelet_pose = pose::toCanonicalizedLaneletPose(lanelet_pose)) { - setEntityStatus(name, canonicalized_lanelet_pose.value(), action_status); - } else { - std::stringstream ss; - ss << "Status can not be set. lanelet pose: " << lanelet_pose - << " cannot be canonicalized for "; - THROW_SEMANTIC_ERROR(ss.str(), " entity named: ", std::quoted(name), "."); - } -} - -auto API::setEntityStatus( - const std::string & name, const geometry_msgs::msg::Pose & map_pose, - const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void -{ - if (const auto entity = getEntity(name)) { - EntityStatus status = static_cast(entity->getCanonicalizedStatus()); - status.pose = map_pose; - status.action_status = action_status; - status.lanelet_pose_valid = false; - setEntityStatus(name, status); - } else { - THROW_SIMULATION_ERROR("Cannot set entity \"", name, "\" status - such entity does not exist."); - } -} - -auto API::setEntityStatus( - const std::string & name, const std::string & reference_entity_name, - const geometry_msgs::msg::Pose & relative_pose, - const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void -{ - if (const auto reference_entity = getEntity(reference_entity_name)) { - setEntityStatus( - name, pose::transformRelativePoseToGlobal(reference_entity->getMapPose(), relative_pose), - action_status); - } else { - THROW_SIMULATION_ERROR( - "Cannot get entity \"", reference_entity_name, "\" - such entity does not exist."); - } + return false; } -auto API::setEntityStatus( - const std::string & name, const std::string & reference_entity_name, - const geometry_msgs::msg::Point & relative_position, - const geometry_msgs::msg::Vector3 & relative_rpy, - const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void +auto API::getEntity(const std::string & name) const -> std::shared_ptr { - const auto relative_pose = - geometry_msgs::build() - .position(relative_position) - .orientation(math::geometry::convertEulerAngleToQuaternion(relative_rpy)); - setEntityStatus(name, reference_entity_name, relative_pose, action_status); + return entity_manager_ptr_->getEntity(name); } auto API::attachImuSensor( @@ -303,29 +215,28 @@ bool API::updateEntitiesStatusInSim() simulation_api_schema::UpdateEntityStatusRequest req; req.set_npc_logic_started(entity_manager_ptr_->isNpcLogicStarted()); for (const auto & entity_name : entity_manager_ptr_->getEntityNames()) { - const auto entity_status = - static_cast(entity_manager_ptr_->getEntityStatus(entity_name)); + const auto entity = entity_manager_ptr_->getEntity(entity_name); + const auto entity_status = static_cast(entity->getCanonicalizedStatus()); simulation_interface::toProto(entity_status, *req.add_status()); - if (entity_manager_ptr_->is(entity_name)) { - req.set_overwrite_ego_status(entity_manager_ptr_->isControlledBySimulator(entity_name)); + if (entity->is()) { + req.set_overwrite_ego_status(entity->isControlledBySimulator()); } } simulation_api_schema::UpdateEntityStatusResponse res; if (auto res = zeromq_client_.call(req); res.result().success()) { for (const auto & res_status : res.status()) { - auto entity_name = res_status.name(); - auto entity_status = - static_cast(entity_manager_ptr_->getEntityStatus(entity_name)); + auto entity = entity_manager_ptr_->getEntity(res_status.name()); + auto entity_status = static_cast(entity->getCanonicalizedStatus()); simulation_interface::toMsg(res_status.pose(), entity_status.pose); simulation_interface::toMsg(res_status.action_status(), entity_status.action_status); - if (entity_manager_ptr_->is(entity_name)) { - setMapPose(entity_name, entity_status.pose); - setTwist(entity_name, entity_status.action_status.twist); - setAcceleration(entity_name, entity_status.action_status.accel); + if (entity->is()) { + entity->setMapPose(entity_status.pose); + entity->setTwist(entity_status.action_status.twist); + entity->setAcceleration(entity_status.action_status.accel); } else { - setEntityStatus(entity_name, entity_status); + entity->setStatus(entity_status); } } return true; @@ -335,7 +246,7 @@ bool API::updateEntitiesStatusInSim() bool API::updateFrame() { - if (configuration.standalone_mode && entity_manager_ptr_->isEgoSpawned()) { + if (configuration.standalone_mode && entity_manager_ptr_->isAnyEgoSpawned()) { THROW_SEMANTIC_ERROR("Ego simulation is no longer supported in standalone mode"); } @@ -370,39 +281,6 @@ void API::startNpcLogic() } } -void API::requestLaneChange(const std::string & name, const lanelet::Id lanelet_id) -{ - entity_manager_ptr_->requestLaneChange(name, lanelet_id); -} - -void API::requestLaneChange( - const std::string & name, const traffic_simulator::lane_change::Direction & direction) -{ - entity_manager_ptr_->requestLaneChange(name, direction); -} - -void API::requestLaneChange( - const std::string & name, const traffic_simulator::lane_change::Parameter & parameter) -{ - entity_manager_ptr_->requestLaneChange(name, parameter); -} - -void API::requestLaneChange( - const std::string & name, const traffic_simulator::lane_change::RelativeTarget & target, - const traffic_simulator::lane_change::TrajectoryShape trajectory_shape, - const lane_change::Constraint & constraint) -{ - entity_manager_ptr_->requestLaneChange(name, target, trajectory_shape, constraint); -} - -void API::requestLaneChange( - const std::string & name, const traffic_simulator::lane_change::AbsoluteTarget & target, - const traffic_simulator::lane_change::TrajectoryShape trajectory_shape, - const lane_change::Constraint & constraint) -{ - entity_manager_ptr_->requestLaneChange(name, target, trajectory_shape, constraint); -} - auto API::addTrafficSource( const double radius, const double rate, const double speed, const geometry_msgs::msg::Pose & pose, const traffic::TrafficSource::Distribution & distribution, const bool allow_spawn_outside_lane, @@ -418,7 +296,7 @@ auto API::addTrafficSource( radius, rate, pose, distribution, seed, getCurrentTime(), configuration, [this, speed](const auto & name, auto &&... xs) { this->spawn(name, std::forward(xs)...); - setLinearVelocity(name, speed); + getEntity(name)->setLinearVelocity(speed); }); } } // namespace traffic_simulator diff --git a/simulation/traffic_simulator/src/behavior/longitudinal_speed_planning.cpp b/simulation/traffic_simulator/src/behavior/longitudinal_speed_planning.cpp index 9c3aee51c81..0a3f47fa73e 100644 --- a/simulation/traffic_simulator/src/behavior/longitudinal_speed_planning.cpp +++ b/simulation/traffic_simulator/src/behavior/longitudinal_speed_planning.cpp @@ -134,8 +134,8 @@ auto LongitudinalSpeedPlanner::getRunningDistance( } auto LongitudinalSpeedPlanner::isTargetSpeedReached( - double target_speed, const geometry_msgs::msg::Twist & current_twist, - double tolerance) const noexcept -> bool + const double target_speed, const geometry_msgs::msg::Twist & current_twist, + const double tolerance) const noexcept -> bool { return std::abs(target_speed - current_twist.linear.x) <= tolerance; } diff --git a/simulation/traffic_simulator/src/data_type/entity_status.cpp b/simulation/traffic_simulator/src/data_type/entity_status.cpp index 4d32f1a71f4..1d24b5133cf 100644 --- a/simulation/traffic_simulator/src/data_type/entity_status.cpp +++ b/simulation/traffic_simulator/src/data_type/entity_status.cpp @@ -19,7 +19,6 @@ namespace traffic_simulator { inline namespace entity_status { - CanonicalizedEntityStatus::CanonicalizedEntityStatus( const EntityStatus & may_non_canonicalized_entity_status, const std::optional & canonicalized_lanelet_pose) @@ -99,7 +98,7 @@ auto CanonicalizedEntityStatus::getActionStatus() const noexcept return entity_status_.action_status; } -auto CanonicalizedEntityStatus::laneMatchingSucceed() const noexcept -> bool +auto CanonicalizedEntityStatus::isInLanelet() const noexcept -> bool { return canonicalized_lanelet_pose_.has_value(); } @@ -126,7 +125,7 @@ auto CanonicalizedEntityStatus::getAltitude() const -> double : entity_status_.pose.position.z; } -auto CanonicalizedEntityStatus::getLaneletPose() const noexcept -> const LaneletPose & +auto CanonicalizedEntityStatus::getLaneletPose() const -> const LaneletPose & { if (canonicalized_lanelet_pose_) { return canonicalized_lanelet_pose_->getLaneletPose(); @@ -135,14 +134,14 @@ auto CanonicalizedEntityStatus::getLaneletPose() const noexcept -> const Lanelet } } -auto CanonicalizedEntityStatus::getLaneletId() const noexcept -> lanelet::Id +auto CanonicalizedEntityStatus::getLaneletId() const -> lanelet::Id { return getLaneletPose().lanelet_id; } -auto CanonicalizedEntityStatus::getLaneletIds() const noexcept -> lanelet::Ids +auto CanonicalizedEntityStatus::getLaneletIds() const -> lanelet::Ids { - return laneMatchingSucceed() ? lanelet::Ids{getLaneletId()} : lanelet::Ids{}; + return isInLanelet() ? lanelet::Ids{getLaneletId()} : lanelet::Ids{}; } auto CanonicalizedEntityStatus::getCanonicalizedLaneletPose() const noexcept diff --git a/simulation/traffic_simulator/src/entity/ego_entity.cpp b/simulation/traffic_simulator/src/entity/ego_entity.cpp index 9e14958ecac..1f833c77938 100644 --- a/simulation/traffic_simulator/src/entity/ego_entity.cpp +++ b/simulation/traffic_simulator/src/entity/ego_entity.cpp @@ -71,9 +71,49 @@ EgoEntity::EgoEntity( { } -auto EgoEntity::asFieldOperatorApplication() -> concealer::FieldOperatorApplication & +auto EgoEntity::engage() -> void { FieldOperatorApplication::engage(); } + +auto EgoEntity::isEngaged() const -> bool { return engaged(); } + +auto EgoEntity::isEngageable() const -> bool { return engageable(); } + +auto EgoEntity::sendCooperateCommand(const std::string & module_name, const std::string & command) + -> void +{ + FieldOperatorApplication::sendCooperateCommand(module_name, command); +} + +auto EgoEntity::requestAutoModeForCooperation(const std::string & module_name, bool enable) -> void +{ + FieldOperatorApplication::requestAutoModeForCooperation(module_name, enable); +} + +auto EgoEntity::getMinimumRiskManeuverBehaviorName() const -> std::string +{ + return minimum_risk_maneuver_behavior; +} + +auto EgoEntity::getMinimumRiskManeuverStateName() const -> std::string { - return *this; + return minimum_risk_maneuver_state; +} + +auto EgoEntity::getEmergencyStateName() const -> std::string { return minimum_risk_maneuver_state; } + +auto EgoEntity::getTurnIndicatorsCommandName() const -> std::string +{ + switch (getTurnIndicatorsCommand().command) { + case autoware_vehicle_msgs::msg::TurnIndicatorsCommand::DISABLE: + return "DISABLE"; + case autoware_vehicle_msgs::msg::TurnIndicatorsCommand::ENABLE_LEFT: + return "ENABLE_LEFT"; + case autoware_vehicle_msgs::msg::TurnIndicatorsCommand::ENABLE_RIGHT: + return "ENABLE_RIGHT"; + case autoware_vehicle_msgs::msg::TurnIndicatorsCommand::NO_COMMAND: + return "NO_COMMAND"; + default: + return ""; + } } auto EgoEntity::getCurrentAction() const -> std::string { return autoware_state; } @@ -163,35 +203,32 @@ void EgoEntity::requestAcquirePosition(const geometry_msgs::msg::Pose & map_pose void EgoEntity::requestAssignRoute(const std::vector & waypoints) { std::vector route; - for (const auto & waypoint : waypoints) { route.push_back(static_cast(waypoint)); } - requestAssignRoute(route); } void EgoEntity::requestAssignRoute(const std::vector & waypoints) { std::vector route; - for (const auto & waypoint : waypoints) { geometry_msgs::msg::PoseStamped pose_stamped; { pose_stamped.header.frame_id = "map"; pose_stamped.pose = waypoint; } - route.push_back(pose_stamped); } + requestClearRoute(); if (not initialized) { initialize(getMapPose()); plan(route); // NOTE: engage() will be executed at simulation-time 0. } else { plan(route); - engage(); + FieldOperatorApplication::engage(); } } @@ -205,7 +242,7 @@ auto EgoEntity::requestFollowTrajectory( is_controlled_by_simulator_ = true; } -void EgoEntity::requestLaneChange(const lanelet::Id) +auto EgoEntity::requestLaneChange(const lanelet::Id) -> void { THROW_SEMANTIC_ERROR( "From scenario, a lane change was requested to Ego type entity ", std::quoted(name), @@ -237,7 +274,16 @@ auto EgoEntity::requestSpeedChange( "purposes only."); } -void EgoEntity::requestClearRoute() { clearRoute(); } +auto EgoEntity::requestClearRoute() -> void { clearRoute(); } + +auto EgoEntity::requestReplanRoute(const std::vector & route) + -> void +{ + clearRoute(); + plan(route); + enableAutowareControl(); + FieldOperatorApplication::engage(); +} auto EgoEntity::getDefaultDynamicConstraints() const -> const traffic_simulator_msgs::msg::DynamicConstraints & diff --git a/simulation/traffic_simulator/src/entity/entity_base.cpp b/simulation/traffic_simulator/src/entity/entity_base.cpp index d0747ca6a56..c3bf0d034f9 100644 --- a/simulation/traffic_simulator/src/entity/entity_base.cpp +++ b/simulation/traffic_simulator/src/entity/entity_base.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -66,14 +67,6 @@ EntityBase::EntityBase(const std::string & name, const CanonicalizedEntityStatus void EntityBase::appendDebugMarker(visualization_msgs::msg::MarkerArray & /*unused*/) {} -auto EntityBase::asFieldOperatorApplication() -> concealer::FieldOperatorApplication & -{ - throw common::Error( - "An operation was requested for Entity ", std::quoted(name), - " that is valid only for the entity controlled by Autoware, but ", std::quoted(name), - " is not the entity controlled by Autoware."); -} - void EntityBase::cancelRequest() {} auto EntityBase::get2DPolygon() const -> std::vector @@ -100,11 +93,39 @@ auto EntityBase::getCanonicalizedLaneletPose(const double matching_distance) con matching_distance); } +auto EntityBase::isNearbyPosition( + const geometry_msgs::msg::Pose & pose, const double tolerance) const -> bool +{ + return math::geometry::getDistance(getMapPose(), pose) < tolerance; +} + +auto EntityBase::isNearbyPosition( + const CanonicalizedLaneletPose & lanelet_pose, const double tolerance) const -> bool +{ + return isNearbyPosition(static_cast(lanelet_pose), tolerance); +} + +auto EntityBase::isInLanelet(const lanelet::Id lanelet_id, std::optional tolerance) const + -> bool +{ + if (const auto lanelet_pose = getCanonicalizedLaneletPose()) { + const auto tolerance_value = + tolerance ? tolerance.value() : getDefaultMatchingDistanceForLaneletPoseCalculation(); + return pose::isInLanelet(lanelet_pose.value(), lanelet_id, tolerance_value); + } + return false; +} + auto EntityBase::getDefaultMatchingDistanceForLaneletPoseCalculation() const -> double { return getBoundingBox().dimensions.y * 0.5 + 1.0; } +auto EntityBase::isStopped() const -> bool +{ + return std::fabs(getCurrentTwist().linear.x) < std::numeric_limits::epsilon(); +} + auto EntityBase::isTargetSpeedReached(const double target_speed) const -> bool { return speed_planner_->isTargetSpeedReached(target_speed, getCurrentTwist()); @@ -137,22 +158,33 @@ void EntityBase::resetDynamicConstraints() setDynamicConstraints(getDefaultDynamicConstraints()); } -void EntityBase::requestLaneChange( +auto EntityBase::requestLaneChange(const lane_change::Direction & direction) -> void +{ + if (isInLanelet()) { + if ( + const auto target_lanelet_id = + route::laneChangeableLaneletId(getCanonicalizedStatus().getLaneletId(), direction)) { + requestLaneChange(target_lanelet_id.value()); + } + } +} + +auto EntityBase::requestLaneChange( const traffic_simulator::lane_change::AbsoluteTarget & target, const traffic_simulator::lane_change::TrajectoryShape trajectory_shape, - const traffic_simulator::lane_change::Constraint & constraint) + const traffic_simulator::lane_change::Constraint & constraint) -> void { requestLaneChange(lane_change::Parameter(target, trajectory_shape, constraint)); } -void EntityBase::requestLaneChange( +auto EntityBase::requestLaneChange( const traffic_simulator::lane_change::RelativeTarget & target, const traffic_simulator::lane_change::TrajectoryShape trajectory_shape, - const traffic_simulator::lane_change::Constraint & constraint) + const traffic_simulator::lane_change::Constraint & constraint) -> void { lanelet::Id reference_lanelet_id = 0; if (target.entity_name == name) { - if (not laneMatchingSucceed()) { + if (!isInLanelet()) { THROW_SEMANTIC_ERROR( "Source entity does not assigned to lanelet. Please check source entity name : ", name, " exists on lane."); @@ -163,7 +195,7 @@ void EntityBase::requestLaneChange( THROW_SEMANTIC_ERROR( "Target entity : ", target.entity_name, " does not exist. Please check ", target.entity_name, " exists."); - } else if (!other_status_.at(target.entity_name).laneMatchingSucceed()) { + } else if (!other_status_.at(target.entity_name).isInLanelet()) { THROW_SEMANTIC_ERROR( "Target entity does not assigned to lanelet. Please check Target entity name : ", target.entity_name, " exists on lane."); @@ -541,6 +573,11 @@ void EntityBase::setOtherStatus( other_status_.erase(name); } +auto EntityBase::setCanonicalizedStatus(const CanonicalizedEntityStatus & status) -> void +{ + status_->set(status); +} + auto EntityBase::setStatus(const EntityStatus & status, const lanelet::Ids & lanelet_ids) -> void { status_->set(status, lanelet_ids, getDefaultMatchingDistanceForLaneletPoseCalculation()); @@ -551,9 +588,61 @@ auto EntityBase::setStatus(const EntityStatus & status) -> void status_->set(status, getDefaultMatchingDistanceForLaneletPoseCalculation()); } -auto EntityBase::setCanonicalizedStatus(const CanonicalizedEntityStatus & status) -> void +auto EntityBase::setStatus( + const geometry_msgs::msg::Pose & map_pose, + const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void { - status_->set(status); + auto status = static_cast(getCanonicalizedStatus()); + status.pose = map_pose; + status.action_status = action_status; + setStatus(status); +} + +auto EntityBase::setStatus( + const geometry_msgs::msg::Pose & reference_pose, const geometry_msgs::msg::Pose & relative_pose, + const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void +{ + setStatus(pose::transformRelativePoseToGlobal(reference_pose, relative_pose), action_status); +} + +auto EntityBase::setStatus( + const geometry_msgs::msg::Pose & reference_pose, + const geometry_msgs::msg::Point & relative_position, + const geometry_msgs::msg::Vector3 & relative_rpy, + const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void +{ + const auto relative_pose = + geometry_msgs::build() + .position(relative_position) + .orientation(math::geometry::convertEulerAngleToQuaternion(relative_rpy)); + setStatus(reference_pose, relative_pose, action_status); +} + +auto EntityBase::setStatus( + const CanonicalizedLaneletPose & canonicalized_lanelet_pose, + const traffic_simulator_msgs::msg::ActionStatus & action_status) -> void +{ + auto status = static_cast(getCanonicalizedStatus()); + status.action_status = action_status; + status.pose = static_cast(canonicalized_lanelet_pose); + status.lanelet_pose = static_cast(canonicalized_lanelet_pose); + status.lanelet_pose_valid = true; + setCanonicalizedStatus(CanonicalizedEntityStatus(status, canonicalized_lanelet_pose)); +} + +auto EntityBase::setStatus( + const LaneletPose & lanelet_pose, const traffic_simulator_msgs::msg::ActionStatus & action_status) + -> void +{ + if (const auto canonicalized_lanelet_pose = toCanonicalizedLaneletPose(lanelet_pose); + canonicalized_lanelet_pose.has_value()) { + setStatus(canonicalized_lanelet_pose.value(), action_status); + } else { + std::stringstream ss; + ss << "Status can not be set. lanelet pose: " << lanelet_pose + << " is cannot be canonicalized for "; + THROW_SEMANTIC_ERROR(ss.str(), " entity named: ", std::quoted(name), "."); + } } auto EntityBase::setLinearVelocity(const double linear_velocity) -> void @@ -649,23 +738,6 @@ void EntityBase::updateEntityStatusTimestamp(const double current_time) status_->setTime(current_time); } -bool EntityBase::reachPosition(const std::string & target_name, const double tolerance) const -{ - return reachPosition(other_status_.find(target_name)->second.getMapPose(), tolerance); -} - -bool EntityBase::reachPosition( - const geometry_msgs::msg::Pose & target_pose, const double tolerance) const -{ - return math::geometry::getDistance(getMapPose(), target_pose) < tolerance; -} - -bool EntityBase::reachPosition( - const CanonicalizedLaneletPose & lanelet_pose, const double tolerance) const -{ - return reachPosition(static_cast(lanelet_pose), tolerance); -} - /*** * @brief Request synchronize the entity with the target entity. * @param target_name The name of the target entity. @@ -691,7 +763,7 @@ auto EntityBase::requestSynchronize( } ///@brief Check if the entity has already arrived to the target lanelet. - if (reachPosition(entity_target, tolerance)) { + if (isNearbyPosition(entity_target, tolerance)) { if (getCurrentTwist().linear.x < target_speed + getMaxAcceleration() * step_time_) { } else { RCLCPP_WARN_ONCE( diff --git a/simulation/traffic_simulator/src/entity/entity_manager.cpp b/simulation/traffic_simulator/src/entity/entity_manager.cpp index af6c4afa2ac..ca8db5c5658 100644 --- a/simulation/traffic_simulator/src/entity/entity_manager.cpp +++ b/simulation/traffic_simulator/src/entity/entity_manager.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -38,7 +37,7 @@ namespace traffic_simulator { namespace entity { -void EntityManager::broadcastEntityTransform() +auto EntityManager::broadcastEntityTransform() -> void { static bool is_send = false; static geometry_msgs::msg::Pose pose; @@ -53,24 +52,23 @@ void EntityManager::broadcastEntityTransform() * In the past, we used to publish the frames of all entities, but that would be too heavy processing, * so we publish the average of the coordinates of all entities. */ - if (isEgoSpawned()) { - if (const auto ego = getEntity(getEgoName())) { - if (!is_send) { - pose = ego->getMapPose(); - is_send = true; - } - broadcastTransform( - geometry_msgs::build() - /** + if (isAnyEgoSpawned()) { + if (!is_send) { + pose = getEgoEntity()->getMapPose(); + is_send = true; + } + broadcastTransform( + geometry_msgs::build() + /** * @note This is the intended implementation. * It is easier to create rviz config if the name "ego" is fixed, * so the frame_id "ego" is issued regardless of the name of the ego entity. */ - .header(std_msgs::build().stamp(clock_ptr_->now()).frame_id("ego")) - .pose(pose), - true); - } + .header(std_msgs::build().stamp(clock_ptr_->now()).frame_id("ego")) + .pose(pose), + true); } + if (!names.empty()) { if (!is_send) { pose = geometry_msgs::build() @@ -114,36 +112,21 @@ void EntityManager::broadcastTransform( } } -bool EntityManager::checkCollision( - const std::string & first_entity_name, const std::string & second_entity_name) -{ - if (first_entity_name != second_entity_name) { - if (const auto first_entity = getEntity(first_entity_name)) { - if (const auto second_entity = getEntity(second_entity_name)) { - return math::geometry::checkCollision2D( - first_entity->getMapPose(), first_entity->getBoundingBox(), second_entity->getMapPose(), - second_entity->getBoundingBox()); - } - } - } - return false; -} - visualization_msgs::msg::MarkerArray EntityManager::makeDebugMarker() const { visualization_msgs::msg::MarkerArray marker; - for (const auto & entity : entities_) { - entity.second->appendDebugMarker(marker); + for (const auto & [name, entity] : entities_) { + entity->appendDebugMarker(marker); } return marker; } bool EntityManager::despawnEntity(const std::string & name) { - return entityExists(name) && entities_.erase(name); + return isEntityExist(name) && entities_.erase(name); } -bool EntityManager::entityExists(const std::string & name) +auto EntityManager::isEntityExist(const std::string & name) const -> bool { return entities_.find(name) != std::end(entities_); } @@ -151,13 +134,13 @@ bool EntityManager::entityExists(const std::string & name) auto EntityManager::getEntityNames() const -> const std::vector { std::vector names{}; - for (const auto & each : entities_) { - names.push_back(each.first); + for (const auto & [name, entity] : entities_) { + names.push_back(name); } return names; } -auto EntityManager::getEntity(const std::string & name) const +auto EntityManager::getEntityOrNullptr(const std::string & name) const -> std::shared_ptr { if (auto it = entities_.find(name); it != entities_.end()) { @@ -167,36 +150,58 @@ auto EntityManager::getEntity(const std::string & name) const This method returns nullptr, due to the fact that the interpretation of the scenario operates in such a way that checking a condition, e.g. DistanceCondition, is called also for Entities that have not yet been spawned. For example, if for DistanceCondition any getEntity() returns - nullptr, the condition returns a distance equal to NaN. For this reason, throwing an exception - through getEntity() is not recommended. + nullptr, the condition returns a distance equal to NaN. For this reason, using getEntity() with + throwing an exception is not recommended. */ return nullptr; } }; -auto EntityManager::getEntityStatus(const std::string & name) const - -> const CanonicalizedEntityStatus & +auto EntityManager::getEntity(const std::string & name) const + -> std::shared_ptr +{ + if (const auto entity = getEntityOrNullptr(name)) { + return entity; + } else { + THROW_SEMANTIC_ERROR("Entity ", std::quoted(name), " does not exist."); + } +} + +auto EntityManager::getEgoEntity() const -> std::shared_ptr +{ + for (const auto & [name, entity] : entities_) { + if (entity->template is()) { + return std::dynamic_pointer_cast(entity); + } + } + THROW_SEMANTIC_ERROR("EgoEntity does not exist"); +} + +auto EntityManager::getEgoEntity(const std::string & name) const + -> std::shared_ptr { - if (const auto entity = getEntity(name)) { - return entity->getCanonicalizedStatus(); + if (auto it = entities_.find(name); it == entities_.end()) { + THROW_SEMANTIC_ERROR("Entity ", std::quoted(name), " does not exist."); } else { - THROW_SEMANTIC_ERROR("entity ", std::quoted(name), " does not exist."); + if (auto ego_entity = std::dynamic_pointer_cast(it->second); !ego_entity) { + THROW_SEMANTIC_ERROR("Entity : ", std::quoted(name), " exists, but it is not ego"); + } else + return ego_entity; } } auto EntityManager::getNumberOfEgo() const -> std::size_t { return std::count_if(std::begin(entities_), std::end(entities_), [this](const auto & each) { - return is(each.first); + return each.second->template is(); }); } -const std::string EntityManager::getEgoName() const +auto EntityManager::getEgoName() const -> const std::string & { - const auto names = getEntityNames(); - for (const auto & name : names) { - if (is(name)) { - return name; + for (const auto & [name, entity] : entities_) { + if (entity->template is()) { + return entity->getName(); } } THROW_SEMANTIC_ERROR( @@ -221,7 +226,7 @@ auto EntityManager::getPedestrianParameters(const std::string & name) const return entity->pedestrian_parameters; } THROW_SIMULATION_ERROR( - "EntityType: ", getEntityTypename(name), ", does not have pedestrian parameter.", + "EntityType: ", getEntity(name)->getEntityTypename(), ", does not have pedestrian parameter.", "Please check description of the scenario and entity type of the Entity: " + name); } @@ -232,7 +237,7 @@ auto EntityManager::getVehicleParameters(const std::string & name) const return vehicle->vehicle_parameters; } THROW_SIMULATION_ERROR( - "EntityType: ", getEntityTypename(name), ", does not have pedestrian parameter.", + "EntityType: ", getEntity(name)->getEntityTypename(), ", does not have pedestrian parameter.", "Please check description of the scenario and entity type of the Entity: " + name); } @@ -246,62 +251,32 @@ auto EntityManager::getWaypoints(const std::string & name) } } -bool EntityManager::isEgoSpawned() const -{ - for (const auto & name : getEntityNames()) { - if (is(name)) { - return true; - } - } - return false; -} - -bool EntityManager::isInLanelet( - const std::string & name, const lanelet::Id lanelet_id, const double tolerance) -{ - if (const auto entity = getEntity(name)) { - if (const auto canonicalized_lanelet_pose = entity->getCanonicalizedLaneletPose()) { - return pose::isInLanelet(canonicalized_lanelet_pose.value(), lanelet_id, tolerance); - } - } - return false; -} - -bool EntityManager::isStopping(const std::string & name) const -{ - return std::fabs(getCurrentTwist(name).linear.x) < std::numeric_limits::epsilon(); -} - -void EntityManager::requestLaneChange( - const std::string & name, const traffic_simulator::lane_change::Direction & direction) +auto EntityManager::isAnyEgoSpawned() const -> bool { - if (const auto entity = getEntity(name); entity && entity->laneMatchingSucceed()) { - if ( - const auto target = route::laneChangeableLaneletId( - entity->getCanonicalizedStatus().getLaneletId(), direction)) { - requestLaneChange(name, target.value()); - } - } + return std::any_of(std::begin(entities_), std::end(entities_), [this](const auto & each) { + return each.second->template is(); + }); } void EntityManager::resetBehaviorPlugin( const std::string & name, const std::string & behavior_plugin_name) { - const auto & status = getEntityStatus(name); - const auto behavior_parameter = getBehaviorParameter(name); - if (is(name)) { + const auto reference_entity = getEntity(name); + const auto status = reference_entity->getCanonicalizedStatus(); + const auto behavior_parameter = reference_entity->getBehaviorParameter(); + if (reference_entity->is()) { THROW_SEMANTIC_ERROR( "Entity :", name, "is EgoEntity.", "You cannot reset behavior plugin of EgoEntity."); - } else if (is(name)) { + } else if (reference_entity->is()) { THROW_SEMANTIC_ERROR( "Entity :", name, "is MiscObjectEntity.", "You cannot reset behavior plugin of MiscObjectEntity."); - } else if (is(name)) { + } else if (reference_entity->is()) { const auto parameters = getVehicleParameters(name); despawnEntity(name); spawnEntity( name, status.getMapPose(), parameters, status.getTime(), behavior_plugin_name); - } else if (is(name)) { + } else if (reference_entity->is()) { const auto parameters = getPedestrianParameters(name); despawnEntity(name); spawnEntity( @@ -310,30 +285,18 @@ void EntityManager::resetBehaviorPlugin( THROW_SIMULATION_ERROR( "Entity :", name, "is unkown entity type.", "Please contact to developer."); } - setLinearJerk(name, status.getLinearJerk()); - setAcceleration(name, status.getAccel()); - setTwist(name, status.getTwist()); - setBehaviorParameter(name, behavior_parameter); -} - -auto EntityManager::getCurrentAction(const std::string & name) const -> std::string -{ - if (const auto entity = getEntity(name)) { - if (not npc_logic_started_ and not is(name)) { - return "waiting"; - } else { - return entity->getCurrentAction(); - } - } else { - THROW_SEMANTIC_ERROR("entity : ", name, "does not exist"); - } + auto spawned_entity = getEntity(name); + spawned_entity->setLinearJerk(status.getLinearJerk()); + spawned_entity->setAcceleration(status.getAccel()); + spawned_entity->setTwist(status.getTwist()); + spawned_entity->setBehaviorParameter(behavior_parameter); } void EntityManager::setVerbose(const bool verbose) { configuration.verbose = verbose; - for (auto & entity : entities_) { - entity.second->verbose = verbose; + for (const auto & [name, entity] : entities_) { + entity->verbose = verbose; } } @@ -344,17 +307,14 @@ auto EntityManager::updateNpcLogic( if (configuration.verbose) { std::cout << "update " << name << " behavior" << std::endl; } - if (const auto entity = getEntity(name)) { - // Update npc completely if logic has started, otherwise update Autoware only - if it is Ego - if (npc_logic_started_) { - entity->onUpdate(current_time, step_time); - } else if (const auto ego_entity = std::dynamic_pointer_cast(entity)) { - ego_entity->updateFieldOperatorApplication(); - } - return entity->getCanonicalizedStatus(); - } else { - THROW_SEMANTIC_ERROR("entity ", std::quoted(name), " does not exist."); + const auto entity = getEntity(name); + // Update npc completely if logic has started, otherwise update Autoware only - if it is Ego + if (npc_logic_started_) { + entity->onUpdate(current_time, step_time); + } else if (const auto ego_entity = std::dynamic_pointer_cast(entity)) { + ego_entity->updateFieldOperatorApplication(); } + return entity->getCanonicalizedStatus(); } void EntityManager::update(const double current_time, const double step_time) diff --git a/simulation/traffic_simulator/src/entity/pedestrian_entity.cpp b/simulation/traffic_simulator/src/entity/pedestrian_entity.cpp index 41e1ed63cc2..279c20871b3 100644 --- a/simulation/traffic_simulator/src/entity/pedestrian_entity.cpp +++ b/simulation/traffic_simulator/src/entity/pedestrian_entity.cpp @@ -51,7 +51,7 @@ void PedestrianEntity::appendDebugMarker(visualization_msgs::msg::MarkerArray & void PedestrianEntity::requestAssignRoute(const std::vector & waypoints) { - if (!laneMatchingSucceed()) { + if (!isInLanelet()) { return; } behavior_plugin_ptr_->setRequest(behavior::Request::FOLLOW_LANE); @@ -134,7 +134,7 @@ void PedestrianEntity::requestWalkStraight() void PedestrianEntity::requestAcquirePosition(const CanonicalizedLaneletPose & lanelet_pose) { behavior_plugin_ptr_->setRequest(behavior::Request::FOLLOW_LANE); - if (status_->laneMatchingSucceed()) { + if (status_->isInLanelet()) { route_planner_.setWaypoints({lanelet_pose}); } behavior_plugin_ptr_->setGoalPoses({static_cast(lanelet_pose)}); diff --git a/simulation/traffic_simulator/src/entity/vehicle_entity.cpp b/simulation/traffic_simulator/src/entity/vehicle_entity.cpp index 390d3ab91ae..90104092564 100644 --- a/simulation/traffic_simulator/src/entity/vehicle_entity.cpp +++ b/simulation/traffic_simulator/src/entity/vehicle_entity.cpp @@ -115,7 +115,7 @@ auto VehicleEntity::getWaypoints() -> const traffic_simulator_msgs::msg::Waypoin try { return behavior_plugin_ptr_->getWaypoints(); } catch (const std::runtime_error & e) { - if (not status_->laneMatchingSucceed()) { + if (not status_->isInLanelet()) { THROW_SIMULATION_ERROR( "Failed to calculate waypoints in NPC logics, please check Entity : ", name, " is in a lane coordinate."); @@ -160,7 +160,7 @@ auto VehicleEntity::onUpdate(const double current_time, const double step_time) void VehicleEntity::requestAcquirePosition(const CanonicalizedLaneletPose & lanelet_pose) { behavior_plugin_ptr_->setRequest(behavior::Request::FOLLOW_LANE); - if (status_->laneMatchingSucceed()) { + if (status_->isInLanelet()) { route_planner_.setWaypoints({lanelet_pose}); } behavior_plugin_ptr_->setGoalPoses({static_cast(lanelet_pose)}); @@ -181,7 +181,7 @@ void VehicleEntity::requestAcquirePosition(const geometry_msgs::msg::Pose & map_ void VehicleEntity::requestAssignRoute(const std::vector & waypoints) { - if (!laneMatchingSucceed()) { + if (!isInLanelet()) { return; } behavior_plugin_ptr_->setRequest(behavior::Request::FOLLOW_LANE); @@ -230,7 +230,7 @@ auto VehicleEntity::requestFollowTrajectory( route_planner_.setWaypoints(waypoints); } -void VehicleEntity::requestLaneChange(const lanelet::Id to_lanelet_id) +auto VehicleEntity::requestLaneChange(const lanelet::Id to_lanelet_id) -> void { behavior_plugin_ptr_->setRequest(behavior::Request::LANE_CHANGE); const auto parameter = lane_change::Parameter( @@ -239,7 +239,8 @@ void VehicleEntity::requestLaneChange(const lanelet::Id to_lanelet_id) behavior_plugin_ptr_->setLaneChangeParameters(parameter); } -void VehicleEntity::requestLaneChange(const traffic_simulator::lane_change::Parameter & parameter) +auto VehicleEntity::requestLaneChange(const traffic_simulator::lane_change::Parameter & parameter) + -> void { behavior_plugin_ptr_->setRequest(behavior::Request::LANE_CHANGE); behavior_plugin_ptr_->setLaneChangeParameters(parameter); diff --git a/simulation/traffic_simulator/src/lanelet_wrapper/distance.cpp b/simulation/traffic_simulator/src/lanelet_wrapper/distance.cpp index 6702625f172..a206b1b152e 100644 --- a/simulation/traffic_simulator/src/lanelet_wrapper/distance.cpp +++ b/simulation/traffic_simulator/src/lanelet_wrapper/distance.cpp @@ -139,25 +139,20 @@ auto longitudinalDistance( auto distanceToStopLine(const lanelet::Ids & route_lanelets, const SplineInterface & route_spline) -> std::optional { - if (route_spline.getLength() <= 0) { + if (route_spline.getLength() <= 0.0) { return std::nullopt; } else { - std::vector collision_points; - // fill in collision_points using stop_lines - const auto stop_lines = lanelet_wrapper::lanelet_map::stopLinesOnPath({route_lanelets}); + std::optional min_distance{std::nullopt}; + const auto & stop_lines = lanelet_wrapper::lanelet_map::stopLinesOnPath({route_lanelets}); for (const auto & stop_line : stop_lines) { - std::vector stop_line_points; - for (const auto & point : stop_line) { - stop_line_points.emplace_back( - geometry_msgs::build().x(point.x()).y(point.y()).z(point.z())); - } - if (const auto collision_point = route_spline.getCollisionPointIn2D(stop_line_points)) { - collision_points.push_back(collision_point.value()); + const auto & stop_line_points = lanelet_wrapper::lanelet_map::toPolygon(stop_line); + if (const auto & collision_point = route_spline.getCollisionPointIn2D(stop_line_points)) { + if (not min_distance.has_value() or collision_point.value() < min_distance.value()) { + min_distance = collision_point; + } } } - return collision_points.empty() - ? std::nullopt - : std::optional(*std::min_element(collision_points.begin(), collision_points.end())); + return min_distance; } } @@ -184,7 +179,7 @@ auto distanceToStopLine(const std::vector & route_waypoints, const lanele } } -// TrafficLigthStopLine +// TrafficLightStopLine auto distanceToTrafficLightStopLine( const SplineInterface & route_spline, const lanelet::Id traffic_light_id) -> std::optional { @@ -216,21 +211,22 @@ auto distanceToTrafficLightStopLine( const lanelet::Ids & route_lanelets, const SplineInterface & route_spline) -> std::optional { - if (auto traffic_light_ids = + if (const auto & traffic_light_ids = lanelet_wrapper::traffic_lights::trafficLightIdsOnPath(route_lanelets); traffic_light_ids.empty()) { return std::nullopt; } else { - std::vector collision_points; + std::optional min_distance{std::nullopt}; for (const auto traffic_light_id : traffic_light_ids) { - const auto collision_point = distanceToTrafficLightStopLine(route_spline, traffic_light_id); - if (collision_point) { - collision_points.push_back(collision_point.value()); + if ( + const auto & collision_point = + distanceToTrafficLightStopLine(route_spline, traffic_light_id)) { + if (not min_distance.has_value() or collision_point.value() < min_distance.value()) { + min_distance = collision_point; + } } } - return collision_points.empty() - ? std::nullopt - : std::optional(*std::min_element(collision_points.begin(), collision_points.end())); + return min_distance; } } @@ -238,7 +234,11 @@ auto distanceToTrafficLightStopLine( const lanelet::Ids & route_lanelets, const std::vector & route_waypoints) -> std::optional { - return distanceToTrafficLightStopLine(route_lanelets, Spline{route_waypoints}); + if (route_waypoints.empty()) { + return std::nullopt; + } else { + return distanceToTrafficLightStopLine(route_lanelets, Spline{route_waypoints}); + } } // Crosswalk diff --git a/simulation/traffic_simulator/src/lanelet_wrapper/lanelet_map.cpp b/simulation/traffic_simulator/src/lanelet_wrapper/lanelet_map.cpp index f2da5d01f76..0061722634a 100644 --- a/simulation/traffic_simulator/src/lanelet_wrapper/lanelet_map.cpp +++ b/simulation/traffic_simulator/src/lanelet_wrapper/lanelet_map.cpp @@ -85,7 +85,9 @@ auto laneletAltitude( auto laneletIds() -> lanelet::Ids { lanelet::Ids ids; - for (const auto & lanelet : LaneletWrapper::map()->laneletLayer) { + const auto & lanelet_layer = LaneletWrapper::map()->laneletLayer; + ids.reserve(lanelet_layer.size()); + for (const auto & lanelet : lanelet_layer) { ids.push_back(lanelet.id()); } return ids; @@ -156,7 +158,7 @@ auto nearbyLaneletIds( lanelet::Ids target_lanelet_ids; for (const auto & [distance, lanelet] : nearest_lanelets) { if (distance <= distance_threshold) { - target_lanelet_ids.emplace_back(lanelet.id()); + target_lanelet_ids.push_back(lanelet.id()); } } return target_lanelet_ids; @@ -171,9 +173,10 @@ auto centerPoints(const lanelet::Ids & lanelet_ids) -> std::vector } else { std::vector center_points; for (const auto & lanelet_id : lanelet_ids) { - auto points = centerPoints(lanelet_id); + const auto & points = centerPoints(lanelet_id); center_points.insert(center_points.end(), points.begin(), points.end()); } + /// @note We intentionally do not sort here, because only consecutive duplicates are supposed to be removed center_points.erase( std::unique(center_points.begin(), center_points.end()), center_points.end()); return center_points; @@ -195,8 +198,10 @@ auto centerPointsSpline(const lanelet::Id lanelet_id) -> std::shared_ptr auto nextLaneletIds(const lanelet::Id lanelet_id, const RoutingGraphType type) -> lanelet::Ids { lanelet::Ids next_lanelet_ids; - const auto lanelet = LaneletWrapper::map()->laneletLayer.get(lanelet_id); - for (const auto & following_lanelet : LaneletWrapper::routingGraph(type)->following(lanelet)) { + const auto & lanelet = LaneletWrapper::map()->laneletLayer.get(lanelet_id); + const auto & following_lanelets = LaneletWrapper::routingGraph(type)->following(lanelet); + next_lanelet_ids.reserve(following_lanelets.size()); + for (const auto & following_lanelet : following_lanelets) { next_lanelet_ids.push_back(following_lanelet.id()); } return next_lanelet_ids; @@ -206,7 +211,7 @@ auto nextLaneletIds(const lanelet::Ids & lanelet_ids, const RoutingGraphType typ { std::set next_lanelet_ids_set; for (const auto & lanelet_id : lanelet_ids) { - auto next_lanelet_ids = nextLaneletIds(lanelet_id, type); + const auto & next_lanelet_ids = nextLaneletIds(lanelet_id, type); next_lanelet_ids_set.insert(next_lanelet_ids.begin(), next_lanelet_ids.end()); } return lanelet::Ids(next_lanelet_ids_set.begin(), next_lanelet_ids_set.end()); @@ -243,8 +248,10 @@ auto nextLaneletIds( auto previousLaneletIds(const lanelet::Id lanelet_id, const RoutingGraphType type) -> lanelet::Ids { lanelet::Ids previous_lanelet_ids; - const auto lanelet = LaneletWrapper::map()->laneletLayer.get(lanelet_id); - for (const auto & previous_lanelet : LaneletWrapper::routingGraph(type)->previous(lanelet)) { + const auto & lanelet = LaneletWrapper::map()->laneletLayer.get(lanelet_id); + const auto & previous_lanelets = LaneletWrapper::routingGraph(type)->previous(lanelet); + previous_lanelet_ids.reserve(previous_lanelets.size()); + for (const auto & previous_lanelet : previous_lanelets) { previous_lanelet_ids.push_back(previous_lanelet.id()); } return previous_lanelet_ids; @@ -255,7 +262,7 @@ auto previousLaneletIds(const lanelet::Ids & lanelet_ids, const RoutingGraphType { std::set previous_lanelet_ids_set; for (const auto & lanelet_id : lanelet_ids) { - auto previous_lanelet_ids = previousLaneletIds(lanelet_id, type); + const auto & previous_lanelet_ids = previousLaneletIds(lanelet_id, type); previous_lanelet_ids_set.insert(previous_lanelet_ids.begin(), previous_lanelet_ids.end()); } return lanelet::Ids(previous_lanelet_ids_set.begin(), previous_lanelet_ids_set.end()); @@ -304,8 +311,9 @@ auto laneletPolygon(const lanelet::Id lanelet_id) -> std::vector { std::vector points; const auto & lanelet_polygon = LaneletWrapper::map()->laneletLayer.get(lanelet_id).polygon3d(); + points.reserve(lanelet_polygon.size()); for (const auto & point : lanelet_polygon) { - points.emplace_back(geometry_msgs::build().x(point.x()).y(point.y()).z(point.z())); + points.push_back(geometry_msgs::build().x(point.x()).y(point.y()).z(point.z())); } return points; } @@ -319,8 +327,9 @@ auto stopLinePolygon(const lanelet::Id lanelet_id) -> std::vector auto toPolygon(const lanelet::ConstLineString3d & line_string) -> std::vector { std::vector points; + points.reserve(line_string.size()); for (const auto & point : line_string) { - points.emplace_back(geometry_msgs::build().x(point.x()).y(point.y()).z(point.z())); + points.push_back(geometry_msgs::build().x(point.x()).y(point.y()).z(point.z())); } return points; } @@ -390,10 +399,10 @@ auto trafficSignsOnPath(const lanelet::Ids & lanelet_ids) { std::vector> ret; for (const auto & lanelet_id : lanelet_ids) { - const auto lanelet = LaneletWrapper::map()->laneletLayer.get(lanelet_id); - const auto traffic_signs = lanelet.regulatoryElementsAs(); + const auto & lanelet = LaneletWrapper::map()->laneletLayer.get(lanelet_id); + const auto & traffic_signs = lanelet.regulatoryElementsAs(); for (const auto & traffic_sign : traffic_signs) { - ret.emplace_back(traffic_sign); + ret.push_back(traffic_sign); } } return ret; @@ -414,7 +423,9 @@ auto stopLinesOnPath(const lanelet::Ids & lanelet_ids) -> lanelet::ConstLineStri auto stopLineIdsOnPath(const lanelet::Ids & lanelet_ids) -> lanelet::Ids { lanelet::Ids stop_line_ids; - for (const auto & ret : stopLinesOnPath(lanelet_ids)) { + const auto & stop_lines = stopLinesOnPath(lanelet_ids); + stop_line_ids.reserve(stop_lines.size()); + for (const auto & ret : stop_lines) { stop_line_ids.push_back(ret.id()); } return stop_line_ids; diff --git a/simulation/traffic_simulator/src/lanelet_wrapper/traffic_lights.cpp b/simulation/traffic_simulator/src/lanelet_wrapper/traffic_lights.cpp index 8349e161690..d780b8ed8fa 100644 --- a/simulation/traffic_simulator/src/lanelet_wrapper/traffic_lights.cpp +++ b/simulation/traffic_simulator/src/lanelet_wrapper/traffic_lights.cpp @@ -46,7 +46,7 @@ auto trafficLightIds() -> lanelet::Ids lanelet::utils::query::autowareTrafficLights(all_lanelets)) { for (auto & three_light_bulbs : autoware_traffic_light->lightBulbs()) { if (three_light_bulbs.hasAttribute("traffic_light_id")) { - if (auto id = three_light_bulbs.attribute("traffic_light_id").asId()) { + if (const auto & id = three_light_bulbs.attribute("traffic_light_id").asId()) { ids.emplace_back(id.value()); } } @@ -70,7 +70,8 @@ auto toTrafficLightRegulatoryElement(const lanelet::Id traffic_light_regulatory_ auto toAutowareTrafficLights(const lanelet::Id traffic_light_id) -> std::vector { - auto areBulbsAssignedToTrafficLight = [traffic_light_id](auto red_yellow_green_bulbs) -> bool { + auto areBulbsAssignedToTrafficLight = + [traffic_light_id](const auto & red_yellow_green_bulbs) -> bool { return red_yellow_green_bulbs.hasAttribute("traffic_light_id") and red_yellow_green_bulbs.attribute("traffic_light_id").asId() and red_yellow_green_bulbs.attribute("traffic_light_id").asId().value() == traffic_light_id; @@ -81,10 +82,9 @@ auto toAutowareTrafficLights(const lanelet::Id traffic_light_id) const auto & all_lanelets = lanelet::utils::query::laneletLayer(LaneletWrapper::map()); for (const auto & autoware_traffic_light : lanelet::utils::query::autowareTrafficLights(all_lanelets)) { - for (auto three_light_bulbs : autoware_traffic_light->lightBulbs()) { - if (areBulbsAssignedToTrafficLight(three_light_bulbs)) { - autoware_traffic_lights.push_back(autoware_traffic_light); - } + if (const auto & light_bulbs = autoware_traffic_light->lightBulbs(); + std::any_of(light_bulbs.cbegin(), light_bulbs.cend(), areBulbsAssignedToTrafficLight)) { + autoware_traffic_lights.push_back(autoware_traffic_light); } } @@ -100,13 +100,14 @@ auto toAutowareTrafficLights(const lanelet::Id traffic_light_id) auto trafficLightBulbPosition(const lanelet::Id traffic_light_id, const std::string & color_name) -> std::optional { - auto areBulbsAssignedToTrafficLight = [traffic_light_id](auto red_yellow_green_bulbs) -> bool { + auto areBulbsAssignedToTrafficLight = + [traffic_light_id](const auto & red_yellow_green_bulbs) -> bool { return red_yellow_green_bulbs.hasAttribute("traffic_light_id") and red_yellow_green_bulbs.attribute("traffic_light_id").asId() and red_yellow_green_bulbs.attribute("traffic_light_id").asId().value() == traffic_light_id; }; - auto isBulbOfExpectedColor = [color_name](auto bulb) -> bool { + auto isBulbOfExpectedColor = [&color_name](const auto & bulb) -> bool { return bulb.hasAttribute("color") and !bulb.hasAttribute("arrow") and bulb.attribute("color").value().compare(color_name) == 0; }; diff --git a/simulation/traffic_simulator/src/utils/distance.cpp b/simulation/traffic_simulator/src/utils/distance.cpp index 1bdfeeb2600..69c2f211fc9 100644 --- a/simulation/traffic_simulator/src/utils/distance.cpp +++ b/simulation/traffic_simulator/src/utils/distance.cpp @@ -346,10 +346,9 @@ auto distanceToNearestConflictingPose( lanelet_wrapper::lanelet_map::conflictingCrosswalkIds(following_lanelets); for (const auto & status : other_statuses) { if ( - status.laneMatchingSucceed() && - std::count( - conflicting_crosswalks.begin(), conflicting_crosswalks.end(), status.getLaneletId()) >= - 1) { + status.isInLanelet() && std::count( + conflicting_crosswalks.begin(), conflicting_crosswalks.end(), + status.getLaneletId()) >= 1) { conflicting_entity_status.emplace_back(status); } } @@ -364,7 +363,7 @@ auto distanceToNearestConflictingPose( lanelet_wrapper::lanelet_map::conflictingLaneIds(following_lanelets); for (const auto & status : other_statuses) { if ( - status.laneMatchingSucceed() && + status.isInLanelet() && std::count(conflicting_lanes.begin(), conflicting_lanes.end(), status.getLaneletId()) >= 1) { conflicting_entity_status.emplace_back(status); diff --git a/simulation/traffic_simulator/test/src/entity/test_misc_object_entity.cpp b/simulation/traffic_simulator/test/src/entity/test_misc_object_entity.cpp index ccd420b163b..bd556448749 100644 --- a/simulation/traffic_simulator/test/src/entity/test_misc_object_entity.cpp +++ b/simulation/traffic_simulator/test/src/entity/test_misc_object_entity.cpp @@ -264,14 +264,6 @@ TEST_F(MiscObjectEntityTest_FullObject, appendDebugMarker) } } -/** - * @note Test basic functionality; test whether the function throws an error. - */ -TEST_F(MiscObjectEntityTest_FullObject, asFieldOperatorApplication) -{ - EXPECT_THROW(misc_object.asFieldOperatorApplication(), common::Error); -} - /** * @note Test functionality used by other units; test correctness of 2d polygon calculations. */ diff --git a/simulation/traffic_simulator_msgs/CHANGELOG.rst b/simulation/traffic_simulator_msgs/CHANGELOG.rst index 77be0a39e36..30f501f76f2 100644 --- a/simulation/traffic_simulator_msgs/CHANGELOG.rst +++ b/simulation/traffic_simulator_msgs/CHANGELOG.rst @@ -21,6 +21,71 @@ Changelog for package openscenario_msgs * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/simulation/traffic_simulator_msgs/package.xml b/simulation/traffic_simulator_msgs/package.xml index bea2365d6ac..7effa128b20 100644 --- a/simulation/traffic_simulator_msgs/package.xml +++ b/simulation/traffic_simulator_msgs/package.xml @@ -2,7 +2,7 @@ traffic_simulator_msgs - 7.4.7 + 9.0.3 ROS messages for openscenario Masaya Kataoka Apache License 2.0 diff --git a/test_runner/random_test_runner/CHANGELOG.rst b/test_runner/random_test_runner/CHANGELOG.rst index f7f7152ea39..5c6f5af2dec 100644 --- a/test_runner/random_test_runner/CHANGELOG.rst +++ b/test_runner/random_test_runner/CHANGELOG.rst @@ -21,6 +21,92 @@ Changelog for package random_test_runner * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* Merge pull request `#1473 `_ from tier4/RJD-1057-remove-functions-forwarded-to-entity-base-middle + RJD-1057 (3/5): Remove non-API member functions: EntityManager’s member functions forwarded to EntityBase (1/2) +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Revert "move functions from EgoEntity to FieldOperatorApplication" + This reverts commit 8d90c0e2c2f66795f299859bfa675ef2f11abdd3. +* move functions from EgoEntity to FieldOperatorApplication +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator): rename isEntitySpawned to isEntityExist +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* ref(traffic_simulator): improve requestLaneChange, getEgoName +* ref(behavior_tree,traffic_simulator): improve code by basing on sonarcloud +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Fix random_test_runner +* feat(simulator_core, api, entity_base, cpp_mock): move setEntityStatus to EntityBase, remove from api +* feat(ego_entity, sumulator_core): remove asFieldOperatorApplication, develop getEgoEntity and dedicated methods in EgoEntity +* feat(api, entity_manager, cpp_mock): rename entityExist to isEntitySpawned, move checkCollision directly to API +* feat(entity_base, traffic_simulator, simulator_core): remove forwarding request*, move requestLaneChange to EntityBase +* feat(entity_base, traffic_simulator): move isStopping to EntityBase, develop templated is() in EntityBase and use it, rename isEgoSpawned to isAnyEgoSpawned, refactor +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* feat(cpp_mock, traffic_simulator): change getEntity, use getEntityOrNullptr +* Remove forwarding of getEntityStatus in EntityManager and API +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge pull request `#1472 `_ from tier4/ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose + HdMapUtils refactor (PR 1/6) - create lanelet_wrapper: use ::lanelet_map and ::pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* ref(traffic_simulator): improve Configuration, traffic_rules, lanelet_wrapper +* feat(traffic_simulator, behavior_tree_plugin): use lanelet_wrapper::pose in parts previously overlooked +* feat(traffic_simulator, random_test_runner): adapt tests for using pose:: from lanelet_wrapper +* Contributors: Dawid Moszynski, Dawid Moszyński, Masaya Kataoka, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/test_runner/random_test_runner/include/random_test_runner/metrics/almost_standstill_metric.hpp b/test_runner/random_test_runner/include/random_test_runner/metrics/almost_standstill_metric.hpp index 5235ff0f1c0..dfde759f34a 100644 --- a/test_runner/random_test_runner/include/random_test_runner/metrics/almost_standstill_metric.hpp +++ b/test_runner/random_test_runner/include/random_test_runner/metrics/almost_standstill_metric.hpp @@ -28,7 +28,7 @@ class AlmostStandstillMetric bool isAlmostStandingStill(const traffic_simulator::CanonicalizedEntityStatus & status) { if (!last_status_) { - last_status_ = status; + last_status_.emplace(status); return false; } @@ -43,7 +43,7 @@ class AlmostStandstillMetric almost_standstill_time_ = 0.0; } - last_status_ = status; + last_status_->set(status); if (almost_standstill_time_ > almost_standstill_timeout_) { return true; diff --git a/test_runner/random_test_runner/include/random_test_runner/test_executor.hpp b/test_runner/random_test_runner/include/random_test_runner/test_executor.hpp index fa426092b46..a81e3a2b9f9 100644 --- a/test_runner/random_test_runner/include/random_test_runner/test_executor.hpp +++ b/test_runner/random_test_runner/include/random_test_runner/test_executor.hpp @@ -92,8 +92,11 @@ class TestExecutor api_->spawn( ego_name_, ego_start_canonicalized_lanelet_pose.value(), getVehicleParameters(), traffic_simulator::VehicleBehavior::autoware(), "lexus_rx450h"); - api_->setEntityStatus( - ego_name_, ego_start_canonicalized_lanelet_pose.value(), + + auto ego_entity = api_->getEgoEntity(ego_name_); + + ego_entity->setStatus( + ego_start_canonicalized_lanelet_pose.value(), traffic_simulator::helper::constructActionStatus()); if (architecture_type_ == ArchitectureType::AWF_UNIVERSE) { @@ -120,38 +123,40 @@ class TestExecutor return configuration; }()); - api_->asFieldOperatorApplication(ego_name_).template declare_parameter( - "allow_goal_modification", true); + ego_entity->template setParameter("allow_goal_modification", true); } - } - // XXX dirty hack: wait for autoware system to launch - // ugly but helps for now - std::this_thread::sleep_for(std::chrono::milliseconds{5000}); - - api_->requestAssignRoute(ego_name_, std::vector({test_description_.ego_goal_pose})); - api_->asFieldOperatorApplication(ego_name_).engage(); - - goal_reached_metric_.setGoal(test_description_.ego_goal_pose); - - for (size_t i = 0; i < test_description_.npcs_descriptions.size(); i++) { - const auto & npc_descr = test_description_.npcs_descriptions[i]; - if (const auto npc_start_canonicalized_lanelet_pose = - traffic_simulator::pose::toCanonicalizedLaneletPose(npc_descr.start_position); - !npc_start_canonicalized_lanelet_pose) { - throw std::runtime_error( - "Can not canonicalize npc start lanelet pose: id: " + - std::to_string(npc_descr.start_position.lanelet_id) + - " s: " + std::to_string(npc_descr.start_position.s) + - " offset: " + std::to_string(npc_descr.start_position.offset)); - } else { - api_->spawn( - npc_descr.name, npc_start_canonicalized_lanelet_pose.value(), getVehicleParameters(), - traffic_simulator::VehicleBehavior::defaultBehavior(), "taxi"); - api_->setEntityStatus( - npc_descr.name, npc_start_canonicalized_lanelet_pose.value(), - traffic_simulator::helper::constructActionStatus(npc_descr.speed)); - api_->requestSpeedChange(npc_descr.name, npc_descr.speed, true); + // XXX dirty hack: wait for autoware system to launch + // ugly but helps for now + std::this_thread::sleep_for(std::chrono::milliseconds{5000}); + + ego_entity->requestAssignRoute(std::vector({test_description_.ego_goal_pose})); + ego_entity->engage(); + + goal_reached_metric_.setGoal(test_description_.ego_goal_pose); + + for (const auto & npc_descr : test_description_.npcs_descriptions) { + if (const auto npc_start_canonicalized_lanelet_pose = + traffic_simulator::pose::toCanonicalizedLaneletPose(npc_descr.start_position); + not npc_start_canonicalized_lanelet_pose.has_value()) { + throw std::runtime_error( + "Can not canonicalize npc start lanelet pose: id: " + + std::to_string(npc_descr.start_position.lanelet_id) + + " s: " + std::to_string(npc_descr.start_position.s) + + " offset: " + std::to_string(npc_descr.start_position.offset)); + } else { + api_->spawn( + npc_descr.name, npc_start_canonicalized_lanelet_pose.value(), getVehicleParameters(), + traffic_simulator::VehicleBehavior::defaultBehavior(), "taxi"); + + auto entity = api_->getEntity(npc_descr.name); + + entity->setStatus( + npc_start_canonicalized_lanelet_pose.value(), + traffic_simulator::helper::constructActionStatus(npc_descr.speed)); + + entity->requestSpeedChange(npc_descr.speed, true); + } } } }); @@ -160,25 +165,29 @@ class TestExecutor auto update() -> void { executeWithErrorHandling([this]() { - if (not api_->isEgoSpawned() and not api_->isNpcLogicStarted()) { - api_->startNpcLogic(); - } - if ( - api_->isEgoSpawned() and not api_->isNpcLogicStarted() and - api_->asFieldOperatorApplication(api_->getEgoName()).engageable()) { - api_->startNpcLogic(); + if (!api_->isNpcLogicStarted()) { + if (api_->isAnyEgoSpawned()) { + auto ego_entity = api_->getEgoEntity(ego_name_); + if (ego_entity->isEngageable()) { + api_->startNpcLogic(); + } + } else { + api_->startNpcLogic(); + } } auto current_time = api_->getCurrentTime(); if (!std::isnan(current_time)) { - if (goal_reached_metric_.isGoalReached(api_->getEntityStatus(ego_name_))) { + if (goal_reached_metric_.isGoalReached( + api_->getEntity(ego_name_)->getCanonicalizedStatus())) { scenario_completed_ = true; } bool timeout_reached = current_time >= test_timeout_; if (timeout_reached) { - if (!goal_reached_metric_.isGoalReached(api_->getEntityStatus(ego_name_))) { + if (!goal_reached_metric_.isGoalReached( + api_->getEntity(ego_name_)->getCanonicalizedStatus())) { RCLCPP_INFO(logger_, "Timeout reached"); error_reporter_.reportTimeout(); } @@ -188,7 +197,7 @@ class TestExecutor } for (const auto & npc : test_description_.npcs_descriptions) { - if (api_->entityExists(npc.name) && api_->checkCollision(ego_name_, npc.name)) { + if (api_->isEntityExist(npc.name) && api_->checkCollision(ego_name_, npc.name)) { if (ego_collision_metric_.isThereEgosCollisionWith(npc.name, current_time)) { std::string message = fmt::format("New collision occurred between ego and {}", npc.name); @@ -198,9 +207,11 @@ class TestExecutor } } - if (almost_standstill_metric_.isAlmostStandingStill(api_->getEntityStatus(ego_name_))) { + if (almost_standstill_metric_.isAlmostStandingStill( + api_->getEntity(ego_name_)->getCanonicalizedStatus())) { RCLCPP_INFO(logger_, "Standstill duration exceeded"); - if (goal_reached_metric_.isGoalReached(api_->getEntityStatus(ego_name_))) { + if (goal_reached_metric_.isGoalReached( + api_->getEntity(ego_name_)->getCanonicalizedStatus())) { RCLCPP_INFO(logger_, "Goal reached, standstill expected"); } else { error_reporter_.reportStandStill(); diff --git a/test_runner/random_test_runner/package.xml b/test_runner/random_test_runner/package.xml index 4a893f77a61..ab12db08c5c 100644 --- a/test_runner/random_test_runner/package.xml +++ b/test_runner/random_test_runner/package.xml @@ -2,7 +2,7 @@ random_test_runner - 7.4.7 + 9.0.3 Random behavior test runner piotr-zyskowski-rai Apache License 2.0 diff --git a/test_runner/random_test_runner/test/test_test_executor.cpp b/test_runner/random_test_runner/test/test_test_executor.cpp index 37c632de303..88181754f1e 100644 --- a/test_runner/random_test_runner/test/test_test_executor.cpp +++ b/test_runner/random_test_runner/test/test_test_executor.cpp @@ -17,6 +17,39 @@ #include #include +#include +#include + +/// This class is for all entities to keep it simple +class MockEntity +{ +public: + MOCK_METHOD( + void, setStatus, + (const std::optional &, + const traffic_simulator_msgs::msg::ActionStatus &), + ()); + MOCK_METHOD(void, requestSpeedChange, (double, bool), ()); + MOCK_METHOD( + const traffic_simulator::CanonicalizedEntityStatus &, getCanonicalizedStatus, (), (const)); + + // Ego member functions + MOCK_METHOD(void, engage, (), ()); + MOCK_METHOD(bool, isEngageable, (), (const)); + MOCK_METHOD(bool, setParameterMock, (const std::string &, const bool &), (const)); + MOCK_METHOD(void, requestAssignRoute, (const std::vector &), ()); + + template + auto setParameter(const std::string & name, const ParameterType & default_value = {}) const + -> ParameterType + { + if constexpr (std::is_same_v) { + setParameterMock(name, default_value); + return default_value; + } + throw std::runtime_error("Unexpected typename in MockEntity::setParameter function"); + } +}; class MockFieldOperatorApplication { @@ -84,17 +117,11 @@ class MockTrafficSimulatorAPI (const std::string &, const traffic_simulator::CanonicalizedLaneletPose &, const traffic_simulator_msgs::msg::VehicleParameters &, const std::string &, std::string), ()); - MOCK_METHOD( - void, setEntityStatus, - (const std::string &, const traffic_simulator::CanonicalizedLaneletPose &, - const traffic_simulator_msgs::msg::ActionStatus), - ()); MOCK_METHOD(void, attachLidarSensor, (const simulation_api_schema::LidarConfiguration &), ()); MOCK_METHOD( void, attachDetectionSensor, (const simulation_api_schema::DetectionSensorConfiguration &), ()); MOCK_METHOD( bool, attachOccupancyGridSensor, (simulation_api_schema::OccupancyGridSensorConfiguration), ()); - MOCK_METHOD(void, asFieldOperatorApplicationMock, (const std::string &), ()); MOCK_METHOD( void, requestAssignRoute, (const std::string &, std::vector), ()); MOCK_METHOD( @@ -102,44 +129,52 @@ class MockTrafficSimulatorAPI (const std::string &, const traffic_simulator::CanonicalizedLaneletPose &, const traffic_simulator_msgs::msg::VehicleParameters &), ()); - MOCK_METHOD(void, requestSpeedChange, (const std::string &, double, bool), ()); - MOCK_METHOD(bool, isEgoSpawned, (), ()); + MOCK_METHOD(bool, isAnyEgoSpawned, (), ()); MOCK_METHOD(bool, isNpcLogicStarted, (), ()); MOCK_METHOD(void, startNpcLogic, (), ()); MOCK_METHOD(bool, despawn, (const std::string), ()); MOCK_METHOD(std::string, getEgoName, (), ()); MOCK_METHOD(double, getCurrentTime, (), ()); - MOCK_METHOD(void, getEntityStatusMock, (const std::string &), ()); - MOCK_METHOD(bool, entityExists, (const std::string &), ()); + MOCK_METHOD(void, getEntityMock, (const std::string &), (const)); + MOCK_METHOD(void, getEgoEntityMock, (const std::string &), (const)); + MOCK_METHOD(bool, isEntityExist, (const std::string &), ()); MOCK_METHOD(bool, checkCollision, (const std::string &, const std::string &), ()); - ::testing::StrictMock & asFieldOperatorApplication( - const std::string & name) + auto getEntity(const std::string & name) const + -> std::shared_ptr<::testing::StrictMock> { - asFieldOperatorApplicationMock(name); - return *field_operator_application_mock; + getEntityMock(name); + if (name == ego_name_) { + return ego_entity_; + } + return std::make_shared<::testing::StrictMock>(); } - traffic_simulator::CanonicalizedEntityStatus getEntityStatus(const std::string & name) + auto getEgoEntity(const std::string & name) const + -> std::shared_ptr<::testing::StrictMock> { - getEntityStatusMock(name); - /// @note set invalid LaneletPose so pass std::nullopt - return traffic_simulator::CanonicalizedEntityStatus(entity_status_, std::nullopt); + getEgoEntityMock(name); + return ego_entity_; } - void setEntityStatusNecessaryValues( - double time, geometry_msgs::msg::Pose map_pose, geometry_msgs::msg::Twist twist) + auto setEntityStatusNecessaryValues( + double time, geometry_msgs::msg::Pose map_pose, geometry_msgs::msg::Twist twist) -> void { entity_status_.time = time; entity_status_.pose = map_pose; entity_status_.action_status.twist = twist; } + + const std::string ego_name_ = "ego"; + const std::shared_ptr<::testing::StrictMock> ego_entity_ = + std::make_shared<::testing::StrictMock>(); }; TEST(TestExecutor, InitializeWithNoNPCs) { ::testing::Sequence sequence; auto MockAPI = std::make_shared<::testing::StrictMock>(); + auto & mock_ego = MockAPI->ego_entity_; auto test_case = common::junit::SimpleTestCase("test_case"); auto test_executor = TestExecutor( @@ -155,17 +190,14 @@ TEST(TestExecutor, InitializeWithNoNPCs) ::testing::A(), ::testing::A())) .Times(1) .InSequence(sequence); - EXPECT_CALL(*MockAPI, setEntityStatus).Times(1).InSequence(sequence); + EXPECT_CALL(*MockAPI, getEgoEntityMock).Times(1).InSequence(sequence); + EXPECT_CALL(*mock_ego, setStatus).Times(1).InSequence(sequence); EXPECT_CALL(*MockAPI, attachLidarSensor).Times(1).InSequence(sequence); EXPECT_CALL(*MockAPI, attachDetectionSensor).Times(1).InSequence(sequence); EXPECT_CALL(*MockAPI, attachOccupancyGridSensor).Times(1).InSequence(sequence); - EXPECT_CALL(*MockAPI, asFieldOperatorApplicationMock).Times(1).InSequence(sequence); - EXPECT_CALL(*(MockAPI->field_operator_application_mock), declare_parameter_mock) - .Times(1) - .InSequence(sequence); - EXPECT_CALL(*MockAPI, requestAssignRoute).Times(1).InSequence(sequence); - EXPECT_CALL(*MockAPI, asFieldOperatorApplicationMock).Times(1).InSequence(sequence); - EXPECT_CALL(*(MockAPI->field_operator_application_mock), engage).Times(1).InSequence(sequence); + EXPECT_CALL(*mock_ego, setParameterMock).Times(1).InSequence(sequence); + EXPECT_CALL(*mock_ego, requestAssignRoute).Times(1).InSequence(sequence); + EXPECT_CALL(*mock_ego, engage).Times(1).InSequence(sequence); test_executor.initialize(); } @@ -174,30 +206,38 @@ TEST(TestExecutor, UpdateNoNPCs) { ::testing::Sequence sequence; auto MockAPI = std::make_shared<::testing::StrictMock>(); + auto & mock_ego = MockAPI->ego_entity_; auto test_case = common::junit::SimpleTestCase("test_case"); auto test_executor = TestExecutor( MockAPI, TestDescription(), JunitXmlReporterTestCase(test_case), 20.0, ArchitectureType::AWF_UNIVERSE, rclcpp::get_logger("test_executor_test")); + traffic_simulator::CanonicalizedEntityStatus status( + traffic_simulator_msgs::msg::EntityStatus(), std::nullopt); - EXPECT_CALL(*MockAPI, isEgoSpawned) - .Times(1) - .InSequence(sequence) - .WillOnce(::testing::Return(false)); EXPECT_CALL(*MockAPI, isNpcLogicStarted) .Times(1) .InSequence(sequence) .WillOnce(::testing::Return(false)); - EXPECT_CALL(*MockAPI, startNpcLogic).Times(1).InSequence(sequence); - EXPECT_CALL(*MockAPI, isEgoSpawned) + EXPECT_CALL(*MockAPI, isAnyEgoSpawned) .Times(1) .InSequence(sequence) .WillOnce(::testing::Return(false)); + EXPECT_CALL(*MockAPI, startNpcLogic).Times(1).InSequence(sequence); EXPECT_CALL(*MockAPI, getCurrentTime) .Times(1) .InSequence(sequence) .WillOnce(::testing::Return(1.0)); - EXPECT_CALL(*MockAPI, getEntityStatusMock).Times(2).InSequence(sequence); + EXPECT_CALL(*MockAPI, getEntityMock).Times(1).InSequence(sequence); + EXPECT_CALL(*mock_ego, getCanonicalizedStatus) + .Times(1) + .InSequence(sequence) + .WillOnce(::testing::ReturnRef(status)); + EXPECT_CALL(*MockAPI, getEntityMock).Times(1).InSequence(sequence); + EXPECT_CALL(*mock_ego, getCanonicalizedStatus) + .Times(1) + .InSequence(sequence) + .WillOnce(::testing::ReturnRef(status)); EXPECT_CALL(*MockAPI, updateFrame).Times(1).InSequence(sequence); test_executor.update(); diff --git a/test_runner/scenario_test_runner/CHANGELOG.rst b/test_runner/scenario_test_runner/CHANGELOG.rst index 8d9b268039f..c34362ad0aa 100644 --- a/test_runner/scenario_test_runner/CHANGELOG.rst +++ b/test_runner/scenario_test_runner/CHANGELOG.rst @@ -35,6 +35,71 @@ Changelog for package scenario_test_runner * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +9.0.3 (2025-01-31) +------------------ +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' into RJD-1505/fix_slope_acceleration_sign +* Merge branch 'master' of github.com:tier4/scenario_simulator_v2 into RJD-1505/fix_slope_acceleration_sign +* Contributors: Grzegorz Maj, Kotaro Yoshimoto + +9.0.2 (2025-01-31) +------------------ + +9.0.1 (2025-01-31) +------------------ +* Merge branch 'master' into feat/vel_model_acc +* Merge branch 'master' into feat/vel_model_acc +* Contributors: Kotaro Yoshimoto + +9.0.0 (2025-01-30) +------------------ +* merge 8.0.2 +* Merge tag '7.4.7' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'master' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge branch 'RJD-1057-traffic-lights-tests' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-from-entity-manager' into RJD-1057-remove-functions-forwarded-to-entity-base-middle +* Merge remote-tracking branch 'origin/RJD-1056-remove-current-time-step-time' into RJD-1057-remove-functions-forwarded-to-entity-base +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk, robomic + +8.0.2 (2025-01-28) +------------------ +* Merge branch 'master' into RJD-1495/fix +* Merge branch 'master' into RJD-1495/fix +* Merge tag '7.4.7' into RJD-1495/fix +* avoid race condition by returning by value +* Contributors: Dawid Moszyński, Tatsuya Yamasaki, robomic + +8.0.1 (2025-01-28) +------------------ + +8.0.0 (2025-01-24) +------------------ +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose' of github.com:tier4/scenario_simulator_v2 into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge branch 'master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Merge remote-tracking branch 'origin/master' into ref/RJD-1387-hdmap-utils-to-lanelet-wrapper-pose +* Contributors: Dawid Moszynski, Dawid Moszyński, Mateusz Palczuk + 7.4.7 (2025-01-20) ------------------ * Merge branch 'master' into RJD-1511/bug_fix diff --git a/test_runner/scenario_test_runner/package.xml b/test_runner/scenario_test_runner/package.xml index 88444f2c61f..8603defbef2 100644 --- a/test_runner/scenario_test_runner/package.xml +++ b/test_runner/scenario_test_runner/package.xml @@ -2,7 +2,7 @@ scenario_test_runner - 7.4.7 + 9.0.3 scenario test runner package Tatsuya Yamasaki Apache License 2.0