Skip to content

Releases: tier4/scenario_simulator_v2

7.4.6

10 Jan 08:22
Compare
Choose a tag to compare

Bumps jinja2 from 3.1.4 to 3.1.5.

Release notes

Sourced from jinja2's releases.

3.1.5

This is the Jinja 3.1.5 security fix release, which fixes security issues and bugs but does not otherwise change behavior and should not result in breaking changes compared to the latest feature release.

PyPI: https://pypi.org/project/Jinja2/3.1.5/ Changes: https://jinja.palletsprojects.com/changes/#version-3-1-5 Milestone: https://github.com/pallets/jinja/milestone/16?closed=1

  • The sandboxed environment handles indirect calls to str.format, such as by passing a stored reference to a filter that calls its argument. GHSA-q2x7-8rv6-6q7h
  • Escape template name before formatting it into error messages, to avoid issues with names that contain f-string syntax. #1792, GHSA-gmj6-6f8f-6699
  • Sandbox does not allow clear and pop on known mutable sequence types. #2032
  • Calling sync render for an async template uses asyncio.run. #1952
  • Avoid unclosed auto_aiter warnings. #1960
  • Return an aclose-able AsyncGenerator from Template.generate_async. #1960
  • Avoid leaving root_render_func() unclosed in Template.generate_async. #1960
  • Avoid leaving async generators unclosed in blocks, includes and extends. #1960
  • The runtime uses the correct concat function for the current environment when calling block references. #1701
  • Make |unique async-aware, allowing it to be used after another async-aware filter. #1781
  • |int filter handles OverflowError from scientific notation. #1921
  • Make compiling deterministic for tuple unpacking in a {% set ... %} call. #2021
  • Fix dunder protocol (copy/pickle/etc) interaction with Undefined objects. #2025
  • Fix copy/pickle support for the internal missing object. #2027
  • Environment.overlay(enable_async) is applied correctly. #2061
  • The error message from FileSystemLoader includes the paths that were searched. #1661
  • PackageLoader shows a clearer error message when the package does not contain the templates directory. #1705
  • Improve annotations for methods returning copies. #1880
  • urlize does not add mailto: to values like @a@b. #1870
  • Tests decorated with @pass_context can be used with the |select filter. #1624
  • Using set for multiple assignment (a, b = 1, 2) does not fail when the target is a namespace attribute. #1413
  • Using set in all branches of {% if %}{% elif %}{% else %} blocks does not cause the variable to be considered initially undefined. #1253
Changelog

Sourced from jinja2's changelog.

Version 3.1.5

