Rviz visualization_msgs::Marker显示如何取消拖影

最关键的一句 landmark_item.lifetime = ros::Duration(0.1);

            visualization_msgs::Marker landmark_item;
            landmark_item.pose.position.x = item.center_x;
            landmark_item.pose.position.y = item.center_y;
            landmark_item.pose.orientation.x = quat.x();
            landmark_item.pose.orientation.y = quat.y();
            landmark_item.pose.orientation.z = quat.z();
            landmark_item.pose.orientation.w = quat.w();
            landmark_item.header.frame_id = "car_laser";
            landmark_item.header.stamp = ros::Time::now();
            landmark_item.scale.x = kLandmarkMarkerScale;
            landmark_item.scale.y = kLandmarkMarkerScale;
            landmark_item.scale.z = kLandmarkMarkerScale;
            landmark_item.type = visualization_msgs::Marker::SPHERE;
            landmark_item.ns = "Landmarks";
            landmark_item.id = i;
            landmark_item.color.a = 1.0;
            landmark_item.color.r = 0;
            landmark_item.color.g = 255;
            landmark_item.color.b = 0;
            landmark_item.lifetime = ros::Duration(0.1);

你可能感兴趣的:(ROS)