Skip to content

Commit

Permalink
Fix distance margin typo and update comments in entity_base.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
curious-jp committed Apr 17, 2024
1 parent 0739cf9 commit eb81bd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions simulation/traffic_simulator/src/entity/entity_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,23 +958,23 @@ auto EntityBase::requestSynchronize(
auto entity_velocity_to_synchronize = entity_velocity;

auto accel_limit_ = accel_limit * 1;
auto const distance_mergin = threshold;
auto const distance_margin = threshold;

if (entity_velocity > accel_limit * ego_arrival_time) {
/**
* @brief Making entity slow down sice the speed is too fast
* @brief Making entity slow down since the speed is too fast
*/
entity_velocity_to_synchronize = entity_velocity - accel_limit_ * loop_period / 1000;
} else if (
entity_velocity * ego_arrival_time - entity_velocity * entity_velocity / (accel_limit * 2) <
entity_distance - distance_mergin) {
entity_distance - distance_margin) {
/**
* @brief Making entity speed up
*/
entity_velocity_to_synchronize = entity_velocity + accel_limit_ * loop_period / 1000;
} else if (
entity_velocity * ego_arrival_time - entity_velocity * entity_velocity / (accel_limit * 2) >
entity_distance - distance_mergin) {
entity_distance - distance_margin) {
/**
* @brief Making entity slow down
*/
Expand Down

0 comments on commit eb81bd9

Please sign in to comment.