diff --git a/src/image_undistort.cpp b/src/image_undistort.cpp index bafe124..d8cb90d 100644 --- a/src/image_undistort.cpp +++ b/src/image_undistort.cpp @@ -220,6 +220,8 @@ void ImageUndistort::imageCallback( } if (frame.empty()) { ROS_ERROR_ONCE("Image frame name is blank, cannot construct tf"); + } else if (frame == output_frame_) { + ROS_ERROR_ONCE("Input and output frame are identical ('%s'), cannot construct tf", frame.c_str()); } else { br_.sendTransform(tf::StampedTransform(tf::Transform(R_ros, p_ros), image_out_ptr->header.stamp, frame, diff --git a/src/stereo_undistort.cpp b/src/stereo_undistort.cpp index 141b1f9..1864aa8 100644 --- a/src/stereo_undistort.cpp +++ b/src/stereo_undistort.cpp @@ -246,6 +246,8 @@ void StereoUndistort::processAndSendImage( } if (frame.empty()) { ROS_ERROR_ONCE("Image frame name is blank, cannot construct tf"); + } else if (frame == first_output_frame_) { + ROS_ERROR_ONCE("Input and output frame are identical ('%s'), cannot construct tf", frame.c_str()); } else { br_.sendTransform(tf::StampedTransform(tf::Transform(R_ros, p_ros), image_out_ptr->header.stamp, @@ -275,6 +277,8 @@ void StereoUndistort::processAndSendImage( } if (frame.empty()) { ROS_ERROR_ONCE("Image frame name is blank, cannot construct tf"); + } else if (frame == first_output_frame_) { + ROS_ERROR_ONCE("Input and output frame are identical ('%s'), cannot construct tf", frame.c_str()); } else { br_.sendTransform(tf::StampedTransform(tf::Transform(R_ros, p_ros), image_out_ptr->header.stamp,