Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider road slope in distance measurement and entity poses #1209

Merged
merged 63 commits into from
Mar 12, 2024

Conversation

HansRobo
Copy link
Member

@HansRobo HansRobo commented Mar 7, 2024

Description

Abstract

  • consider z-axis in euclidean distance evaluation
  • fit pitch angle of entity poses to HDMap
  • add consider_pose_by_road_slope flag to switch function
  • update new scenarios and tests

Note: All the features can be toggled by consider_pose_by_road_slope.

Background

One of the characteristics of scenario_simualtor_v2 is that it is a simple and lightweight simulator.
Therefore, we have mainly dealt with simulations on a 2D plane without considering the Z direction or pitch/roll axes.

However, as the behavior on slopes is now being checked in autoware developing, simulation on a 2D plane alone is no longer able to cover the evaluation of Planning/Control, which is the main evaluation target of scenario_simualtor_v2.

So, we started to support simulation on 3D pose.

Details

Note: I would like to thank @dmoszynski for his great efforts for this pull-request.

Entity pose pitch-fitting to HDMap

As long as lane matching is successful, scenario_simulator_v2 tries to constrain the pose on the HDMap.
Specifically, the situation is as follows.

  • spawning entity to position: OpenSCENARIO AddEntityAction
  • teleporting entity to position: OpenSCENARIO TeleportAction
  • setting goal: OpenSCENARIO AcquirePositionAction
  • setting route
    • OpenSCENARIO FollowTrajectoryAction
    • OpenSCENARIO AssignRouteAction

The z fitting to HDMap was already performed in scenario_simulator_v2 until now.
But the entity pose fitting was not complete until now: pitch and roll angle were not fitted to HDMap.
In this pull-request, pitch-fitting is implemented.

image

With OpenSCENARIO WorldPosition / RelativeWorldPosition / RelativeObjectPosition, scenario_simulator_v2 will be performing both of z-fitting and pitch-fitting.
With OpenSCENARIO LanePosition, scenario_simulator_v2 will be performing only pitch fitting.
( Other position types are not supported in scenario_simulator_v2 now )

The pitch-fitting is also affected to bounding-box-based distance evaluation(freespace=true), because the orientation of entity bounding-box can be changed by pitch-fitting.

Entity that specified pitch=0 and consider_pose_by_road_slope=False

vokoscreenNG-2023-12-20_19-23-04.mp4

Entity that specified pitch=0 and consider_pose_by_road_slope=True

wolrd_fix.mp4

Distance evaluation

The euclidean distance evaluation in OpenSCENARIO DistanceCondition / RelativeDistanceCondition / ReachPositionCondition is performed in 2D plane previously.
In this pull-request, I implemented 3D euclidean dintance evaluation.

image

References

INTERNAL INVESTIGATION LINK

Regression Test: Pass

Destructive Changes

behavior changes

Some of OpenSCENARIO Actions, Conditions, traffic_simulator::API functions have destructive changes in terms of the behavior.
Please see detail section for a detailed explanation of the behavior changes.
All bahavior changes are caused by sloped or uneven roads on the map.
There should be almost no difference on a flat map, but there are some changes, so you may need to modify the scenario.
However, these changes correct what was wrong in the past, so it is recommended that you accept them.
If you really want to use the old behavior, please use the version before this pull-request or specify consider_pose_by_road_slope=False.

Please see sample scenario diffs in this pull-request for bahavior changes of conditions.
(for example: https://github.com/tier4/scenario_simulator_v2/pull/1209/files#diff-8ad8028efaba14a312f2bc2036165f514f69f3078760046016ce5826204993f2R88)

API schema changes

In this pull-request, some of API functions were added a boolean argument to toggle its behavior.
But the changes have backward-compatibility in terms of API interface, because all the additional argument have default value.

Known Limitations

No roll-fitting to HDMap

In this pull-request, orientation fitting is implemented for pitch angle only.
This is because it follows the implementation of simple_planning_simulator in autoware.universe.

No orientation-fitting to HDMap in OccupancyGridSensor

The GridMap output from scenario_simulator_v2 is always horizontal regardless of the road slope.
This is because current implementation of autoware.universe does not consider the roll and pitch axes.

hakuturu583 and others added 30 commits October 10, 2023 18:10
Signed-off-by: Masaya Kataoka <[email protected]>
Signed-off-by: Masaya Kataoka <[email protected]>
Signed-off-by: Masaya Kataoka <[email protected]>
Signed-off-by: Masaya Kataoka <[email protected]>
Signed-off-by: Masaya Kataoka <[email protected]>
Signed-off-by: Masaya Kataoka <[email protected]>
# Conflicts:
#	simulation/simple_sensor_simulator/include/simple_sensor_simulator/vehicle_simulation/ego_entity_simulation.hpp
#	simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp
#	simulation/simple_sensor_simulator/src/vehicle_simulation/ego_entity_simulation.cpp
#	test_runner/scenario_test_runner/launch/scenario_test_runner.launch.py
Signed-off-by: Kotaro Yoshimoto <[email protected]>
Signed-off-by: Kotaro Yoshimoto <[email protected]>
Signed-off-by: Kotaro Yoshimoto <[email protected]>
# Conflicts:
#	simulation/simple_sensor_simulator/src/vehicle_simulation/ego_entity_simulation.cpp
Signed-off-by: Kotaro Yoshimoto <[email protected]>
# Conflicts:
#	simulation/simple_sensor_simulator/include/simple_sensor_simulator/vehicle_simulation/ego_entity_simulation.hpp
#	simulation/simple_sensor_simulator/src/simple_sensor_simulator.cpp
#	simulation/simple_sensor_simulator/src/vehicle_simulation/ego_entity_simulation.cpp
#	test_runner/scenario_test_runner/launch/scenario_test_runner.launch.py
Signed-off-by: Kotaro Yoshimoto <[email protected]>
@HansRobo HansRobo requested a review from hakuturu583 March 7, 2024 02:45
@HansRobo HansRobo self-assigned this Mar 7, 2024
Copy link

github-actions bot commented Mar 7, 2024

This PR edits vehicle model that is copied from simple_planning_simulator. Please consider making changes to the original code to avoid confusion or consult developers (@hakuturu583, @yamacir-kit and @HansRobo ).

=> (@HansRobo): With this change you don't have to worry about that. Because this changes only edit additional part of scenario_simulator_v2 in vehicle model files.

@HansRobo HansRobo added the bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 label Mar 7, 2024
@HansRobo
Copy link
Member Author

HansRobo commented Mar 7, 2024

This is re-opened pull-request of #1103

@hakuturu583 hakuturu583 merged commit ce8a77b into master Mar 12, 2024
15 checks passed
@hakuturu583 hakuturu583 deleted the feature/ego_slope branch March 12, 2024 14:05
@github-actions github-actions bot restored the feature/ego_slope branch March 12, 2024 14:06
@github-actions github-actions bot deleted the feature/ego_slope branch March 12, 2024 14:07
@github-actions github-actions bot restored the feature/ego_slope branch March 14, 2024 11:08
@hakuturu583 hakuturu583 deleted the feature/ego_slope branch June 19, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 wait for regression test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants