using pointcloud_to_laserscan package with turtlebot and d435 camera
I am having problems using the pointcloudtolaserscan package with turtlebot and d435 camera. I want to start the pointcloud_to_laserscan
node through the turtlebot 3dsensor.launch
file. when I look at the rqt_graph
I see the node is started but unable to receive pointcoud data. I have made sure to remap to what I think is the accurate topic for pointcloud for d435 camera(camera/depth/points
, I also tried camera/depth_registered/points
). Maybe it's another problem but I don't know. This is my 3sdsensor.launch
file(The package in question, I add last):
<!--
Turtlebot is a bit low on horsepower...
We use openni_camera here, turn everything on by default
(allows the user to conveniently see everything when
launching this on its own - use with
turtebot_rviz_launchers/view_robot.launch to visualise)
and provide args to disable them so you can optimise the
horsepower for your application.
For an example of disabling processing modules, check
any of the turtlebot_rapps (e.g. android_make_a_map.launch
only enables scan_processing for depthimage_to_laserscan and
rgb_processing for the android tele-view).
-->
<launch>
<!-- "camera" should uniquely identify the device. All topics are pushed down
into the "camera" namespace, and it is prepended to tf frame ids. -->
<arg name="camera" default="camera"/>
<arg name="publish_tf" default="false"/>
<arg name="3d_sensor" default="$(env TURTLEBOT_3D_SENSOR)"/> <!-- kinect, asus_xtion_pro -->
<!-- Factory-calibrated depth registration -->
<arg name="depth_registration" default="true"/>
<arg if="$(arg depth_registration)" name="depth" value="depth_registered" />
<arg unless="$(arg depth_registration)" name="depth" value="depth" />
<!-- Processing Modules -->
<arg name="rgb_processing" default="true"/>
<arg name="ir_processing" default="true"/>
<arg name="depth_processing" default="true"/>
<arg name="depth_registered_processing" default="true"/>
<arg name="disparity_processing" default="true"/>
<arg name="disparity_registered_processing" default="true"/>
<arg name="scan_processing" default="true"/>
<!-- Worker threads for the nodelet manager -->
<arg name="num_worker_threads" default="4" />
<!-- Laserscan topic -->
<arg name="scan_topic" default="scan"/>
<include file="$(find turtlebot_bringup)/launch/includes/3dsensor/$(arg 3d_sensor).launch.xml">
<arg name="camera" value="$(arg camera)"/>
<arg name="publish_tf" value="$(arg publish_tf)"/>
<arg name="depth_registration" value="$(arg depth_registration)"/>
<arg name="num_worker_threads" value="$(arg num_worker_threads)" />
<!-- Processing Modules -->
<arg name="rgb_processing" value="$(arg rgb_processing)"/>
<arg name="ir_processing" value="$(arg ir_processing)"/>
<arg name="depth_processing" value="$(arg depth_processing)"/>
<arg name="depth_registered_processing" value="$(arg depth_registered_processing)"/>
<arg name="disparity_processing" value="$(arg disparity_processing)"/>
<arg name="disparity_registered_processing" value="$(arg disparity_registered_processing)"/>
</include>
<!-- Laserscan
This uses lazy subscribing, so will not activate until scan is requested.
-->
<!--remap from="$(arg camera)/image" to="$(arg camera)/$(arg depth)/image_raw"/-->
<!--group if="$(arg scan_processing)"-->
<node pkg="nodelet" type="nodelet" name="pointcloud_to_laserscan" args="load pointcloud_to_laserscan/pointcloud_to_laserscan_nodelet $(arg camera)_nodelet_manager">
<remap from="cloud_in" to="$(arg camera)/depth/points" />
<remap from="$(arg camera)/scan" to="$(arg scan_topic)"/>
</node>
<!--/group -->
</launch>
Edit: I get this in terminal @ravijoshi(I only show the parts I think are important):
[ INFO] [1666656628.432166475]: Setting Dynamic reconfig parameters.
[ WARN] [1666656628.871970512]: Param '/camera/stereo_module/auto_exposure_limit' has value 0 that is not in range [1, 200000]. Removing this parameter from dynamic reconfigure options.
[ WARN] [1666656628.885854494]: Param '/camera/stereo_module/auto_gain_limit' has value 0 that is not in range [16, 248]. Removing this parameter from dynamic reconfigure options.
[ INFO] [1666656629.036304807]: Done Setting Dynamic reconfig parameters.
[ INFO] [1666656629.041108664]: depth stream is enabled - width: 1280, height: 720, fps: 30, Format: Z16
[ INFO] [1666656629.045516464]: color stream is enabled - width: 1280, height: 720, fps: 30, Format: RGB8
[ INFO] [1666656629.045635122]: setupPublishers...
[ INFO] [1666656629.057205228]: Expected frequency for depth = 30.00000
[ INFO] [1666656629.138398122]: Expected frequency for color = 30.00000
[ INFO] [1666656629.175136858]: setupStreams...
[ INFO] [1666656629.185840177]: insert Depth to Stereo Module
[ INFO] [1666656629.185908474]: insert Color to RGB Camera
24/10 17:10:29,244 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
[ INFO] [1666656629.295692306]: SELECTED BASE:Depth, 0
[ INFO] [1666656629.342104048]: RealSense Node Is Up!
[ WARN] [1666656629.375912624]:
24/10 17:10:29,377 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:29,427 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:29,478 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:29,630 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:29,681 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:29,732 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:29,884 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:30,036 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:30,187 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:30,238 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:30,390 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:30,440 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
24/10 17:10:30,593 WARNING [140416145934080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
[ INFO] [1666656679.530602965]: Got a subscriber to scan, starting subscriber to pointcloud
[ INFO] [1666656873.854997326]: Got a subscriber to scan, starting subscriber to pointcloud
This is the rqt_graph: file:///home/turtlebot/Desktop/pointcloud435.png
No data is being sent to the /scan
topic. Nothing happens.
I tried to dispaly the rqt_graph. I hope it shows up.
Asked by distro on 2022-10-20 03:00:26 UTC
Answers
First, you need to install the
pointcloud_to_laserscan
package. I recommend installing pre-built binaries usingapt
as shown below:sudo apt install ros-kinetic-pointcloud-to-laserscan
I have a feeling that your
nodelet_manager
is not up thus it is not generating anyscan
data. Therefore, I used following simple launch file with the RealSense D435 camera, and found it working:<launch> <node pkg="nodelet" type="nodelet" name="my_nodelet_manager" args="manager" output="screen" /> <node pkg="nodelet" type="nodelet" name="pointcloud_to_laserscan" args="load pointcloud_to_laserscan/pointcloud_to_laserscan_nodelet my_nodelet_manager"> <remap from="cloud_in" to="/camera/depth/color/points" /> </node> </launch>
Pay attention to the
<node pkg="nodelet" type="nodelet" name="my_nodelet_manager" args="manager" output="screen" />
line.
Asked by ravijoshi on 2022-10-21 01:35:29 UTC
Comments
@ravijoshi what is my_nodelet_manager
related to? where does that come from?
Asked by distro on 2022-10-21 02:01:53 UTC
It is a name of nodelet manager. I suggest you to make a new launch file, say "my_test_file.launch" with the above content and replace the /camera/depth/color/points
with your topic. Let me know, if you see scan topic. It is working here!
Asked by ravijoshi on 2022-10-21 02:17:46 UTC
@ravijoshi it doesnt work woth kinect camera. I copied your launch file and used it to replace what I had in my 3dsensor.launch
file(The all the stuff under "Laserscan"). I'll show the error below. I had to make an answer to my own question in repsonse to you.
Asked by distro on 2022-10-21 14:46:09 UTC
I copied your launch file and used it to replace what I had in my 3dsensor.launch file(The all the stuff under "Laserscan").
First, we should make sure that we have scan data. Therefore, you should not add other parameters to your launch. More specifically, I suggested creating a new launch file and copying the XML provided in the answer. Next, you must change /camera/depth/color/points
based on your Kinect camera. Keep things simple during the debugging phase, please.
I'll show the error below.
Thank you very much for posting the error message. I understand it. I have updated my answer. On the other hand, may I ask you to please move your post below this message? Right now, you have posted it as an answer, which could be misleading for future readers. Thanks for your kind cooperation
Asked by ravijoshi on 2022-10-21 22:48:14 UTC
@ravijoshi I cant' move the message unfortunately, there is a maximum word count comments such as these have which my last message surpasses by a long way, so I had to make it an answer instead.
Asked by distro on 2022-10-21 23:34:21 UTC
@ravijoshi even after installing the pre-built binaries I still have the same issues. Nothing changed. I re-editted my question again to show you how I implemented it. I'm using d435 camera now.
Asked by distro on 2022-10-24 18:52:35 UTC
It should not take this much time. Clearly, you are not putting in enough effort. For example, it seems that your launch file contains incorrect topic name, i.e., $(arg camera)/depth/points
. Nevertheless, I am repeating the steps mentioned above. Please read below:
Start the RealSense D435 camera with the point cloud filter as shown below:
roslaunch realsense2_camera rs_camera.launch filters:=pointcloud
Create a brand new launch file. Your existing launch file is making simple things complicated. Therefore, I repeat, create a new launch file with the content given in the answer above. Please do not add anything else to the file.
Run the above launch file, and you should be able to receive the data on
/scan
topic. You may use RViz to visualize it.
Asked by ravijoshi on 2022-10-25 00:46:45 UTC
Comments
Hi, are you sure the TFs are connected correctly? If your frame ids are not correct it will not work.
Asked by goktuggurler on 2022-10-21 00:39:32 UTC
@goktuggurler How would I make sure the TFs are connected correctly in this case?
Asked by distro on 2022-10-21 00:54:48 UTC