Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenSCENARIO1_Engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephen Ryan
OpenSCENARIO1_Engine
Commits
d532acd2
Commit
d532acd2
authored
3 years ago
by
Xiao Pan
Browse files
Options
Downloads
Patches
Plain Diff
Adapt target lane-id type in the performance lane change control strategy
parent
34e6b7f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Storyboard/Actions/LaneChangeAction.cpp
+13
-7
13 additions, 7 deletions
src/Storyboard/Actions/LaneChangeAction.cpp
with
13 additions
and
7 deletions
src/Storyboard/Actions/LaneChangeAction.cpp
+
13
−
7
View file @
d532acd2
...
@@ -73,7 +73,7 @@ void LaneChangeAction::SetupControlStrategy()
...
@@ -73,7 +73,7 @@ void LaneChangeAction::SetupControlStrategy()
if
(
const
auto
absolute_target_lane
=
lane_change_target
->
GetAbsoluteTargetLane
())
if
(
const
auto
absolute_target_lane
=
lane_change_target
->
GetAbsoluteTargetLane
())
{
{
control_strategy_
->
target_lane_id
=
std
::
sto
u
l
(
absolute_target_lane
->
GetValue
());
control_strategy_
->
target_lane_id
=
std
::
stol
(
absolute_target_lane
->
GetValue
());
}
}
else
if
(
const
auto
relative_target_lane
=
lane_change_target
->
GetRelativeTargetLane
())
else
if
(
const
auto
relative_target_lane
=
lane_change_target
->
GetRelativeTargetLane
())
{
{
...
@@ -87,16 +87,22 @@ void LaneChangeAction::SetupControlStrategy()
...
@@ -87,16 +87,22 @@ void LaneChangeAction::SetupControlStrategy()
const
auto
relative_pose
=
mantle_api
::
Pose
{
relative_entity
.
value
().
get
().
GetPosition
(),
const
auto
relative_pose
=
mantle_api
::
Pose
{
relative_entity
.
value
().
get
().
GetPosition
(),
relative_entity
.
value
().
get
().
GetOrientation
()};
relative_entity
.
value
().
get
().
GetOrientation
()};
if
(
const
auto
target_lane_id
=
const
auto
target_lane_id
=
environment_
->
GetQueryService
().
GetRelativeLaneId
(
relative_pose
,
relative_target_lane
->
GetValue
()))
environment_
->
GetQueryService
().
GetRelativeLaneId
(
relative_pose
,
relative_target_lane
->
GetValue
());
{
control_strategy_
->
target_lane_id
=
target_lane_id
.
value
();
if
(
!
target_lane_id
.
has_value
())
}
else
{
{
throw
std
::
runtime_error
(
"LaneChangeAction: Cannot find the target lane to the reference entity
\"
"
+
throw
std
::
runtime_error
(
"LaneChangeAction: Cannot find the target lane to the reference entity
\"
"
+
relative_entity_name
+
"
\"
. Please adjust the scenario."
);
relative_entity_name
+
"
\"
. Please adjust the scenario."
);
}
}
if
(
target_lane_id
.
value
()
>
static_cast
<
mantle_api
::
UniqueId
>
(
std
::
numeric_limits
<
std
::
int64_t
>::
max
()))
{
throw
std
::
runtime_error
(
"LaneChangeAction: Integer overflow detected in converting the target lane id
\"
"
+
std
::
to_string
(
target_lane_id
.
value
())
+
"
\"
."
);
}
control_strategy_
->
target_lane_id
=
static_cast
<
int
>
(
target_lane_id
.
value
());
}
}
else
else
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment