Closed TZECHIN6 closed 1 year ago
The answers to your questions depend on several factors:
frame_id
- this is the field in messages that gives the name of the fixed frame of reference in which the sensor data were taken. This must be different for each sensor. target_frame
- in rviz2
, this is the frame of reference in which the camera is placed. fixed_frame
- in rviz2
, this is the frame of reference to which all data are transformed if they aren't already in it.Some general information about frames of reference in ROS: Each sensor must have a fixed frame of reference with it's own name (i.e. frame_id
). Then, to visualize data from more than one sensor, you must either have a 3rd, common frame of reference (e.g. base_link
) or pick one of the sensor's frames of reference as the fixed_frame
. In order for rviz2
to know how to transform sensor data from each sensor to the common reference frame or from one sensor's frame of reference to the other sensor's frame of reference, there must exist a "transform tree." A set of transformations between the frames which define their translation and orientation differences. These transforms must be published to either /tf
or /tf_static
. You can do this using the tool static_transform_publisher
. If you are just using the two lidars, the tree would look like this:
lidar_1 <-> lidar_2
However, if you are using a 3rd, common frame (more likely) then the tree would look something like this:
base_link <-> lidar_1
^
|
v
lidar_2
The <->
s indicate transforms which are published using tf2
. I hope this helps.
Please re-open if there are additional issues.
First of all, this topic seem very similar to this https://github.com/ros-drivers/velodyne/pull/330
I pulled the ros2 branch as I am working in ROS2 Galactic. I am trying to run 2 VLP16 in a single launch file in the same PC with switch.
The IP and port of both LIDAR are configured and can be seen the lidar-scan individually. I follow the online setup from others, most of them changed their frame_id as lidar_left/lidar_right, which gives different name. When I change the frame_id, it keeps "velodyne" and my new setup doesnt take effect on this parameter.
I am working in a Docker environment (ROS2 Galactic ubuntu 20.04).
Below are the questions I would like to seek help from the community: