-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
publish tfs and set matching frame names (#135)
This PR ports the TFs from original [`kinect_frames.launch`](https://github.com/ros-drivers/rgbd_launch/blob/noetic-devel/launch/kinect_frames.launch) to the ROS 2 launch files and sets the image frame names appropriately.
- Loading branch information
1 parent
e07df4e
commit 512d8cd
Showing
4 changed files
with
109 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import launch | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.substitutions import LaunchConfiguration | ||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description(): | ||
|
||
namespace_param_name = "namespace" | ||
namespace = LaunchConfiguration(namespace_param_name) | ||
namespace_launch_arg = DeclareLaunchArgument(namespace_param_name) | ||
|
||
tf_prefix_param_name = "tf_prefix" | ||
tf_prefix = LaunchConfiguration(tf_prefix_param_name) | ||
tf_prefix_launch_arg = DeclareLaunchArgument(tf_prefix_param_name) | ||
|
||
tf_args = [ | ||
["--frame-id", [tf_prefix,"/",namespace,"_link"], | ||
"--child-frame-id", [tf_prefix,"/",namespace,"_depth_frame"], | ||
"--y", "-0.02"], | ||
["--frame-id", [tf_prefix,"/",namespace,"_link"], | ||
"--child-frame-id", [tf_prefix,"/",namespace,"_rgb_frame"], | ||
"--y", "-0.045"], | ||
["--frame-id", [tf_prefix,"/",namespace,"_depth_frame"], | ||
"--child-frame-id", [tf_prefix,"/",namespace,"_depth_optical_frame"], | ||
"--roll", "-1.5707963267948966", "--yaw", "-1.5707963267948966"], | ||
["--frame-id", [tf_prefix,"/",namespace,"_rgb_frame"], | ||
"--child-frame-id", [tf_prefix,"/",namespace,"_rgb_optical_frame"], | ||
"--roll", "-1.5707963267948966", "--yaw", "-1.5707963267948966"], | ||
] | ||
|
||
tf_nodes = [Node(package='tf2_ros', executable='static_transform_publisher', output='screen', arguments=args) for args in tf_args] | ||
|
||
return launch.LaunchDescription([namespace_launch_arg, tf_prefix_launch_arg] + tf_nodes) |