title: Unable to visualise PointCloud in Rviz (ROS) from publisher and subscriber node
body: <p>I am using the below code for publisher and subscriber. I am able to visualise PointCloud on Rviz for input node but failed to visualise output node. As i am quite new in ROS. How i can solve the problem? I have even  set in Rviz the Fixed Frame: base_link.</p>
  
  <pre><code>ros::Subscriber subPointCloud;
  ros::Publisher pubPointCloud;
  
  void DEM(const sensor_msgs::PointCloud2ConstPtr&amp; input)
  {
    ROS_DEBUG("Point Cloud Received");
    pcl::PointCloud&lt;pcl::PointXYZ&gt;::Ptr cloud (new pcl::PointCloud&lt;pcl::PointXYZ&gt;);
    sensor_msgs::PointCloud2 output;
  
    // Convert from ROS message to PCL point cloud
    pcl::fromROSMsg(*input, *cloud);
    pcl::toROSMsg(*cloud, output);
  
    output.header.stamp = ros::Time::now();
    output.header.frame_id = "/baselink";
    pubPointCloud.publish(output);
  
    }
  
  
  int main(int argc, char** argv)
  {
    ROS_INFO("Starting LIDAR Node");
    ros::init(argc, argv, "kitti_lidar_node");
    ros::NodeHandle nh;
  
    subPointCloud = nh.subscribe&lt;sensor_msgs::PointCloud2&gt;("input", 1, DEM);
    pubPointCloud = nh.advertise&lt;pcl::PointCloud&lt;pcl::PointXYZ&gt; &gt; ("output", 1);
  
    ros::spin();
  
    return 0;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/tb8r7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tb8r7.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ty24o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ty24o.png" alt="enter image description here"></a></p>