ros1: Migrating tf to tf2 (#1425)

* Migrating tf to tf2

* Added ci action to test PR on ros1

* updated dev container with nvidia working

* backward compatibility with topics having frame_id with leading slash not allowed with tf2

* backward compatibility of leading slash for other tf2 buffers

* updated comment
This commit is contained in:
matlabbe
2026-05-23 15:08:21 -07:00
committed by GitHub
parent f81536f508
commit a6921845b6
30 changed files with 311 additions and 247 deletions
+4 -1
View File
@@ -406,7 +406,10 @@ void VoxelLayer::updateOrigin(double new_origin_x, double new_origin_y)
{
geometry_msgs::TransformStamped transformStamped;
#ifdef COSTMAP_2D_POINTCLOUD2
transformStamped = tf_->lookupTransform(global_frame_, robot_base_frame_, ros::Time(0));
transformStamped = tf_->lookupTransform(
!global_frame_.empty()&&global_frame_.at(0)=='/'?global_frame_.substr(1):global_frame_,
!robot_base_frame_.empty()&&robot_base_frame_.at(0)=='/'?robot_base_frame_.substr(1):robot_base_frame_,
ros::Time(0));
#else
tf::StampedTransform stampedTransform;
tf_->lookupTransform(global_frame_, robot_base_frame_, ros::Time(0), stampedTransform);