This repository provides an implementation to quickly visualzie/acquire tf2 transformation values in Rviz2.
The project is built to create a user friendly custom plugin which helps the users to select any two given frames and visualize the transform data between the selected frames. We use a simple tf2 buffer and tf2 listener to get the frame names and to look up the transform values (translation, totation, euler value) betweeen them. The values dynamically updates at a rate of 5 Hz.
This project was developed by Gokhul Raj Ravikumar at Fraunhofer IIS/EAS.
Before using the project, ensure you have a ROS2 (Humble) environment set up on your system.
- ROS2 Humble.
- Rviz2.
- Navigate to src folder in your directory:
cd ~/ros2_ws/src
- clone this package:
git clone https://github.com/Fraunhofer-IIS/rviz2_tf_transform_lookup.git
Run the following command to install all the dependencies defined for this package:
rosdep update
rosdep install --from-paths src --ignore-src -r -y
Once the dependencies are installed, you can build the project using colcon
.
-
Navigate to your workspace directory:
cd ~/ros2_ws
-
Build the workspace:
colcon build --symlink-install
-
After the build is complete, source your workspace:
source install/setup.bash
Follow the steps below to add the custom panel to your RViz2 interface:
-
Launch RViz2:
ros2 run rviz2 rviz2
-
In RViz2, go to
Panels
in the top menu bar and selectAdd New Panel
. -
Then choose the plugin panel(
TfLookup
) which will be under the rviz2_tf_transform_lookup folder. -
The panel should now appear in your RViz2 window. yiu can save the config for convenience.
-
select the From (
TF_Frame_1
) and to (TF_Frame_2
) according to your choice to visualize the transform values. -
The copy button next to each value fields can be enabled with a click, it copies the displayed transform values to the clipboard.