mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
Fixup: adding cost calculations to connect and move_to
Need to handle nullptr trajectories.
This commit is contained in:
parent
f7b259259e
commit
6ff1a5162f
@ -189,6 +189,8 @@ Connect::makeSequential(const std::vector<robot_trajectory::RobotTrajectoryConst
|
||||
// calculate cost
|
||||
double cost = 0;
|
||||
for (const auto& trajectory : sub_trajectories) {
|
||||
if (!trajectory)
|
||||
continue;
|
||||
for (const double& distance : trajectory->getWayPointDurations())
|
||||
cost += distance;
|
||||
}
|
||||
@ -224,6 +226,8 @@ SubTrajectoryPtr Connect::merge(const std::vector<robot_trajectory::RobotTraject
|
||||
// calculate cost
|
||||
double cost = 0;
|
||||
for (const auto& trajectory : sub_trajectories) {
|
||||
if (!trajectory)
|
||||
continue;
|
||||
for (const double& distance : trajectory->getWayPointDurations())
|
||||
cost += distance;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user