Closed mchlswyr closed 3 years ago
One optional comment: it would be great to add some more type annotations to function parameters to ease code understanding.
Right. I did this for the SDVRoute
and SDVPath
classes since we discussed before that type annotations should be used. Maybe we could add the type annotations to all other functions in another PR?
Maybe we could add the type annotations to all other functions in another PR?
I think it should be an ongoing effort: whenever PRs add new functions, they should be annotated. Whenever existing function signatures change, they should have the missing annotations added.
Changes
Global Path and Reference Path
SDVPath
class, insv/SDVRoute.py
Point3d
s generated from the centerline of a lane (a list ofLanelet
s)SDVRoute
class, insv/SDVRoute.py
, creates anSDVPath
object for each lane in the route (lanelet_route
)update_global_path()
, inSDVRoute
, is used to update the currentSDVPath
object depending on the position that is passed as argumentupdate_reference_path()
, inSDVRoute
, is used to "move" the reference path along the global pathSDVPath
class, inupdate_ref_path()
: the reference path is centered aroundref_path_origin
(which is the origin of the reference path along the global path) and extends from_ref_path_s_start
to_ref_path_s_end
(which is -100.0 to 100.0 right now)SDV.__init__()
, insv/Vehicle.py
, and once inget_planner_state()
, insv/SDVPlanner.py
, when finding the newref_path_origin
Spline Fitting
SimConfig.py
underPOINTS_PER_METER
Frenet Transformations
s_start
ref_path
that is passed as argumentBehaviour Trees
should_lane_swerve
andmin_long_vel
should_lane_swerve
isTrue
whenever the planner state'slane_swerve_target
is notNone
min_long_vel
isTrue
when the vehicle'ss_vel
is greater than or equal to thevel
passed as argumentM_LANESWERVE
, was addedSDVPath
class has member variables for marking the start and end of a "lane swerve zone", as well as the direction of the lane swerveSDVRoute
class uses these member variables to keep the vehicle on its route: if the vehicle is coming up to the end of its route along the current global path, andupdate_reference_path()
withplan_lane_swerve=True
has been called, thenget_lane_swerve_direction
will return the direction of the lane swervesv/SDVPlanner.py
to setlane_swerve_target
in the planner statebtrees/sdv/drive.btree
has been updated to keep the vehicle on its route: if the vehicle is going faster than 1 m/s, andshould_lane_swerve
isTrue
, then the planner executes a lane swerve maneuver in the direction oflane_swerve_target
MLaneSwerveConfig
'starget_lid
can be set in the btree; if it is set, and it is not set toNone
, then the lane swerve maneuver will be made towards that lane; if it is not set, or it is set toNone
, then the lane swerve maneuver will be made towards the planner state'slane_swerve_target
New Scenarios
scenarios/maps/lanelet2_university_weber_alt.osm
calledscenarios/maps/lanelet2_university_weber_alt_modified.osm
scenarios/test_scenarios/gs_university_weber_right_turn.osm
drive.btree
to make a lane swerve in order to stay on its route and make a right turn towards its goalscenarios/maps/lanelet2_university_weber_alt_modified.osm
scenarios/test_scenarios/gs_bathurst_cul_de_sac.osm
Other
sv/SDVPlanner.py
,get_planner_state()
has been split into two functions:project_dynamic_objects()
andget_planner_state()
project_dynamic_objects()
projects the planner's vehicle's, other vehicles', and pedestrians' future sim stateget_planner_state()
transforms the projected sim state to frenet state, and returns aPlannerState
objectexpected_planner_time
is used instead ofdelta_time
sincedelta_time
is the time since the start of the planner's vehicle's last trajectorysv/SDVPlanner.py
,get_plan()
only returns a plan when it is valid and new, and it returnsNone
otherwisesv/Vehicle.py
,tick()
will only update the global path once whenplan.new_frenet_frame
isTrue
sv/Vehicle.py
,compute_vehicle_state()
now returns ifsim_time
is less than the plan's start timePLOT_VEHICLE_ROUTES
toSimConfig.py
True
, figures will be opened for each of the vehicle's global pathsClosed Issues
btrees/sdv/drive.btree
now includes a lane swerve to stay on routeRelated Issues
lanelet_route
, and, if a route was successfully generated, create a newSDVRoute
objectscenarios/test_scenarios
work with the temporary fixTesting
scenarios/test_scenarios
:gs_ringroad_stress_loop.osm
, some vehicles will cross from the end of the loop back to the start and a jump back of roughly 2500 meters will be reported for these vehicles; this can be ignoredgs_straight_reverse.osm
, the vehicle just drives in reverse for 10 seconds before the scenario times out