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

fix(goal_planner): remove velocity factor #1739

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class GoalPlannerModule : public SceneModuleInterface
// steering factor
void updateSteeringFactor(
const PullOverContextData & context_data, const std::array<Pose, 2> & pose,
const std::array<double, 2> distance, const uint16_t type);
const std::array<double, 2> distance);

// rtc
std::pair<double, double> calcDistanceToPathChange(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ GoalPlannerModule::GoalPlannerModule(
initializeSafetyCheckParameters();
}

steering_factor_interface_.init(PlanningBehavior::GOAL_PLANNER);
velocity_factor_interface_.init(PlanningBehavior::GOAL_PLANNER);

/**
* NOTE: Add `universe_utils::ScopedTimeTrack st(__func__, *time_keeper_);` to functions called
* from the main thread only.
Expand Down Expand Up @@ -1360,20 +1357,8 @@ void GoalPlannerModule::setTurnSignalInfo(

void GoalPlannerModule::updateSteeringFactor(
const PullOverContextData & context_data, const std::array<Pose, 2> & pose,
const std::array<double, 2> distance, const uint16_t type)
const std::array<double, 2> distance)
{
const uint16_t steering_factor_direction = std::invoke([&]() {
const auto turn_signal = calcTurnSignalInfo(context_data);
if (turn_signal.turn_signal.command == TurnIndicatorsCommand::ENABLE_LEFT) {
return SteeringFactor::LEFT;
} else if (turn_signal.turn_signal.command == TurnIndicatorsCommand::ENABLE_RIGHT) {
return SteeringFactor::RIGHT;
}
return SteeringFactor::STRAIGHT;
});

steering_factor_interface_.set(pose, distance, steering_factor_direction, type, "");

const uint16_t planning_factor_direction = std::invoke([&]() {
const auto turn_signal = calcTurnSignalInfo(context_data);
if (turn_signal.turn_signal.command == TurnIndicatorsCommand::ENABLE_LEFT) {
Expand Down Expand Up @@ -1597,12 +1582,9 @@ void GoalPlannerModule::postProcess()

updateSteeringFactor(
context_data, {pull_over_path.start_pose(), pull_over_path.modified_goal_pose()},
{distance_to_path_change.first, distance_to_path_change.second},
has_decided_path ? SteeringFactor::TURNING : SteeringFactor::APPROACHING);
{distance_to_path_change.first, distance_to_path_change.second});

set_longitudinal_planning_factor(pull_over_path.full_path());

setVelocityFactor(pull_over_path.full_path());
}

BehaviorModuleOutput GoalPlannerModule::planWaitingApproval()
Expand Down
Loading