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

Avner's profile - activity

2022-12-22 18:39:25 -0500 marked best answer [SOLVED] rviz not showing 16 bits-per-pixel, single channel depth images

Hi,

I am playing a bag of 16 bits-per-pixel depth and 8 bit rgb images. While playing the bag, I can extract both the rgb and the depth images into files (verifying that the data is ok) (I used the thread here to create and extract the depth images)

The way the depth image is stored in the bag is by using a python script that uses the PIL package to read a pgm image from file into a PIL object, serialize the object data into byte array (using io.BytesIO()), and save the byte array in PPM format.

In rviz I can view the rgb image, but I cannot view the depth image.

rviz issues an error message:

[ WARN] [1548110467.614542827]: OGRE EXCEPTION(2:InvalidParametersException): Stream size does not match calculated image size in Image::loadRawData at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreImage.cpp (line 283)
[ERROR] [1548110467.614620078]: Error loading image: OGRE EXCEPTION(2:InvalidParametersException): Stream size does not match calculated image size in Image::loadRawData at /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreImage.cpp (line 283)

The transport Hint in rviz is set to "raw" and I cannot change it.

Thanks,

Avner

2022-12-22 18:39:25 -0500 received badge  Self-Learner (source)
2021-05-14 12:04:00 -0500 received badge  Notable Question (source)
2021-05-14 12:04:00 -0500 received badge  Famous Question (source)
2021-05-02 14:04:10 -0500 marked best answer Running rtabmap on bag of rgb and depth images

Hi,

I want to run ros rtabmap on a bag of rgb and depth images, with the following topics:

rostopic  list
/camera/depth/camera_info
/camera/depth/image
/camera/rgb/camera_info
/camera/rgb/image_color

I am using the well known canned bag rgbd_dataset_freiburg1_xyz as a reference example. This bag has the following topics:

rosbag info /mnt/hdd3/avnerm/avner/slam/data/rgbd_dataset_freiburg1_xyz/rgbd_dataset_freiburg1_xyz.bag
...
topics:      /camera/depth/camera_info
             /camera/depth/image      
             /camera/rgb/camera_info  
             /camera/rgb/image_color  
             /cortex_marker_array     
             /imu                     
             /tf

In my bag I don't have /imu, /tf topics.

To get the program to flow, I added the following transforms. I added the transform with 0 values for x,y,z,rot,pitch,yaw (i.e. no effect), except for the yaw argument to align the orientation of 3d points with the image

<node pkg="tf" type="static_transform_publisher" name="openni_rgb_optical_frame_to_world" args="0 0 0 0.0 0 -$(arg pi) /openni_rgb_optical_frame /world 100" />
<node pkg="tf" type="static_transform_publisher" name="world_to_kinect" args="0.0 0.0 0.0 0.0 0.0 0.0 /world /kinect 100" />
<node pkg="tf" type="static_transform_publisher" name="world_to_map" args="0.0 0.0 0.0 0.0 0.0 0.0 /world /map 100" />

If I just play my bag, I can see in rviz the images (rgb, depth) and the 3d points (via /voxel_cloud), but in local frame coordinates. With these tf nodes the rtabmap runs, but the /rtabmap/mapData shows incorrect - the 3d points are just laid on top of each other without a proper 3d model.

I created a bag rgbd_dataset_freiburg1_xyz_no_tf.bag without the topics: /cortex_marker_array /imu /tf, (and replaced with static transforms)

With this setting, rtabmap creates the mapData incorrectly as well.

So it looks like the launch file that I am using from here requires the topics that were filtered above.

My questions:

  • Can rtabmap handle a bag with just rgb and depth images?
  • Is there an example canned bag that only uses rgb and depth images?

Thanks,

Avner

