diff --git a/gazebo_plugins/src/gazebo_ros_utils.cpp b/gazebo_plugins/src/gazebo_ros_utils.cpp index 5920f4852..40c795739 100644 --- a/gazebo_plugins/src/gazebo_ros_utils.cpp +++ b/gazebo_plugins/src/gazebo_ros_utils.cpp @@ -85,6 +85,11 @@ void GazeboRos ::readCommonParameter() { tf_prefix_ = tf::getPrefixParam(*rosnode_); + if(tf_prefix_.empty()) + { + tf_prefix_ = namespace_; + boost::trim_right_if(tf_prefix_,boost::is_any_of("/")); + } ROS_INFO_NAMED("utils", "%s: = %s", info(), tf_prefix_.c_str()); }