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

Block rollouts that cut through of drivable areas #18

Open
wants to merge 1 commit into
base: openplanner.1.15
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions op_local_planner/include/op_trajectory_evaluator_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "op_planner/TrajectoryEvaluator.h"
#include "op_ros_helpers/ROSVelocityHandler.h"
#include "op_ros_helpers/op_ParamsHandler.h"
#include "op_ros_helpers/ROSMapHandler.h"

namespace TrajectoryEvaluatorNS
{
Expand Down Expand Up @@ -75,6 +76,7 @@ class TrajectoryEvalCore
PlannerHNS::PlanningParams m_PlanningParams;
PlannerHNS::PlanningParams m_ModPlanningParams;
PlannerHNS::CAR_BASIC_INFO m_CarInfo;
PlannerHNS::MapHandler m_MapHandler;

PlannerHNS::BehaviorState m_CurrentBehavior;
double m_AdditionalFollowDistance;
Expand Down
2 changes: 2 additions & 0 deletions op_local_planner/launch/op_common_params.launch
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<arg name="enableTrafficLightBehavior" default="false" />
<arg name="enableStopSignBehavior" default="false" />
<arg name="enableLaneChange" default="false" />
<arg name="enableBlockingRolloutsOutOfMap" default="false" />

<!-- Vehicle Info, shared with controller and simulation -->
<arg name="height" default="1.47" />
Expand Down Expand Up @@ -92,6 +93,7 @@
<param name="enableTrafficLightBehavior" value="$(arg enableTrafficLightBehavior)" />
<param name="enableStopSignBehavior" value="$(arg enableStopSignBehavior)" />
<param name="enableLaneChange" value="$(arg enableLaneChange)" />
<param name="enableBlockingRolloutsOutOfMap" value="$(arg enableBlockingRolloutsOutOfMap)" />

<param name="height" value="$(arg height)" />
<param name="front_length" value="$(arg front_length)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ TrajectoryEvalCore::TrajectoryEvalCore()

m_TrajectoryCostsCalculator.SetEvalParams(m_EvaluationParams);
PlannerHNS::ROSHelpers::InitCollisionPointsMarkers(500, m_CollisionsDummy);

m_MapHandler.InitMapHandler(nh, "/op_common_params/mapSource",
"/op_common_params/mapFileName", "/op_common_params/lanelet2_origin");
}

TrajectoryEvalCore::~TrajectoryEvalCore()
Expand Down Expand Up @@ -105,6 +108,7 @@ void TrajectoryEvalCore::UpdatePlanningParams(ros::NodeHandle& _nh)
_nh.getParam("/op_common_params/minDistanceToAvoid", m_PlanningParams.minDistanceToAvoid);
_nh.getParam("/op_common_params/maxDistanceToAvoid", m_PlanningParams.maxDistanceToAvoid);
_nh.getParam("/op_common_params/speedProfileFactor", m_PlanningParams.speedProfileFactor);
_nh.getParam("/op_common_params/enableBlockingRolloutsOutOfMap", m_PlanningParams.enableBlockingRolloutsOutOfMap);

_nh.getParam("/op_common_params/enableLaneChange", m_PlanningParams.enableLaneChange);
if(!m_PlanningParams.enableLaneChange)
Expand Down Expand Up @@ -231,7 +235,7 @@ void TrajectoryEvalCore::callbackGetGlobalPlannerPath(const autoware_msgs::LaneA

void TrajectoryEvalCore::callbackGetLocalPlannerPath(const autoware_msgs::LaneArrayConstPtr& msg)
{
if(msg->lanes.size() != (m_PlanningParams.rollOutNumber + 1))
if(msg->lanes.size() != m_GlobalPaths.size()*(m_PlanningParams.rollOutNumber + 1))
{
std::cout << " ### Waiting until nodes are synchronized, Generated rollouts = " << msg->lanes.size() << ", But They should = " << m_PlanningParams.rollOutNumber + 1 << std::endl;
return;
Expand Down Expand Up @@ -434,7 +438,10 @@ void TrajectoryEvalCore::MainLoop()
while (ros::ok())
{
ros::spinOnce();

if( ! m_MapHandler.IsMapLoaded())
{
m_MapHandler.LoadMap(m_TrajectoryCostsCalculator.m_Map, m_PlanningParams.enableLaneChange);
}

if(bNewCurrentPos)
{
Expand Down