2021-02-08 11:44:58 -0500 received badge  Student (source)
2020-11-02 18:55:02 -0500 received badge  Famous Question (source)
2020-11-02 18:55:02 -0500 received badge  Popular Question (source)
2020-11-02 18:55:02 -0500 received badge  Notable Question (source)
2020-09-07 15:36:21 -0500 received badge  Famous Question (source)
2020-09-07 15:36:21 -0500 received badge  Notable Question (source)
2020-09-01 13:59:30 -0500 received badge  Famous Question (source)
2020-07-15 08:22:01 -0500 received badge  Notable Question (source)
2020-07-15 08:22:01 -0500 received badge  Famous Question (source)
2020-04-22 17:58:26 -0500 received badge  Famous Question (source)
2020-04-04 00:52:06 -0500 received badge  Famous Question (source)
2020-01-18 05:48:03 -0500 received badge  Famous Question (source)
2020-01-18 05:48:03 -0500 received badge  Notable Question (source)
2020-01-18 05:48:03 -0500 received badge  Popular Question (source)
2019-12-24 06:16:09 -0500 received badge  Popular Question (source)
2019-12-23 20:28:02 -0500 received badge  Rapid Responder (source)
2019-12-23 20:28:02 -0500 answered a question How to run a node on the command line instead of from a launch file

adding the parameter __ns:=rx150 solved the problem /home/avnerm/interbotix_ws/devel/lib/interbotix_moveit_interface/mo

2019-12-23 20:12:19 -0500 asked a question How to run a node on the command line instead of from a launch file

How to run a node on the command line instead of from a launch file Hi, I have a roslaunch scripts that launches severa

