ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

using pointcloud_to_laserscan package with turtlebot and d435 camera

asked 2022-10-20 03:00:26 -0500

distro gravatar image

updated 2022-10-24 19:40:48 -0500

I am having problems using the pointcloud_to_laserscan 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 ... (more)

edit retag flag offensive close merge delete

Comments

Hi, are you sure the TFs are connected correctly? If your frame ids are not correct it will not work.

goktuggurler gravatar image goktuggurler  ( 2022-10-21 00:39:32 -0500 )edit

@goktuggurler How would I make sure the TFs are connected correctly in this case?

distro gravatar image distro  ( 2022-10-21 00:54:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-10-21 01:35:29 -0500

ravijoshi gravatar image

updated 2022-10-21 22:51:46 -0500

  1. First, you need to install the pointcloud_to_laserscan package. I recommend installing pre-built binaries using apt as shown below:

    sudo apt install ros-kinetic-pointcloud-to-laserscan
    
  2. I have a feeling that your nodelet_manager is not up thus it is not generating any scan 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.

edit flag offensive delete link more

Comments

@ravijoshi what is my_nodelet_manager related to? where does that come from?

distro gravatar image distro  ( 2022-10-21 02:01:53 -0500 )edit

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!

ravijoshi gravatar image ravijoshi  ( 2022-10-21 02:17:46 -0500 )edit

@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.

distro gravatar image distro  ( 2022-10-21 14:46:09 -0500 )edit

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

ravijoshi gravatar image ravijoshi  ( 2022-10-21 22:48:14 -0500 )edit

@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.

distro gravatar image distro  ( 2022-10-21 23:34:21 -0500 )edit

@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.

distro gravatar image distro  ( 2022-10-24 18:52:35 -0500 )edit

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:

  1. Start the RealSense D435 camera with the point cloud filter as shown below:

    roslaunch realsense2_camera rs_camera.launch filters:=pointcloud
    
  2. 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.

  3. Run the above launch file, and you should be able to receive the data on /scan topic. You may use RViz to visualize it.
ravijoshi gravatar image ravijoshi  ( 2022-10-25 00:46:45 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-10-20 03:00:26 -0500

Seen: 225 times

Last updated: Oct 24 '22