Released 2024-12-21

  • The sandboxed environment handles indirect calls to str.format, such as by passing a stored reference to a filter that calls its argument. :ghsa:q2x7-8rv6-6q7h
  • Escape template name before formatting it into error messages, to avoid issues with names that contain f-string syntax. :issue:1792, :ghsa:gmj6-6f8f-6699
  • Sandbox does not allow clear and pop on known mutable sequence types. :issue:2032
  • Calling sync render for an async template uses asyncio.run. :pr:1952
  • Avoid unclosed auto_aiter warnings. :pr:1960
  • Return an aclose-able AsyncGenerator from Template.generate_async. :pr:1960
  • Avoid leaving root_render_func() unclosed in Template.generate_async. :pr:1960
  • Avoid leaving async generators unclosed in blocks, includes and extends. :pr:1960
  • The runtime uses the correct concat function for the current environment when calling block references. :issue:1701
  • Make |unique async-aware, allowing it to be used after another async-aware filter. :issue:1781
  • |int filter handles OverflowError from scientific notation. :issue:1921
  • Make compiling deterministic for tuple unpacking in a {% set ... %} call. :issue:2021
  • Fix dunder protocol (copy/pickle/etc) interaction with Undefined objects. :issue:2025
  • Fix copy/pickle support for the internal missing object. :issue:2027
  • Environment.overlay(enable_async) is applied correctly. :pr:2061
  • The error message from FileSystemLoader includes the paths that were searched. :issue:1661
  • PackageLoader shows a clearer error message when the package does not contain the templates directory. :issue:1705
  • Improve annotations for methods returning copies. :pr:1880
  • urlize does not add mailto: to values like @a@b. :pr:1870
  • Tests decorated with @pass_context`` can be used with the ``|select`` filter. :issue:1624`
  • Using set for multiple assignment (a, b = 1, 2) does not fail when the target is a namespace attribute. :issue:1413
  • Using set in all branches of {% if %}{% elif %}{% else %} blocks does not cause the variable to be considered initially undefined. :issue:1253
Commits
  • 877f6e5 release version 3.1.5
  • 8d58859 remove test pypi
  • eda8fe8 update dev dependencies
  • c8fdce1 Fix bug involving calling set on a template parameter within all branches of ...
  • 66587ce Fix bug where set would sometimes fail within if
  • fbc3a69 Add support for namespaces in tuple parsing (#1664)
  • b8f4831 more comments about nsref assignment
  • ee83219 Add support for namespaces in tuple assignment
  • 1d55cdd Triple quotes in docs (#2064)
Read more

7.4.5

10 Jan 01:24
Compare
Choose a tag to compare

Description

Abstract

Add const std::function<void(const std::string &)> & despawn_function argument to the TrafficSink/TrafficController class.

Background

Fixed #1464 to call EntityManager::despawnEntity function instead of API::despawn function during PR review process.
The API::despawn function included a function to communicate with sensor_simulator, and the function to delete Entity in sensor simulator via inter-process communication was implemented.
The EntityManager::despawnEntity function has been changed to call the EntityManager::despawnEntity function, so Entity in sensor simulator is no longer deleted.

Details

Add const std::function<void(const std::string &)> & despawn_function argument to the TrafficSink/TrafficController class and pass API::despawn function in member initialize list of the API class.

class API
{
public:
  template <typename NodeT, typename AllocatorT = std::allocator<void>, typename... Ts>
  explicit API(NodeT && node, const Configuration & configuration, Ts &&... xs)
  : traffic_controller_ptr_(std::make_shared<traffic::TrafficController>(
      [this](const std::string & name) { despawn(name); }, entity_manager_ptr_,
      configuration.auto_sink_entity_types))

References

#1464
https://star4.slack.com/archives/C04TZBEABDM/p1735261646158039?thread_ts=1735102371.414719&cid=C04TZBEABDM
Regression test.

Destructive Changes

N/A

Known Limitations

The design of this PR is not desirable, but for now it is a PR to solve the problems that have occurred.
In the future, use the Job class to replace the TrafficSink/TrafficSource class for a more reasonable refactor.

Related Issues

7.4.4

09 Jan 09:34
Compare
Choose a tag to compare

Description

Abstract

The package concealer code was refactored. (continuation of #1488.)

Background

See #1488 description.

Details

Reducing Member Functions

Several member functions were removed for the same purpose as in #1488. Below is the background and policy for this as described in #1488.

Member functions that are only used by certain member functions have been changed to function local functions. Making them private member functions was also an option, but we decided not to do so. Based on our experience in maintenance over the past few years, the cost of understanding where a certain member function is being called from is a burden both in terms of code modification and code review. This is just a matter of preference. I don't mind changing function-local functions to private member functions at some point, so I'm doing it this way for now to make refactoring following this pull request easier.

References

Destructive Changes

None.

Known Limitations

None.

Related Issues

7.4.3

07 Jan 08:01
Compare
Choose a tag to compare

Description

The following function in traffic_light_base.cpp is quite heavy because it always tries adding traffic light even when the traffic light has been registered in simulator.

auto TrafficLightsBase::getTrafficLight(const lanelet::Id traffic_light_id) -> TrafficLight &
{
  addTrafficLight(traffic_light_id);
  return traffic_lights_map_.at(traffic_light_id);
}

As a result, it becomes a bottle neck of simulator when I write a code to update traffic light color frequently.

Screenshot from 2024-11-13 13-29-45

Abstract

I added the guard to prevent redundant process like this:

diff --git a/simulation/traffic_simulator/src/traffic_lights/traffic_lights_base.cpp b/simulation/traffic_simulator/src/traffic_lights/traffic_lights_base.cpp
index 48110784a..906e80258 100644
--- a/simulation/traffic_simulator/src/traffic_lights/traffic_lights_base.cpp
+++ b/simulation/traffic_simulator/src/traffic_lights/traffic_lights_base.cpp
@@ -123,6 +123,10 @@ auto TrafficLightsBase::addTrafficLight(const lanelet::Id traffic_light_id) -> v
 
 auto TrafficLightsBase::getTrafficLight(const lanelet::Id traffic_light_id) -> TrafficLight &
 {
+  if (isTrafficLightAdded(traffic_light_id)) {
+    return traffic_lights_map_.at(traffic_light_id);
+  }
+
   addTrafficLight(traffic_light_id);
   return traffic_lights_map_.at(traffic_light_id);
 }

Background

N/A

Details

With this PR, I confirmed the process load became light.

image

References

N/A

Destructive Changes

N/A

Known Limitations

N/A

Related Issues

7.4.2

07 Jan 01:16
Compare
Choose a tag to compare

Description

Abstract

Updated the rviz config file based on autoware.rviz to display the latest Rviz plugin used by Autoware developers.
However, some modifications have been made so as not to disrupt the appearance of the previous scenario_simulator_v2 Rviz.

Screenshot from 2025-01-06 11-27-04

Background

Continuation of #1349

References

#1342

Destructive Changes

This is a destructive change for rviz config file.
But, there are no effects for simulation and autoware behaviors even if some rviz plugins are missing.

Known Limitations

None

Related Issues

7.4.1

24 Dec 05:04
Compare
Choose a tag to compare

Description

Abstract

catch common::SemanticError inside traffic_simulator::pose::canonicalize function.

Background

In #1266 the CanonicalizedLaneletPose::canonicalize function is now used in the constructor of the CanonicalizedLaneletPose class.
CanonicalizedLaneletPose class is used inside traffic_simulator::pose::canonicalize function.
The traffic_simulator::pose::canonicalize function has a return value of type std::optional and must return std::nullopt if it is used for lane coordinate system calculation, but CanonicalizedLaneletPose ::canonicalize function throws common::SemanticError in case of failure of lane coordinate system calculation, so if std::nullopt is expected as a return value, an exception is raised and the simulation stops.

Details

catch common::SemanticError inside traffic_simulator::pose::canonicalize function.

Unit tests run on the source code of this commit hash will output the following error and fail.

- test_pose
  <<< failure message
    -- run_test.py: invoking following command in '/home/user/workspace/pilot-auto.x2/build/traffic_simulator/test/src/utils':
     - /home/user/workspace/pilot-auto.x2/build/traffic_simulator/test/src/utils/test_pose --gtest_output=xml:/home/user/workspace/pilot-auto.x2/build/traffic_simulator/test_results/traffic_simulator/test_pose.gtest.xml
    [==========] Running 44 tests from 2 test suites.
    [----------] Global test environment set-up.
    [----------] 6 tests from pose
    [ RUN      ] pose.quietNaNPose
    [       OK ] pose.quietNaNPose (0 ms)
    [ RUN      ] pose.quietNaNLaneletPose
    [       OK ] pose.quietNaNLaneletPose (0 ms)
    [ RUN      ] pose.transformRelativePoseToGlobal
    [       OK ] pose.transformRelativePoseToGlobal (0 ms)
    [ RUN      ] pose.relativePose_poses_zero
    [       OK ] pose.relativePose_poses_zero (0 ms)
    [ RUN      ] pose.relativePose_poses_zeros
    [       OK ] pose.relativePose_poses_zeros (0 ms)
    [ RUN      ] pose.relativePose_poses_complex
    [       OK ] pose.relativePose_poses_complex (0 ms)
    [----------] 6 tests from pose (0 ms total)
    
    [----------] 38 tests from PoseTest
    [ RUN      ] PoseTest.canonicalize_default
    [       OK ] PoseTest.canonicalize_default (8 ms)
    [ RUN      ] PoseTest.canonicalize_invalid
    unknown file: Failure
    C++ exception with description "/home/user/workspace/pilot-auto.x2/src/simulator/scenario_simulator/simulation/traffic_simulator/src/data_type/lanelet_pose.cpp:81: Lanelet pose (id=203,s=1000,offset=0,rpy.x=0,rpy.y=0,rpy.z=0) is invalid, please check lanelet length and connection." thrown in the test body.
    [  FAILED  ] PoseTest.canonicalize_invalid (7 ms)
    [ RUN      ] PoseTest.canonicalize_valid
    [       OK ] PoseTest.canonicalize_valid (7 ms)
    [ RUN      ] PoseTest.toMapPose_CanonicalizedLaneletPose
    [       OK ] PoseTest.toMapPose_CanonicalizedLaneletPose (6 ms)
    [ RUN      ] PoseTest.toMapPose_LaneletPose
    [       OK ] PoseTest.toMapPose_LaneletPose (7 ms)
    [ RUN      ] PoseTest.toCanonicalizedLaneletPose_noBoundingBox_noRoute_valid
    [       OK ] PoseTest.toCanonicalizedLaneletPose_noBoundingBox_noRoute_valid (7 ms)
    [ RUN      ] PoseTest.toCanonicalizedLaneletPose_noBoundingBox_noRoute_invalid
    [       OK ] PoseTest.toCanonicalizedLaneletPose_noBoundingBox_noRoute_invalid (6 ms)
    [ RUN      ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_noRoute_valid
    [       OK ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_noRoute_valid (7 ms)
    [ RUN      ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_noRoute_invalid
    [       OK ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_noRoute_invalid (7 ms)
    [ RUN      ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_route_emptyInvalid
    [       OK ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_route_emptyInvalid (7 ms)
    [ RUN      ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_route_emptyValid
    [       OK ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_route_emptyValid (6 ms)
    [ RUN      ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_route_nonEmptyInvalid
    [       OK ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_route_nonEmptyInvalid (7 ms)
    [ RUN      ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_route_nonEmptyValid
    [       OK ] PoseTest.toCanonicalizedLaneletPose_BoundingBox_route_nonEmptyValid (7 ms)
    [ RUN      ] PoseTest.relativePose_canonicalized_end_position
    [       OK ] PoseTest.relativePose_canonicalized_end_position (6 ms)
    [ RUN      ] PoseTest.relativePose_canonicalized_start_position
    [       OK ] PoseTest.relativePose_canonicalized_start_position (7 ms)
    [ RUN      ] PoseTest.boundingBoxRelativePose_disjoint
    [       OK ] PoseTest.boundingBoxRelativePose_disjoint (6 ms)
    [ RUN      ] PoseTest.boundingBoxRelativePose_commonEdge
    [       OK ] PoseTest.boundingBoxRelativePose_commonEdge (7 ms)
    [ RUN      ] PoseTest.boundingBoxRelativePose_intersect
    [       OK ] PoseTest.boundingBoxRelativePose_intersect (7 ms)
    [ RUN      ] PoseTest.relativeLaneletPose_s_invalid
    [       OK ] PoseTest.relativeLaneletPose_s_invalid (7 ms)
    [ RUN      ] PoseTest.relativeLaneletPose_s_valid
    [       OK ] PoseTest.relativeLaneletPose_s_valid (7 ms)
    [ RUN      ] PoseTest.relativeLaneletPose_offset_invalid
    [       OK ] PoseTest.relativeLaneletPose_offset_invalid (6 ms)
    [ RUN      ] PoseTest.relativeLaneletPose_offset_valid
    [       OK ] PoseTest.relativeLaneletPose_offset_valid (7 ms)
    [ RUN      ] PoseTest.boundingBoxRelativeLaneletPose_s_invalid
    [       OK ] PoseTest.boundingBoxRelativeLaneletPose_s_invalid (7 ms)
    [ RUN      ] PoseTest.boundingBoxRelativeLaneletPose_s_valid
    [       OK ] PoseTest.boundingBoxRelativeLaneletPose_s_valid (7 ms)
    [ RUN      ] PoseTest.boundingBoxRelativeLaneletPose_offset_invalid
    [       OK ] PoseTest.boundingBoxRelativeLaneletPose_offset_invalid (7 ms)
    [ RUN      ] PoseTest.boundingBoxRelativeLaneletPose_offset_valid
    [       OK ] PoseTest.boundingBoxRelativeLaneletPose_offset_valid (6 ms)
    [ RUN      ] PoseTest.isInLanelet_inside
    [       OK ] PoseTest.isInLanelet_inside (8 ms)
    [ RUN      ] PoseTest.isInLanelet_outsideFrontFar
    [       OK ] PoseTest.isInLanelet_outsideFrontFar (7 ms)
    [ RUN      ] PoseTest.isInLanelet_outsideFrontClose
    [       OK ] PoseTest.isInLanelet_outsideFrontClose (6 ms)
    [ RUN      ] PoseTest.isInLanelet_outsideBackFar
    [       OK ] PoseTest.isInLanelet_outsideBackFar (8 ms)
    [ RUN      ] PoseTest.isInLanelet_outsideBackClose
    [       OK ] PoseTest.isInLanelet_outsideBackClose (7 ms)
    [ RUN      ] PoseTest.isAtEndOfLanelets_noFollowing_within
    [       OK ] PoseTest.isAtEndOfLanelets_noFollowing_within (7 ms)
    [ RUN      ] PoseTest.isAtEndOfLanelets_singleFollowing_within
    [       OK ] PoseTest.isAtEndOfLanelets_singleFollowing_within (6 ms)
    [ RUN      ] PoseTest.isAtEndOfLanelets_singleFollowing_outside
    [       OK ] PoseTest.isAtEndOfLanelets_singleFollowing_outside (7 ms)
    [ RUN      ] PoseTest.isAtEndOfLanelets_multipleFollowing_within
    [       OK ] PoseTest.isAtEndOfLanelets_multipleFollowing_within (7 ms)
    [ RUN      ] PoseTest.isAtEndOfLanelets_multipleFollowing_outside
    [       OK ] PoseTest.isAtEndOfLanelets_multipleFollowing_outside (7 ms)
    [ RUN      ] PoseTest.laneletLength_invalid
    [       OK ] PoseTest.laneletLength_invalid (7 ms)
    [ RUN      ] PoseTest.laneletLength_valid
    [       OK ] PoseTest.laneletLength_valid (7 ms)
    [----------] 38 tests from PoseTest (260 ms total)
    
    [----------] Global test environment tear-down
    [==========] 44 tests from 2 test suites ran. (260 ms total)
    [  PASSED  ] 43 tests.
    [  FAILED  ] 1 test, listed below:
    [  FAILED  ] PoseTest.canonicalize_invalid

References

Regression test result.

Destructive Changes

N/A

Known Limitations

N/A

Related Issues

7.4.0

23 Dec 08:08
Compare
Choose a tag to compare

Abstract

This PR contains the continuation of #1443

Details

  1. There is no longer lanelet::Id passed into TrafficSink, but an optional<lanelet::Id>. It is still used solely for the purpose of visualization, where nullopt means that the sink was placed too far from the lane. Resigning from passing lanelet::Id altogether turned out to be problematic, because ends of multiple lanelets overlap and the corresponding lanelet could not be determined.
  2. Additionally I would like to propose an alternative approach to the set sinkable_entity_types variable.
  3. I have removed the special case if sinkable_entity_types is empty, then all entities should sink. In my opinion it could be misleading (someone could pass empty sinkable_entity_types and expect that no sinking behavior will occur). Now if we want to sink all entities, we need to provide the full set sinkable_entity_types.
  4. I have removed the bool auto_sink variable, which could be equivalent to sinkable_entity_types.empty() with this approach.
  5. The default behavior is sinkable_entity_types = {}, that is no auto sinks are generated.

References

Regressions OK

Related Issues

7.3.5

20 Dec 06:06
Compare
Choose a tag to compare

Description

Abstract

The package concealer code was refactored.

Background

The code of the package concealer has been modified without any refactoring since its creation until today. This is not due to technical reasons, but simply because there was no opportunity. However, now that the merge of #1454 has been completed, I thought it was a good opportunity to refactor it.

Details

As the title suggests, I plan to refactor concealer in several stages. The purpose of this pull request is to first make the code more compact without making any functional changes.

Base Class Autoware

When I designed concealer, I was struggling with the need to support three different Autoware flavors in scenario_simulator_v2: Autoware.AI, Autoware.T4B, and AutowareArchitectureProposal. The structure of the base class Autoware and its derived class AutowareUniverse is based on the assumption that Autoware with an architecture different from Autoware.Universe will appear. However, in reality, no such different type of Autoware has appeared since the emergence of Autoware.Universe. This could be interpreted as just a coincidence that it has not appeared until now, but it is also true that the code is bulky due to this structure, so for the time being, I deleted the base class and simplified the code.

Reducing Member Functions

Member functions that are only used by certain member functions have been changed to function local functions. Making them private member functions was also an option, but we decided not to do so. Based on our experience in maintenance over the past few years, the cost of understanding where a certain member function is being called from is a burden both in terms of code modification and code review. This is just a matter of preference. I don't mind changing function-local functions to private member functions at some point, so I'm doing it this way for now to make refactoring following this pull request easier.

References

None.

Destructive Changes

None.

Known Limitations

None.

Related Issues

7.3.4

20 Dec 02:01
Compare
Choose a tag to compare

Description

Abstract

Add auto HdMapUtils::isInIntersection(const lanelet::Id lanelet_id) const -> bool function.

Background

In the current master branch implementation, there was no function to determine if a lanelet is a lanelet at an intersection.

Details

Since it was found that lanelets included in an intersection have an attribute called turn_direction, it was decided to make a judgment based on this attribute.

The use of intersection_area polygon was also suggested, but the condition is that intersection in lanelet2 means turn_direction, and polygon(intersection_area) is the polygon that is responsible for setting the area. Therefore, we decided to use the presence or absence of turn_direction` as a condition for judgment.

Lanelet outside intersection.

Screenshot from 2024-12-18 12-58-17

Lanelet inside intersection.

Screenshot from 2024-12-18 12-58-29

References

Internal link.
Document about lanelet2(Japanese)
Document about lanelet2(English)

Destructive Changes

N/A

Known Limitations

N/A

Related Issues

7.3.3

18 Dec 07:37
Compare
Choose a tag to compare

Description

Abstract

Merge SpellCheckAll and SpellCheck workflow.

Background

SpellCheckAll and SpellCheck do almost same thing.

Details

Merge SpellCheckAll and SpellCheck workflow.

References

N/A

Destructive Changes

N/A

Known Limitations

N/A

Related Issues