Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I'm embarrassed to admit I went about this all wrong. Instead I should have just subscribed to the topic publishing the information I cared about instead of trying to get at the resulting frame transform.

I'm embarrassed to admit I went about this all wrong. Instead I should have just subscribed to the topic publishing the information I cared about instead of trying to get at the resulting frame transform.

First, a little context.

I'm new to robotics and ROS2. I'm building a custom robot as my learning platform. The robot contains a RealSense T265 and T455, both of which are mounted on top of a pan and tilt system. Fixed to the robot base is a ydlidar g2 laser scanner.

When I posted this question, I was experiencing an issue in that rviz2 Camera output showed the laser scan representation following the rgb camera when the pan and tilt was adjusted because there was no transform being applied to the joints that held the frame attached to the RealSense cameras. I was thrown off because I noticed that the T265 tracking camera published orientation to /odom_frame, therefore I figured (incorrectly) that I needed to get the transform from there. This is how I got to posting this question in the first place which was intended as a simplified version of what I was trying to ultimately accomplish.

This is how I started down the path of getting the transform between two frames. My next issue was that I was using the tf2 tutorial as my example to grab the transform. This tutorial seems to be written for ROS1, therefore it doesn't work out of the box on ROS2. This confusion is what led to my original question.

It turns out that it is MUCH simpler to follow the ROS2 topic subscription tutorial and adapt it to subscribe to the /tf topic. There is no need to mess around with TransformListener or Buffer which didn't seem to work as expected anyway.

I then realized that the T265 is publishing an Odometry topic which is exactly what I needed to update the joint state of the pan and tilt. Therefore, the solution to my actual issue was to a) subscribe to the Odometry topic from the T265 and then b) publish to the /joint_states topic to update the orientation of the pan and tilt.

I'm embarrassed to admit I went about this all wrong. Instead I should have just subscribed to the topic publishing the information I cared about instead of trying to get at the resulting frame transform.

First, a little context.

I'm new to robotics and ROS2. I'm building a custom robot robot as my learning platform. The robot contains a RealSense T265 and T455, both of which are mounted on top of a pan and tilt system. Fixed to the robot base is a ydlidar g2 laser scanner.

When I posted this question, I was experiencing an issue in that rviz2 Camera output showed the laser scan representation following the rgb camera when the pan and tilt was adjusted because there was no transform being applied to the joints that held the frame attached to the RealSense cameras. I was thrown off because I noticed that the T265 tracking camera published orientation to /odom_frame, therefore I figured (incorrectly) that I needed to get the transform from there. This is how I got to posting this question in the first place which was intended as a simplified version of what I was trying to ultimately accomplish.

This is how I started down the path of getting the transform between two frames. My next issue was that I was using the tf2 tutorial as my example to grab the transform. This tutorial seems to be written for ROS1, therefore it doesn't work out of the box on ROS2. This confusion is what led to my original question.

It turns out that it is MUCH simpler to follow the ROS2 topic subscription tutorial and adapt it to subscribe to the /tf topic. There is no need to mess around with TransformListener or Buffer which didn't seem to work as expected anyway.

I then realized that the T265 is publishing an Odometry topic which is exactly what I needed to update the joint state of the pan and tilt. Therefore, the solution to my actual issue was to a) subscribe to the Odometry topic from the T265 and then b) publish to the /joint_states topic to update the orientation of the pan and tilt.

I'm embarrassed to admit I went about this all wrong. Instead I should have just subscribed to the topic publishing the information I cared about instead of trying to get at the resulting frame transform.

First, a little context.

I'm new to robotics and ROS2. I'm building a custom robot as my learning platform. The robot contains a RealSense T265 and T455, both of which are mounted on top of a pan and tilt system. Fixed to the robot base is a ydlidar g2 laser scanner.

When I posted this question, I was experiencing an issue in that rviz2 Camera output showed the laser scan representation following the rgb camera when the pan and tilt was adjusted because there was no transform being applied to the joints that held the frame attached to the RealSense cameras. I was thrown off because I noticed that the T265 tracking camera published orientation to /odom_frame, therefore I figured (incorrectly) that I needed to get the transform from there. This is how I got to posting this question in the first place which was intended as a simplified version of what I was trying to ultimately accomplish.

This is how I started down the path of getting the transform between two frames. My next issue was that I was using the tf2 tutorial as my example to grab the transform. This tutorial seems to be written for ROS1, therefore it doesn't work out of the box on ROS2. This confusion is what led to my original question.

It turns out that it is MUCH simpler to follow the ROS2 topic subscription tutorial and adapt it to subscribe to the /tf topic. There is no need to mess around with TransformListener or Buffer which didn't seem to work as expected anyway. While this solves my particular since I was seeking the transforms between movable joints, this doesn't actually solve the more general problem I originally posted because I don't think /tf shows transforms for fixed joints (something I didn't understand when I wrote the question).

I then realized that the T265 is publishing an Odometry topic which is exactly what I needed to update the joint state of the pan and tilt. Therefore, the solution to my actual issue was to a) subscribe to the Odometry topic from the T265 and then b) publish to the /joint_states topic to update the orientation of the pan and tilt.