Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted all camera frame frame and added xacro #4

Open
wants to merge 4 commits into
base: galactic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ install(TARGETS
DESTINATION lib/${PROJECT_NAME})

install(
DIRECTORY cfg launch rviz
DIRECTORY cfg launch rviz description
DESTINATION share/${PROJECT_NAME}
)

Expand Down
19 changes: 19 additions & 0 deletions description/urdf/kinect.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<robot name="kinect">
<link name="kinect_base"/>

<link name="kinect_camera"/>

<joint name="base_link_to_kinect" type="fixed">
<parent link="kinect_base"/>
<child link="kinect_camera"/>
<origin xyz="-0.0065 0 0.139" rpy="0 0 0"/>
</joint>

<link name="kinect_camera_optical"/>

<joint name="kinect_camera_to_optical" type="fixed">
<parent link="kinect_camera"/>
<child link="kinect_camera_optical"/>
<origin xyz="0 0 0" rpy="${-pi/2} 0 ${-pi/2}"/>
</joint>
</robot>
2 changes: 1 addition & 1 deletion rviz/pointcloud.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Visualization Manager:
Enabled: true
Global Options:
Background Color: 48; 48; 48
Fixed Frame: kinect_depth
Fixed Frame: kinect_camera_optical
Frame Rate: 30
Name: root
Tools:
Expand Down
6 changes: 3 additions & 3 deletions src/kinect_ros2_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ KinectRosComponent::KinectRosComponent(const rclcpp::NodeOptions & options)
"file://" + pkg_share + "/cfg/calibration_rgb.yaml");

rgb_info_ = rgb_info_manager_->getCameraInfo();
rgb_info_.header.frame_id = "kinect_rgb";
rgb_info_.header.frame_id = "kinect_camera_optical";
depth_info_ = depth_info_manager_->getCameraInfo();
depth_info_.header.frame_id = "kinect_depth";
depth_info_.header.frame_id = "kinect_camera_optical";

depth_pub_ = image_transport::create_camera_publisher(this, "depth/image_raw");
rgb_pub_ = image_transport::create_camera_publisher(this, "image_raw");
Expand Down Expand Up @@ -138,7 +138,7 @@ void KinectRosComponent::timer_callback()
{
freenect_process_events(fn_ctx_);
auto header = std_msgs::msg::Header();
header.frame_id = "kinect_depth";
header.frame_id = "kinect_camera_optical";

auto stamp = now();
header.stamp = stamp;
Expand Down