diff --git a/source/RobotAPI/components/units/RobotUnit/Units/TrajectoryControllerSubUnit.cpp b/source/RobotAPI/components/units/RobotUnit/Units/TrajectoryControllerSubUnit.cpp index 008b17db91aa5302376129cc3ea4df5294f7e418..85ab576eeb6c5b6231076ff16fa562fe8053e13c 100644 --- a/source/RobotAPI/components/units/RobotUnit/Units/TrajectoryControllerSubUnit.cpp +++ b/source/RobotAPI/components/units/RobotUnit/Units/TrajectoryControllerSubUnit.cpp @@ -168,7 +168,14 @@ void TrajectoryControllerSubUnit::loadJointTraj(const TrajectoryBasePtr& jointTr return; } - this->jointTraj = this->jointTraj->normalize(0, *this->jointTraj->getTimestamps().rbegin() - *this->jointTraj->getTimestamps().begin()); + if (this->jointTraj->size() == 0) + { + ARMARX_ERROR << "Error when loading TrajectoryPlayer: trajectory is empty !!!"; + return; + } + + auto startTime = this->jointTraj->begin()->getTimestamp(); + this->jointTraj->shiftTime(-startTime); usedJoints = this->jointTraj->getDimensionNames(); ARMARX_INFO << VAROUT(usedJoints);