Connecting tf tree and odom with Realsense t265

asked 2019-07-05 03:07:10 -0500

shaimay gravatar image

Hello! I've asked this question here as well.

Just to preface this: I’m a complete beginner with both, ROS and the Realsense cameras. Currently using: Ubuntu 16.04 with ROS Kinetic.

I have a mobile robot that I hope to use the t265 with. Essentially I want to add 4 other links to the tf tree: base_link, the two wheels and a laser sensor. Currently, I have a tf broadcaster node that publishes static tf transformations between these 4 links. The tf tree of which looks like this:

image description

The code is very simple (I got it from the navigation robot setup ROS tutorial).

broadcaster.sendTransform( tf::StampedTransform( tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0, 0, 0)), ros::Time::now(),"base_link", "base_laser")); broadcaster.sendTransform( tf::StampedTransform( tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0, 0, 0)), ros::Time::now(),"base_link", "base_rwheel")); broadcaster.sendTransform( tf::StampedTransform( tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0, 0, 0)), ros::Time::now(),"base_link", "base_lwheel")); (Removed the exact transformations)

However, now I need to connect these static transformations that I have to the dynamic (is that what they’re called?) transformations provided by the t265. In other words, when the camera pose frame of the t265 changes its position, I want that reflected in the position of the base_link (and subsequently the three other links) using the static transformations that I've defined in the file above. So in order to do that, I followed the advice over here and edited the rs_t265.launch file and added the following line: <node pkg="tf" type="static_transform_publisher" name="t265_connector" args="0 0 0 0 0 0 0 camera_pose_frame base_link 10000"/>

This changes my tf tree to the following (when the tf broadcaster node and this launch file are launched together).

image description

As you can see, they're not connected with one another. However, in some instances, I do manage to get a tree that is fully connected in a way that I want. But even in those instances, it's only the static transformations for base_link and the other base_* that are being broadcasted. Is there something I can do to change that?

Furthermore, the Realsense cameras also publish velocities and odometry information to camera/odom/samples. How do I transform this odom information to base_link and the other links? Extremely sorry for this drawn out question but I've been trying for a while and have not been able to find a solution.

Thank you very much!

edit retag flag offensive close merge delete