0
$\begingroup$

Rosanswers logo

Hey guys,

I am in the process of using a ROS package (https://github.com/beltransen/lidar_bev) that converts PointCloud data into Bird Eye View images. I have successfully installed the package with catkin. I use my own launch file (supplemented with that of the ROS package) to import bag files and get the desired images. The input message is sensor_msgs/PointCloud2, which is also included in my bag files.

My first question would be, can the bag files only contain this one message in order to run it compatible with the package?

Attached is my launch file:

<launch>
< !--1. start bag files playback-- >

< node pkg ="rosbag" type="play" name="bag_files_playback" output="screen" args="/home/pkatsoulakos/catkin_ws/src/launch/rosbags/Besprechungsraum/_2022-03-23-08-37-50_0.bag  /home/pkatsoulakos/catkin_ws/src/launch/rosbags/Besprechungsraum/_2022-03-23-08-39-07_2.bag"/ >

< !-- 2. topics and frames -- >

< arg name="cloud_topic" default="/velodyne_points"/>

    < arg name="lidar_tf_frame" default="/velodyne"/>

    < arg name="camera_tf_frame" default="/stereo_camera"/> 

< !-- MAP CONFIGURATION -- >

    <arg name="camera_fov" default="110.0"/>
    <arg name="intensity_threshold" default="0.05" />
    <arg name="cell_size" default="0.05" />
    <arg name="cell_size_height_map" default="0.25" />
    <arg name="max_height" default="3.0" />
    <arg name="num_slices" default="1" />
    <arg name="grid_dim" default="70" />
    <arg name="grid_dim_height_map" default="300" />
    <arg name="height_threshold" default="0.10" />
    <arg name="crop_180" default="true" />
    <arg name="remove_floor" default="false" />
    
< !-- VLP16 change for my purposes?-- >

    <arg name="planes" default="16" />
    <arg name="h_res" default="0.2" />
    <arg name="v_res" default="1.33" />
    <arg name="low_opening" default="-10" />
    <arg name="max_expected_intensity" default="5" />
    
< !--2. start lidar_bev-- >

< node pkg="lidar_bev" type="lidar_bev" name="lidar_bev_run" output="screen" >

        <param name="cloud_topic" value="$(arg cloud_topic)"/>
        <param name="lidar_tf_frame" value="$(arg lidar_tf_frame)"/>
        <param name="camera_tf_frame" value="$(arg camera_tf_frame)"/>
        <param name="camera_fov" value="$(arg camera_fov)"/>
        <param name="planes" value="$(arg planes)"/>
        <param name="h_res" value="$(arg h_res)"/>
        <param name="v_res" value="$(arg v_res)"/>
        <param name="low_opening" value="$(arg low_opening)"/>
        <param name="cell_size" value="$(arg cell_size)"/>
        <param name="grid_dim" value="$(arg grid_dim)"/>
        <param name="max_height" value="$(arg max_height)"/>
        <param name="num_slices" value="$(arg num_slices)"/>
        <param name="height_threshold" value="$(arg height_threshold)"/>
        <param name="cell_size_height_map" value="$(arg cell_size_height_map)"/>
        <param name="grid_dim_height_map" value="$(arg grid_dim_height_map)"/>
        <param name="max_expected_intensity" value="$(arg max_expected_intensity)"/>
        <param name="crop_180" value="$(arg crop_180)"/>
        <param name="remove_floor" value="$(arg remove_floor)"/>

    </node> 

</launch>

I would be very grateful if someone could help me to make this conversion.

image description


Originally posted by Petros ADLATUS on ROS Answers with karma: 28 on 2022-03-25

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

This may be accomplished with the --topics option. ref: http://wiki.ros.org/rosbag/Commandline#play

Check the topic name in sensor_msgs/PointCloud2. If it is named point_cloud2, only the sensor_msgs/PointCloud2 topic will be played in the following.

< node pkg ="rosbag" type="play" name="bag_files_playback" output="screen" args="/home/pkatsoulakos/catkin_ws/src/launch/rosbags/Besprechungsraum/_2022-03-23-08-37-50_0.bag  /home/pkatsoulakos/catkin_ws/src/launch/rosbags/Besprechungsraum/_2022-03-23-08-39-07_2.bag --topics point_cloud2"/ >

UPDATE

I think the following steps will move us forward

Try running rostopic echo /lidar_run/yrl_cloud while playing rosbag. Check the frame_id in the output result.

The name you checked is reflected in the following in the launch file. ( Replace the string checked above with /velodyne. )

 < arg name="lidar_tf_frame" default="/velodyne"/>

Originally posted by miura with karma: 1908 on 2022-03-25

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by Petros ADLATUS on 2022-03-28:
Hey,

I tried your advice with the topic name. It's --topics /lidar_run/yrl_cloud, but it gives me the same Warning message:

[WARN] [1648447358.591702320: "velodyne" passed to lookupTransform argument target_frame does not exist.

And honestly I don't know how I can add the target_frame or what must be the necessary step. My idea is to finish writing the launch file (add the image save part), so that the Output message: bird_view (sensor_msgs/Image): BEV image (see github) from this package can be saved as Image..

Comment by miura on 2022-03-28:
Thanks for trying. I updated my answer.

Comment by Petros ADLATUS on 2022-03-28:
hey,

I find out that the default=" " of the lidar_tf_frame is the problem. I searched the frame, which comes from my LiDAR, called yrl_cloud_id and passed it there (launch file and C++ Code of the package), but it still gives me the same warning.The package tf is used to transform the coordinates of Sensor for my application on the computer, can it be that I have to do this again for using the ROS package?

You can look at line 331 - 350 for better understanding

Comment by miura on 2022-03-29:
What if we drop my suggestion --topics /lidar_run/yrl_cloud and make it possible to refer to all of rosbag's data? It is possible that /tf was there originally but is not being referenced because of the use of --topics.

If this does not solve the problem, could you check the TF tree with rosrun tf view_frames and share it with us? ( ref https://wiki.ros.org/tf/Debugging%20tools#Viewing_TF_trees )

Comment by Petros ADLATUS on 2022-03-29:
I would like to share all the information with you, but my status is too low for uploading photos etc. How do we establish a workaround for this? Email? Of Course i would post the answer here, in fact that maybe other people want to use this ROS package

Comment by miura on 2022-03-30:
Can you please make it publicly available on Imgur, google photo, etc. and post a link to it? I will download it and post the image here.

Comment by Petros ADLATUS on 2022-03-31:
https://photos.app.goo.gl/xSs5JBNWG13bLLib8 hope it works. I fixed the param name cloud topic in my launch file, but dont understand why the source frame, camera_frame is missing. as i understand it, the package is based on the encoding of birdnet and birdnet+ with pure point cloud data without camera recordings. I still add my launch file and the code I changed (https://drive.google.com/drive/folders/1mfjsSZH8zNVaPOYYTTunYa_1sDG9X30M?usp=sharing).

thanks a lot for your help

Comment by miura on 2022-03-31:
Thanks for the image, I pasted the TF tree at the end of the question. By the way, it is recommended to paste text rather than screenshots for code excerpts and logs.

Comment by miura on 2022-03-31:
Couldn't I just change the following

<!--1. start bag files playback with specific topic-->
<node pkg ="rosbag" type="play" name="bag_files_playback" output="screen"
      args="/home/pkatsoulakos/catkin_ws/src/launch/rosbags/Besprechungsraum/_2022-03-30-13-20-37_0.bag --clock --topics /lidar_run/yrl_cloud"/>


<node pkg="tf" type="static_transform_publisher" name="lidar_broadcaster" args="0.0 0.0 0.0 0.0 -0.0 0.0 1.0 map yrl_cloud_id 200"/>

to

<!--1. start bag files playback with specific topic-->
<node pkg ="rosbag" type="play" name="bag_files_playback" output="screen"
      args="/home/pkatsoulakos/catkin_ws/src/launch/rosbags/Besprechungsraum/_2022-03-30-13-20-37_0.bag"/>

in launch? It appears to me that you are correct in not using the --topics suggested in my first response.

Comment by Petros ADLATUS on 2022-04-02:
here is the example from http://wiki.ros.org/rosbag/Commandline:

$ rosbag play recorded1.bag --topics /topic1 /topic2 /topic3

I don't think it's a matter of using --topics or not. The problem is, that the Source Code respectively the launch file expected the transformed lidar frame and the position of the camera(not physical), which creates the BEV. Have you looked at the repo with code and launch file?

Comment by miura on 2022-04-02:
I had checking the code. ( I have not read it meticulously. )

You need to use the topic /tf to indicate the rider frame and camera position, I expect the rosbag file /tf to be included and I don't think it is necessary to limit the topics used in --topics.

Do it not have all the necessary inputs in the rosbag file?

Comment by Petros ADLATUS on 2022-04-03:
I will try your suggestion of 31 March tomorrow morning (no topic limit). The problem is that in the .bag file there is no camera frame in the /tf topic, as in the .bag file data is read in and stored from a LiDAR sensor. So I have a guess, but still questions. This is my information: LiDAR frame: parent_frame = "map" is set to (0, 0, 0) by YUJIN Robot. child_frame = "yrl_cloud_id" also(although this makes little sense, via the terminal I can correct this with static_transform_publisher. In the launch file I have /map/yrl_cloud_id as lidar_tf_frame (transformations frame from the origin (ground)). Now the unsure about the camera_tf_frame argument, my guess it's not a physical camera, but the specification for the viewing angle to create the bird's eye view.

Comment by Petros ADLATUS on 2022-04-03:
Now the unsure about the camera_tf_frame argument, my guess it's not a physical camera, but the specification for the viewing angle to create the bird's eye view. Could I just "invent" a parent&child_frame and set it in the launch file via static_transform_publisher 1.5 meter forward and 3m high? For example: <node pkg="tf" type="static_transform_publisher" name="camera_broadcaster" args="1.5 0 3 0 0 1 base_camera camera 100" />.I'm with definitely not sure if the node needs a real camera or not, in the first case all the information would come via an appropriate theme with message, like with LiDAR :/

Comment by miura on 2022-04-04:
Since the input topic is a point cloud of lidar, I agree that the camera should have no problem describing the position.It would be appropriate to use static_transform_publisher to describe the positional relationship.

Since the camera would need to be facing down, the value of pitch would need to be changed.

Also, since static_transform_publisher is used to describe relative positioning, it should be yrl_cloud_id camera, not base_camera camera.

Comment by Petros ADLATUS on 2022-04-05:
yes I agree with you, have changed the Quaternion coordinates so, that the view of the camera looks down (BEV). But one thing I found in the source code and launch file was the camera_tf_frame: /camera_color_left and /stereo_camera. It is possible that these are parent and child frame and they must be used by my static_transform_publisher? Or should I use the transformation from yrl_cloud_id to camera and change this in the code&launch file ? Doesn't matter I think..

Option 1:

<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster" args="2.0 0.0 3.0 0.707 0.0 0.0 0.707 stereo_camera camera_color_left 100"/>

Option 2:

<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster" args="2.0 0.0 3.0 0.707 0.0 0.0 0.707 yrl_cloud_id camera 100"/>

Comment by miura on 2022-04-05:
The direction of Option2 would be correct. The /tf notes the relative relationship between one coordinate and another. The existing coordinates are map and yrl_cloud_id, so if one of them doesn't appear, you won't know where you are.

Change Option2 and launch

 < arg name="camera_tf_frame" default="/camera"/> 

Or move static_transform_publisher as follows

<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster" args="2.0 0.0 3.0 0.707 0.0 0.707 yrl_cloud_id stereo_camera 100"/>

If you also need camera_color_left, you can run two static_transform_publishers, but be aware that only one of them will work unless you use a different name.

<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster1" args="2.0 0.0 3.0 0.707 0.0 0.707 yrl_cloud_id stereo_camera 100"/>
<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster2" args="0.2 0.0 0.0 0.0 0.0 camera_color_left stereo_camera 100"/>

Comment by miura on 2022-04-05:
Visualization with rosrun tf view_frames is recommended if necessary.

Comment by Petros ADLATUS on 2022-04-07:
@miura the given arguments in the launch file seem to be accepted as far as they go (a picture: https://drive.google.com/drive/folders/1mfjsSZH8zNVaPOYYTTunYa_1sDG9X30M?usp=sharing), however for the script map_points_map.py no numpy seems to be available, although I installed it with:

sudo apt-get install python3-numpy

sudo apt-get install ros-noetic-ros-numpy

P.S. do not be surprised about the launch file I have changed the transformation a bit (image in the cloud)

Comment by miura on 2022-04-07:
ROS1 uses python2, so the

sudo apt install python-numpy

Or you can use

sudo apt install python2-numpy

may work.

Or

pip install numpy

You may need to install it in a way other than apt with

Comment by Petros ADLATUS on 2022-04-25:
@miura Hey,

I have meanwhile filtered my pointcloud data and corrected max_points_map.py (author's error). It seems like I'm close to getting the images I want with the node lidar_bev. The topic bird_view is published by the node and is subscribed by the image_saver to store the images. However, there are synchronization problems, which I have not been able to solve so far. The number of messages received also seems very low to me? could you add the picture (https://drive.google.com/file/d/1ChhBSJDKE65TqzJFF4aLVYlHdCUgUAok/view?usp=sharing) to the question?

Comment by miura on 2022-04-25:
I have been too busy to comment.

I checked the image and it is a terminal capture. It is recommended to paste the text, not the image, for terminal information. This is to enable searching.

Comment by Petros ADLATUS on 2022-04-26:
Terminal messages, after executing the node: from image_saver.cpp: [ WARN] [1650949246.055883948]: Couldn't save image, no data!

[ WARN] [1650949253.834410690]: [image_transport] Topics '/bird_view' and '/camera_info' do not appear to be synchronized. In the last 10s:
        Image messages received:      8
        CameraInfo messages received: 0
        Synchronized pairs:           0
$\endgroup$
0
$\begingroup$

Rosanswers logo

alternative solution: I finally gave up with this node, because the support isn't good enough (no Issues, no other users of it) and solve it with this node: https://github.com/mjshiggins/ros-examples. I have modified (image size, colored pointcloud, resolution) the node a little bit, cause the default settings aren't good enough for my purposes. Hope this helps everyone who wants to create LiDAR images for Deep Learning usage.


Originally posted by Petros ADLATUS with karma: 28 on 2022-05-03

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.