2019-09-10 07:13:48 -0500 received badge  Famous Question (source)
2019-08-19 01:01:19 -0500 received badge  Popular Question (source)
2019-08-16 17:18:40 -0500 edited answer [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

The reason for the failure was due to streaming the images in resolution of 384x240, but using a camera_info .yaml file

2019-08-16 17:18:01 -0500 edited question [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

RTABMAP does not generate accumulated 3d points in rgbd mode Hi, I am running RTABMAP against a stereo camera that prov

2019-08-16 17:17:48 -0500 marked best answer [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

Hi,

I am running RTABMAP against a stereo camera that provides left and right and depth images.

When I run RTABMAP in stereo_mode (based on left and right image pairs) RTABMAP is working OK (e.g. I can see the 3d point cloud being build in Rviz via the topic /rtabmap/mapData)

Now I want to test RTABMAP in rgbd mode (based on right and depth image pairs).

In this mode the rgbd_odometry runs OK, and produces odometry results (snippet1). I also echo the /rtabmap/odom topic and I can see published data.

But nothing is published for topic /rtabmap/mapData.

RTABMAP does publish data for topic /rtabmap/odom_local_map (see snippet2)

To debug the problem, I list odom_local_map in Rviz and set the field "Fixed Frame" to "odom", but nothing is displayed in the 3d pane.

How can I debug the problem, to see the accumulated 3d point cloud in Rviz?

Or, how can I debug the problem, to see intermediate results such as odom_local_map in Rviz?

Thanks,

Avner


EDIT:

The RTABMAP launch files are listed in snippet3, snippet4

The ros related processes are in snippet5


snippet1 - rgb_odometry runs ok

[ INFO] [1565916017.025276774, 1556057414.818000078]: Odom: quality=508, std dev=0.000465m|0.000032rad, update time=0.028195s
[ INFO] [1565916017.052003568, 1556057414.818000078]: Odom: quality=513, std dev=0.000365m|0.000032rad, update time=0.026503s
[ INFO] [1565916017.117518421, 1556057414.884999990]: Odom: quality=513, std dev=0.000324m|0.000032rad, update time=0.027049s...

snippet2 - I can echo topic from /rtabmap/odom_local_map

header: 
  seq: 6484
  stamp: 
    secs: 1556058813
    nsecs: 713999987
  frame_id: "odom"
height: 1
width: 550
fields: 
  - 
    name: "x"
    offset: 0
    datatype: 7
    count: 1
  - 
    name: "y"
    offset: 4
    datatype: 7
    count: 1
  - 
    name: "z"
    offset: 8
    datatype: 7
    count: 1
  - 
    name: "rgb"
    offset: 16
    datatype: 7
    count: 1
is_bigendian: False
point_step: 32
row_step: 17600
data: [55, 45, 144, 194, 0, 0, 0, 0, 14, 209, 130 ...

snapshot3 - RTABMAP launch file

<?xml version="1.0"?>
<launch>
    <!-- Choose visualization -->
    <arg name="rviz"       default="true" />
    <arg name="rtabmapviz" default="false" />

    <arg name="rate"       default="30" />

    <arg name="rviz_cfg"                default="/home/catkin_ws/src/slam_rtabmap/launch/slam.rtabmap.live2.rviz" />

    <param name="/use_sim_time" value="true"/>

    <arg name="pi/2" value="1.5707963267948966" />
    <include file="/home/catkin_ws/src/slam_rtabmap/launch/live1_tf.launch"></include>

    <include file="/home/catkin_ws/src/slam_rtabmap/launch/rtabmap.base.launch">
        <arg name="rtabmap_args" value="--delete_db_on_start" />
        <arg name="stereo"           value="false" />
        <arg name="subscribe_rgbd"           value="true" />

        <arg name="queue_size"           value="10" />
        <arg name="rgbd_sync"               default="true"/>
        <arg name="approx_rgbd_sync"        default="false"/>
        <!-- <arg name="frame_id"                default="censys_stern"/> -->

        <arg name="rviz"             value="$(arg rviz)" />
        <arg name="rtabmapviz"       value="$(arg rtabmapviz)" />
        <arg name="rviz_cfg"       value="$(arg rviz_cfg)" />
        <arg name="rgb_topic"               value="/rectified_right" />
        <arg name="depth_topic"             value="/3d_z_coords" />
        <arg name="camera_info_topic"       value="/right/camera_info" />
    </include>
</launch>

snippet4 - RTABMAP base launch file

<launch>
  <!-- Convenience launch file to launch ...
(more)
2019-08-16 17:17:39 -0500 received badge  Rapid Responder (source)
2019-08-16 17:17:39 -0500 answered a question [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

The reason for the failure was due to streaming the images in resolution of 384x240, but using a camera_info .yaml file

2019-08-16 12:14:07 -0500 commented question [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

@PapaG I posted the launch files, and the running processes I don't know what you mean by "everything". Some things are

2019-08-16 12:13:41 -0500 commented question [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

@PapaG I posted the launch files, and the running processes I don't know what you mean by "everything". Some things are

2019-08-16 12:12:08 -0500 edited question [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

RTABMAP does not generate accumulated 3d points in rgbd mode Hi, I am running RTABMAP against a stereo camera that prov

2019-08-16 11:55:13 -0500 edited question [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

RTABMAP does not generate accumulated 3d points in rgbd mode Hi, I am running RTABMAP against a stereo camera that prov

2019-08-16 11:47:58 -0500 commented question [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

This is a followup. In #q330832, I had problems with the rgb_odometry that RTABMAP uses, which I was able to solve. Here

2019-08-16 11:44:37 -0500 marked best answer [SOVED] RTABMAP fails to run in rgbd mode

Hi,

I am running RTABMAP against a stereo camera that provides left and right and depth images.

When I run RTABMAP in stereo_mode (based on left and right image pairs) RTABMAP is working OK. (e.g. I can see the 3d point cloud being accumulated in Rviz)

Next, I want to test RTABMAP in rgbd mode (based on right and depth image pairs).

In this mode I'm getting error messages from RTABMAP (snippet1) I echo the /rtabmap/odom topic and indeed nothing is advertised.

To debug the problem, I kill the rgbd_odometry process that is triggered from the launch file, and run the same command from the command line. This time rgbd_odometry runs OK, and I can echo the topic (snippet3)

Why rgbd_odometry doesn't publish anything when it runs from the launch file, but publishes data when it runs separately?

The launch files that are related to RTABMAP is in snippet4

Thanks,

Avner


snippet1 - getting error messages from RTABMAP

[ WARN] [1565907237.759114913, 1556048635.546000004]: /rtabmap/rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=10).
/rtabmap/rtabmap subscribed to (approx sync):
   /rtabmap/odom,
   /rtabmap/rgbd_image_relay,
   /rtabmap/odom_info

snippet2 - run rgb_odometry directly from the command line

ps aux | grep odometry
avnerm   22133  6.1  2.1 1805516 172020 ?      Ssl  15:22   0:00 /opt/ros/melodic/lib/rtabmap_ros/rgbd_odometry --delete_db_on_start rgb/image:=/rm_mapping_node/cameras/stern/rectified_right depth/image:=/rm_mapping_node/cameras/stern/3d_z_coords rgb/camera_info:=/rm_mapping_node/cameras/stern/right/camera_info rgbd_image:=rgbd_image_relay odom:=odom __name:=rgbd_odometry __log:=/home/avnerm/.ros/log/8d688094-bfa4-11e9-975a-74d02b912ce1/rtabmap-rgbd_odometry-5.log

snippet3 - echo the topic /odom

rostopic echo /odom
...
---
header: 
  seq: 8
  stamp: 
    secs: 1556049330
    nsecs:  88000059
  frame_id: "odom"
child_frame_id: "base_link"
pose: 
  pose: 
    position: 
      x: -1.05032432079
      y: -1.40366268158
      z: -0.831952929497
    orientation: 
      x: -0.00683327377029
      y: 0.00692438043004
      z: -0.00286356138948
      w: 0.999948578349
  covariance: [660.712180279541, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 660.712180279541, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 660.712180279541, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00214658203125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00214658203125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00214658203125]
twist: 
  twist: 
    linear: 
      x: 0.823218107224
      y: -0.786256253719
      z: 0.694412589073
    angular: 
      x: -0.00885304901749
      y: -0.0140505637974
      z: -0.00202373345383
  covariance: [330.3560901397705, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 330.3560901397705, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 330.3560901397705, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001073291015625, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ...
(more)
2019-08-16 11:44:30 -0500 answered a question [SOVED] RTABMAP fails to run in rgbd mode

I was able to solve the problem. The environment setting is such that: the 3 topics: /3d_z_coords, /rectified_right,

2019-08-16 11:44:30 -0500 received badge  Rapid Responder (source)
2019-08-16 11:44:19 -0500 edited question [SOVED] RTABMAP fails to run in rgbd mode

[SOVED] RTABMAP fails to run in rgbd mode Hi, I am running RTABMAP against a stereo camera that provides left and right

2019-08-16 11:43:43 -0500 edited question [SOVED] RTABMAP fails to run in rgbd mode

RTABMAP fails to run in rgbd mode Hi, I am running RTABMAP against a stereo camera that provides left and right and dep

2019-08-15 20:18:36 -0500 received badge  Famous Question (source)
2019-08-15 20:18:34 -0500 received badge  Famous Question (source)
2019-08-15 20:18:24 -0500 received badge  Famous Question (source)
2019-08-15 20:18:21 -0500 received badge  Famous Question (source)
2019-08-15 20:18:21 -0500 received badge  Notable Question (source)
2019-08-15 20:18:20 -0500 received badge  Notable Question (source)
2019-08-15 20:11:07 -0500 asked a question [SOLVED] RTABMAP does not generate accumulated 3d points in rgbd mode

RTABMAP does not generate accumulated 3d points in rgbd mode Hi, I am running RTABMAP against a stereo camera that prov

2019-08-15 18:31:34 -0500 edited question [SOVED] RTABMAP fails to run in rgbd mode

RTABMAP fails to run in rgbd mode Hi, I am running RTABMAP against a stereo camera that provides left and right and dep