Skip to content

Commit

Permalink
refactor(ego_entity_simulation): rename flag name for considering slo…
Browse files Browse the repository at this point in the history
…pe in ego entity simulation

Signed-off-by: Kotaro Yoshimoto <[email protected]>
  • Loading branch information
HansRobo committed Feb 2, 2024
1 parent ada5f90 commit a4ef2cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class EgoEntitySimulation

traffic_simulator_msgs::msg::EntityStatus status_;

bool consider_road_slope_ = false;
const bool consider_acceleration_by_road_slope_;

public:
const std::shared_ptr<hdmap_utils::HdMapUtils> hdmap_utils_ptr_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ EgoEntitySimulation::EgoEntitySimulation(
vehicle_model_type_(getVehicleModelType()),
vehicle_model_ptr_(makeSimulationModel(vehicle_model_type_, step_time, parameters)),
hdmap_utils_ptr_(hdmap_utils),
consider_road_slope_(getParameter<bool>("consider_road_slope", false))
consider_acceleration_by_road_slope_(
getParameter<bool>("consider_acceleration_by_road_slope", false))
{
}

Expand Down Expand Up @@ -264,7 +265,7 @@ void EgoEntitySimulation::update(
} else {
auto input = Eigen::VectorXd(vehicle_model_ptr_->getDimU());

auto acceleration_by_slope = not consider_road_slope_ ? 0.0 : [this]() {
auto acceleration_by_slope = not consider_acceleration_by_road_slope_ ? 0.0 : [this]() {
// calculate longitudinal acceleration by slope
constexpr double gravity_acceleration = -9.81;
const double ego_pitch_angle = calculateEgoPitch();
Expand Down

0 comments on commit a4ef2cd

Please sign in to comment.