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

Turtlebot3 simulation with D435 #2109

Closed
ChenJiajun0011 opened this issue Oct 10, 2021 · 7 comments
Closed

Turtlebot3 simulation with D435 #2109

ChenJiajun0011 opened this issue Oct 10, 2021 · 7 comments
Labels

Comments

@ChenJiajun0011
Copy link

Hi, everyone. This is my first issue in github:P. I am quite a freshman in ROS. I am now combining the turtlebot3 pi with D435 in the simulation environment(Gazebo). I spent days trying to figure out how to change the publishing topics from D435. Actually, I am running the demo from this link: https://github.com/takanotume24/turtlebot3_simulations
How could I get other topics for example like "aligned_depth_to_color". Because I want to find a detected object in this aligned depth to color frame and output the depth of its center. I hope I have explained my question well. Thanks for helping!

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 10, 2021

Hi @ChenJiajun0011 There is an interesting looking RealSense Gazebo plugin for D435 and D435i in the link below that combines the RealSense ROS wrapper and a Gazebo plugin in a single package to enable use with both real and simulated cameras.

https://github.com/rickstaa/realsense-ros-gazebo

The incorporation of the RealSense ROS wrapper may suggest that the align_depth command which provides aligned depth topics may be accessible in a Gazebo simulation. I have not used this plugin, so cannot confirm in advance whether it supports alignment in Gazebo simulation.

The author of this Gazebo project provides a link to a YouTube explanation video in #1453 (comment)


An alternative approach in #714 (comment) by a user of a RealSense Gazebo plugin that did not support align_depth was to set the horizntal field of view (FOV) of the depth and RGB cameras to the same value (probably doing this in their simulation).

@ChenJiajun0011
Copy link
Author

@MartyG-RealSense Thanks for your sources! when I use an actual camera, I can use the command aligned_color_frame = aligned_frames.get_color_frame() aligned_depth_frame = aligned_frames.get_depth_frame() to finish object detection in the aligned color frame and find out the object center distance in the aligned depth frame.
When it comes to the simulation environment, it seems that we could use the command "roslaunch realsense2_camera rs_camera.launch align_depth:=true" to turn on the aligned_depth_to_color topics when we only launch a single D435 model, but there is no way to set this align_depth topics to be true when we combine the D435 model together with a robot in the Gazebo. Right?

@MartyG-RealSense
Copy link
Collaborator

My knowledge of Gazebo is admittedly limited. If your problem is getting the simulated D435 camera to move with the simulated robot, I wonder whether you could attach the two models together in the Gazebo simulation using the instructions in the link below.

http://gazebosim.org/tutorials/?tut=add_laser

@ChenJiajun0011
Copy link
Author

My knowledge of Gazebo is admittedly limited. If your problem is getting the simulated D435 camera to move with the simulated robot, I wonder whether you could attach the two models together in the Gazebo simulation using the instructions in the link below.

http://gazebosim.org/tutorials/?tut=add_laser

Hi @MartyG-RealSense really appreciate your help. I think I may try to set the FOV of the RGB and Depth cameras to the same value. Since I can use the align_depth in a real camera, it would not be a big problem to make this compromise in the simulation environment.

@MartyG-RealSense
Copy link
Collaborator

Hi @ChenJiajun0011 Do you have an update about this case that you can provide, please? Thanks!

@ChenJiajun0011
Copy link
Author

Hi @MartyG-RealSense Nothing else, thanks a lot.

@MartyG-RealSense
Copy link
Collaborator

You are very welcome, @ChenJiajun0011 - thanks very much for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants