Skip to content

Commit

Permalink
fix(goal_planner): remove velocity factor
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota committed Dec 26, 2024
1 parent 55ffc57 commit a55016b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
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

0 comments on commit a55016b

Please sign in to comment.