-
Notifications
You must be signed in to change notification settings - Fork 69
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
Safe distance label lateral #525
Conversation
juloberno
commented
May 7, 2021
- Label Safe Distance: now includes option to calculate lateral safe distance
- GetFrontRear now truly considers lateral difference offset with option to restrict it to lane polygon or not
- Fixes in FrenetState and SingleTrackLaneChange controller (not working for intersection scenario)
- Fix wrapping of primitives ConstAccStayLane
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems mostly fine, can you please elaborate on the lateral acceleration equations?
@@ -50,7 +50,11 @@ BehaviorLaneChangeRuleBased::FrontRearAgents( | |||
const ObservedWorld& observed_world, | |||
const LaneCorridorPtr& lane_corr) const { | |||
AgentInformation front_info, rear_info; | |||
const auto& front_rear = observed_world.GetAgentFrontRear(lane_corr); | |||
double lateral_difference_threshold = 100; // do not restrict regarding lateral diff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the unit? meter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this not be externally settable via the parameter server?
@@ -50,7 +50,11 @@ BehaviorLaneChangeRuleBased::FrontRearAgents( | |||
const ObservedWorld& observed_world, | |||
const LaneCorridorPtr& lane_corr) const { | |||
AgentInformation front_info, rear_info; | |||
const auto& front_rear = observed_world.GetAgentFrontRear(lane_corr); | |||
double lateral_difference_threshold = 100; // do not restrict regarding lateral diff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this not be externally settable via the parameter server?
@@ -158,7 +191,7 @@ inline double CalculateSteeringAngle(const SingleTrackModelPtr& model, | |||
|
|||
FrenetState f_state = FrenetState(state_front, ref_line); | |||
double vel = state(StateDefinition::VEL_POSITION); | |||
double delta = -NormToPI(f_state.angle) + atan2(-gain * f_state.lat, vel); | |||
double delta = +NormToPI(f_state.angle) + atan2(-gain * f_state.lat, vel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for a +
sign
@@ -461,6 +461,7 @@ def drawLaneCorridor(self, lane_corridor, color=None): | |||
color = "blue" | |||
self.drawPolygon2d(lane_corridor.polygon, color=color, | |||
facecolor=color, alpha=.3, zorder=2) | |||
self.drawLine2d(lane_corridor.center_line, "k") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could draw the center line in the same color as the lane corridor
@@ -162,10 +138,13 @@ bool SafeDistanceLabelFunction::CheckSafeDistance( | |||
double t_stop_f = -v_f / a_f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this assumes linear acceleration. would it not be better to use v=1/2at^2
|
||
import numpy as np | ||
import itertools | ||
|
||
# Name and Output Directory | ||
# CHANGE THIS # | ||
map_name = "DR_CHN_Merging_ZS_partial_v04_lower_edited" | ||
map_name = "left_turn_rural" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use map that is publicly available, so one can e.g. visualize the lane corridor and understand the concept