Remapping - Why can't I see any PointCloud data from these rostopics

asked 2022-05-07 10:28:52 -0600

kiru gravatar image

updated 2022-05-07 10:34:28 -0600

I am trying to implement this project: https://github.com/praveen-palanisamy...

I am using RPLidar. So, the first thing to do was:

According to the instructions, I needed to publish pointclouds to /filtered_cloud ROS topic.

It says:

By default, the ROS node for the sensor will publish data on some default topic. For example, the Velodyne VLP 16 node discussed above will publish the point cloud data to: the /velodyne_points. You can easily remap the topics so that the data gets published on to the /filtered_cloud topic by using this line in your roslaunch file (VLP16_points.launch)

3 things to consider:

1. I am using RPlidar and rplidar.launch file is read-only.

2. Lidar was not publishing any pointcloud data after roslaunch rplidar_ros rplidar.launch. I could see only laser scan from Rviz. So I should have remapped the laser scan data ---> to pointcloud data.

3. I learned that I can not directly publish the laser scan data (/scan) to the pointcloud (/filtered_cloud) topic, so I used laser_assembler package that converts the laser scans to point cloud, here are the codes:

Assembler.launch

<launch>
  <node name="laser_scan_assembler"          pkg="laser_assembler"  type="laser_scan_assembler" output="screen">
    <remap from="scan" to="/scan"/>
    <param name="fixed_frame"            type="string"   value="laser"/>
  </node>

service_client.launch

<launch>
  <node name="test_client"          pkg="laser_assembler_demo"  type="call_assembler.py" output="screen">
  </node>
</launch>

call_assembler.py

#!/usr/bin/env python

import rospy
from laser_assembler.srv import *
from sensor_msgs.msg import PointCloud2

rospy.init_node("test_client") 
rospy.wait_for_service("assemble_scans2")
assemble_scans = rospy.ServiceProxy('assemble_scans2',AssembleScans2)
pub = rospy.Publisher("/filtered_cloud", PointCloud2, queue_size = 1)
r = rospy.Rate(1)

while not rospy.is_shutdown():
    try:
        resp = assemble_scans(rospy.Time(0,0), rospy.get_rostime())
        print ("Got cloud with ",len(resp.cloud.data), "points")
        pub.publish(resp.cloud)

    except rospy.ServiceException as e:
        print ("Service call failed:", e)

    r.sleep()

Before all these remappings, I could not see any topic or data on the pointcloud area. Now I can see the point clouds on filtered_cloud topic from rviz

But, in the project, in addition to filtered_cloud topic, there are also some clustered topics in pointcloud section. And I can not see any data when I select any of them Instructions were saying:

As long as you have the point clouds published on to the filtered_cloud rostopic, you should see outputs from this node published onto the obj_id, cluster_0, cluster_1, …, cluster_5 topics along with the markers on viz topic which you can visualize using RViz.

But even though I can see filtered_cloud topic now, I can not see anything when I click on any other topics.

So I wonder if I missed anything when getting the filtered_cloud data.

Here were the commands:

>roslaunch rplidar_ros rplidar.launch
>rosrun rviz rviz
>rosrun tf static_transform_publisher 0 0 0 0 0 0 map laser 50

>roslaunch laser_assembler_demo assembler.launch
>roslaunch laser_assembler_demo service_client.launch

>rosrun multi_object_tracking_lidar kf_tracker

I can not upload any picture because of low user points, sorry for the complicated explanation. And I am really noob with ROS ... (more)

edit retag flag offensive close merge delete

Comments

The code you've shown above looks ok. I'd guess that the kf_tracker node only publishes a message when it finds something interesting, and your pointcloud input isn't providing what it is looking for. For example, does an "interesting" thing need to be more than 1 point in height?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-05-07 11:52:42 -0600 )edit

Here is the project owner's implementation: https://www.youtube.com/watch?v=cz5X8.... He also uses a 2D Lidar, the laser scan data looks just like mine

kiru gravatar image kiru  ( 2022-05-07 12:19:06 -0600 )edit

OK, I'll take your word that his app processes 2d lidar data. You should check whether the lidar is working as you expect: Have you displayed your /filtered_cloud data in rviz? If you move an object into range, are the corresponding pixels displayed in rviz?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-05-07 14:36:32 -0600 )edit