@@ -1170,7 +1170,12 @@ bool MoveItVisualTools::publishTrajectoryPath(const std::vector<robot_state::Rob
1170
1170
moveit_msgs::RobotTrajectory trajectory_msg;
1171
1171
robot_trajectory->getRobotTrajectoryMsg (trajectory_msg);
1172
1172
1173
- return publishTrajectoryPath (trajectory_msg, shared_robot_state_, blocking);
1173
+ // Use first trajectory point as reference state
1174
+ moveit_msgs::RobotState robot_state_msg;
1175
+ if (!trajectory.empty ())
1176
+ robot_state::robotStateToRobotStateMsg (*trajectory[0 ], robot_state_msg);
1177
+
1178
+ return publishTrajectoryPath (trajectory_msg, robot_state_msg, blocking);
1174
1179
}
1175
1180
1176
1181
bool MoveItVisualTools::publishTrajectoryPath (const robot_trajectory::RobotTrajectoryPtr& trajectory, bool blocking)
@@ -1195,7 +1200,12 @@ bool MoveItVisualTools::publishTrajectoryPath(const robot_trajectory::RobotTraje
1195
1200
}
1196
1201
}
1197
1202
1198
- return publishTrajectoryPath (trajectory_msg, shared_robot_state_, blocking);
1203
+ // Use first trajectory point as reference state
1204
+ moveit_msgs::RobotState robot_state_msg;
1205
+ if (!trajectory.empty ())
1206
+ robot_state::robotStateToRobotStateMsg (trajectory.getFirstWayPoint (), robot_state_msg);
1207
+
1208
+ return publishTrajectoryPath (trajectory_msg, robot_state_msg, blocking);
1199
1209
}
1200
1210
1201
1211
bool MoveItVisualTools::publishTrajectoryPath (const moveit_msgs::RobotTrajectory& trajectory_msg,
0 commit comments