diff --git a/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.cpp b/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.cpp index 17431d8ea90a87028c6ca66b410bd748c6e41231..2ae7f289e84e730e229e30f045e0781756d7568c 100644 --- a/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.cpp +++ b/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.cpp @@ -131,6 +131,14 @@ namespace armarx::navigation::traj_ctrl { ARMARX_CHECK_NOT_NULL(robot) << "Robot not available"; + if (trajectory.points().empty()) + { + ARMARX_INFO << "Trajectory is empty."; + return TrajectoryControllerResult{ + .twist = core::Twist::Zero(), + .dropPoint = {.waypoint = {.pose = core::Pose::Identity()}, .velocity = 0}}; + } + const core::Pose currentPose(robot->getGlobalPose()); const auto projectedPose = trajectory.getProjection(