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

NPCs should be able to get max speed parameter from scenario yaml file #775

Open
mehmetdogru opened this issue Apr 27, 2022 · 5 comments
Open
Assignees

Comments

@mehmetdogru
Copy link

This issue is a part of autowarefoundation/autoware.universe#566

Description
NPCs currently take max speed from related lanelet2_map's speed limit instead of scenario yaml file. And when there is multiple scenarios using the same lanelet2_map with different NPC speed configurations which also include NPCs moving lower speeds than lanelet2_map's speed limit, the feature proposed here is becoming a necessity.

Describe the solution you'd like
NPC vehicles should be able to take the argument for maximum speed that the can move from yaml file and if it is lower than embedded speed limit on the lanelet2_map, the parameter from yaml file must be accepted as max speed.

max_NPC_speed = min(embedded_speed_limit_on_lanelet2 , max_speed_from_yaml_file)

@yamacir-kit yamacir-kit self-assigned this Apr 28, 2022
@mehmetdogru
Copy link
Author

mehmetdogru commented May 22, 2022

Setting Initial speed instead of Speed parameter makes a difference. Even though it is written Initial speed in the scenario editor it is interpreted as AbsoluteTargetSpeed so NPCs take that as a target speed.

@mitsudome-r
Copy link
Contributor

I've also confirmed this. It seems there is something wrong with treating Initial speed and speed (target speed) parameter either in the scenario editor or scenario runner.

In this scenario, intial speed is set 0, and target speed is set to 2.8m/s (10km/h) so it should gradually speed up to 10km/h, but never starts moving when running the scenario. (video link)
image

@hakuturu583
Copy link
Collaborator

@mehmetdogru Is it possible to set a maximum speed for NPCs?
This Issue is no longer considered Active, so if I don't hear back from you in a week, I will Close it.

@mehmetdogru
Copy link
Author

mehmetdogru commented Feb 15, 2024

@hakuturu583

Thank you for the reminder.

Well, it is kind of possible by setting Initial speed[1] but not quite. Although it is not actually initial speed it is set but AbsoluteTargetSpeed[3] and vehicle starts and drives with that speed only. Whereas Speed[2] does not have any affect. (corresponding to maxSpeed[4])

Meaning, as in the example case below, Npc1 will spawn at a speed 1 m/s and drives at 1 m/s regardless of maxSpeed[4]. So it does not matter whether maxSpeed[4] is 0.0 m/s or 3.0 m/s

ssv2_775

As a conclusion, in reality we do not have initial or max speed but only a target speed (or speed). So IMO there are 2 ways to eliminate this confusion:

Option 1)

  • Use Initial speed[1] (e.g. 1m/s) as initial speed in the scenario meaning NPC1 would start at that speed (1m/s) and speed up to Speed[2] (e.g. 3 m/s).
  • Rename Speed[2] as Max Speed

Option 2)

  • Remove Speed[2] unless it is used somewhere else.
  • Rename Initial speed[1] as Absolute Target Speed or Speed

I would prefer the Option 1 🙇

@hakuturu583
Copy link
Collaborator

Checking the OpenSCENARIO notation, the initial speed of NPC1 is spawned at 1.0 m/s because SpeedAction is executed with dynamics_shape=step, and then the maximum speed is specified as 3.0 m/s by AssignControlelrAction. AssignControlelrAction.
To increase the speed to 3.0 m/s, it is necessary to update the target speed by executing SpeedAction again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants