Skip to content

Commit 5595c6e

Browse files
committed
use base_link instead of body for tf
1 parent 0d51055 commit 5595c6e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/transform_nodelet_ros2.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void OvtransformNodeletClass::odomCallback(const nav_msgs::msg::Odometry::Shared
249249
odomBinW->pose.pose.position.z = position_BinW(2);
250250

251251
// The TWIST component (angular and linear velocities)
252-
odomBinW->child_frame_id = mav_name + "/body";
252+
odomBinW->child_frame_id = mav_name + "/base_link";
253253
odomBinW->twist.twist.linear.x = v_BinW(0); // vel in world frame
254254
odomBinW->twist.twist.linear.y = v_BinW(1); // vel in world frame
255255
odomBinW->twist.twist.linear.z = v_BinW(2); // vel in world frame
@@ -263,7 +263,7 @@ void OvtransformNodeletClass::odomCallback(const nav_msgs::msg::Odometry::Shared
263263
geometry_msgs::msg::TransformStamped trans_w = get_stamped_transform_from_odom(
264264
*odomBinW); // Get the transform stamped message from the function.
265265
trans_w.header.frame_id = "world";
266-
trans_w.child_frame_id = mav_name + "/body";
266+
trans_w.child_frame_id = mav_name + "/base_link";
267267
mTfBr.sendTransform(trans_w); // Publish the tranform odom w.r.t world frame
268268
}
269269
pub_odomworld->publish(std::move(odomBinW));
@@ -278,7 +278,7 @@ void OvtransformNodeletClass::odomCallback(const nav_msgs::msg::Odometry::Shared
278278
odomBinB0->pose.pose.position.y = position_BinB0(1);
279279
odomBinB0->pose.pose.position.z = position_BinB0(2);
280280

281-
odomBinB0->child_frame_id = mav_name + "/body";
281+
odomBinB0->child_frame_id = mav_name + "/base_link";
282282
odomBinB0->twist.twist.linear.x = v_BinB0(0); // vel in world frame
283283
odomBinB0->twist.twist.linear.y = v_BinB0(1); // vel in world frame
284284
odomBinB0->twist.twist.linear.z = v_BinB0(2); // vel in world frame
@@ -291,7 +291,7 @@ void OvtransformNodeletClass::odomCallback(const nav_msgs::msg::Odometry::Shared
291291
geometry_msgs::msg::TransformStamped trans_B0 = get_stamped_transform_from_odom(
292292
*odomBinB0); // Get the transform stamped message from the function.
293293
trans_B0.header.frame_id = mav_name + "/odom";
294-
trans_B0.child_frame_id = mav_name + "/body";
294+
trans_B0.child_frame_id = mav_name + "/base_link";
295295
mTfBr.sendTransform(trans_B0); // Publish the transform of odom w.r.t initial odom value.
296296
}
297297
pub_odomworldB0->publish(std::move(odomBinB0));

0 commit comments

Comments
 (0)