-
Notifications
You must be signed in to change notification settings - Fork 1
RJD-1509 Filter nearest NPCs to calculate distance #48
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
base: RJD-1509/methods_optimization
Are you sure you want to change the base?
RJD-1509 Filter nearest NPCs to calculate distance #48
Conversation
simulation/traffic_simulator/include/traffic_simulator/behavior/behavior_plugin_base.hpp
Outdated
Show resolved
Hide resolved
simulation/traffic_simulator/include/traffic_simulator/entity/entity_manager.hpp
Outdated
Show resolved
Hide resolved
3adec57
to
ef231da
Compare
ef231da
to
5b6c046
Compare
} | ||
|
||
for (const auto & [euclidean_distance, name] : euclidean_distances) { | ||
const auto quat = math::geometry::getRotation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quaternion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return false; | ||
} | ||
|
||
void EntityBase::setDistances(const std::shared_ptr<EuclideanDistancesMap> & distances) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setEuclideanDistancesMap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
distances.emplace_back(distance.value()); | ||
if (euclidean_distances_map != nullptr) { | ||
std::map<double, std::string> euclidean_distances; | ||
double stopDistance = calculateStopDistance(behavior_parameter.dynamic_constraints); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const double
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if ( | ||
std::fabs(math::geometry::convertQuaternionToEulerAngle(quat).z) <= | ||
boost::math::constants::half_pi<double>()) { | ||
const auto distance = getDistanceToTargetEntity(spline, other_entity_status.at(name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
longitudinal_distance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
entities.emplace_back(name); | ||
distances.emplace_back(distance.value()); | ||
if (euclidean_distances_map != nullptr) { | ||
std::map<double, std::string> euclidean_distances; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local_euclidean_distances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
c58be5a
to
dc503c6
Compare
5b6c046
to
49a9ef5
Compare
distances.emplace_back(distance.value()); | ||
if (euclidean_distances_map != nullptr) { | ||
std::map<double, std::string> local_euclidean_distances_map; | ||
const double stopDistance = calculateStopDistance(behavior_parameter.dynamic_constraints); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stop_distance
49a9ef5
to
4beca20
Compare
Description
This PR implements optimization of calculating actual distance in ActionNode::getDistanceToTargetEntity only for nearest NPCs.
Abstract
ActionNode::getDistanceToTargetEntity should calculate boundingBoxLaneLongitudinalDistance only for nearest NPC. This is done based on DistancesMap containg shortest distance between mapPose of NPCs.
Details
Destructive Changes
--
Known Limitations
--
References
RJD-1509