rtabmap stops recording images after 7-10 seconds
I am having on ROS Kinetic on Ubuntu 16.04. I am trying to run Kinect 360 on ROS to get regular as well as depth images. I have installed freenect and rtabmap using following commands.
sudo apt-get install -y ros-kinetic-freenect-camera ros-kinetic-freenect-launch
sudo apt-get install -y ros-kinetic-freenect-stack ros-kinetic-libfreenect
sudo apt-get install ros-kinetic-rtabmap-ros
Now, in CASE 1. running roscore in 1st terminal then launching freenect in 2nd terminal.
roscore
roslaunch freenect_launch freenect.launch depth_registration:=true
In 3rd terminal launching rtabmap.
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start"enter code here
the rtabmap window opens but it doesn't record any images and in the freenect terminal window the following oputput repeats.
[ INFO] [1556638758.135309207]: Stopping device RGB and Depth stream flush.
[ INFO] [1556638780.594793009]: Device timed out. Flushing device.
[ INFO] [1556638780.595096944]: Starting a 3s RGB and Depth stream flush.
and in rtabmap terminal the following warnings repeat.
[WARN] [1556639251.666465373]: /rtabmap/rgbd_odometry: 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.
/rtabmap/rgbd_odometry subscribed to (approx sync):
/camera/rgb/image_rect_color,
/camera/depth_registered/image_raw,
/camera/rgb/camera_info
[ WARN] [1556639252.656543038]: /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,
/camera/rgb/image_rect_color,
/camera/depth_registered/image_raw,
/camera/rgb/camera_info,
/rtabmap/odom_info
Now in CASE2
running roscore in 1st terminal
roscore
and launching rtabmap 2nd.
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start"
and then in 3rd terminal launching freenect
roslaunch freenect_launch freenect.launch depth_registration:=true
rtabmap window opens up and starts recording images for approximately 7-10 seconds and then stops reconding new images. Now in freenect terminal the following error occurs
[INFO] [1556639771.038578426]: Stopping device RGB and Depth stream flush.
terminate called after throwing an instance of 'std::runtime_error'
what(): freenect_process_events error
[camera/camera_nodelet_manager-1] process has died [pid 7765, exit code -6, cmd /opt/ros/kinetic/lib/nodelet/nodelet manager __name:=camera_nodelet_manager __log:=/home/pratik/.ros/log/68acbe86-6b59-11e9-a105-70778130b1b9/camera-camera_nodelet_manager-1.log].
log file: /home/pratik/.ros/log/68acbe86-6b59-11e9-a105-70778130b1b9/camera-camera_nodelet_manager-1*.log
and the output of rtabmap terminal
[ INFO] [1556639780.054831440]: rtabmap (8): Rate=1.00s, Limit=0.000s, RTAB-Map=0.0499s, Maps update=0.0008s pub=0.0004s (local map=1, WM=1)
[ INFO] [1556639780.158713000]: Odom: quality=83, std dev=0.006837m|0.057880rad, update time=0.127539s
[ INFO] [1556639780.256065956]: Odom: quality=77, std dev=0.008145m|0.062481rad, update time=0.094164s
[ INFO] [1556639780.362580483]: Odom: quality=90, std dev=0.004738m|0.057249rad, update time=0.100875s
[ INFO] [1556639780.462297168]: Odom: quality=75, std dev=0.005483m|0.050833rad, update time=0.096905s
[ INFO] [1556639780.565689327]: Odom: quality=74, std dev=0.007174m|0.072406rad, update time=0.095736s
Please let me know what can be the problem. It is getting harder to anticipate what could be the solution. Please let me know if I need to check anything more.
Asked by pratikparwatwar on 2019-04-30 11:14:34 UTC
Comments
USB problem? Try another USB. In both cases it seems that freenect is not able to publish steadily the image stream, even crash. Verify freenect stream is stable at ~30Hz with:
$ rostopic hz /camera/rgb/image_rect_color /camera/depth_registered/image_raw /camera/rgb/camera_info
Asked by matlabbe on 2019-04-30 11:43:18 UTC
output for
is
for several times and then stops and following output repeats.
This happens exactly after the case2 error occurs. I have tried each USB port but same error occurs.
Asked by pratikparwatwar on 2019-04-30 12:10:34 UTC
You could also try with
openni_launch
package instead offreenect_launch
to see if it more stable on your system.Asked by matlabbe on 2019-04-30 12:15:24 UTC
with openni the rtabmap window ran for 1 second and then in openni terminal the following error occured
And this error repeats for several times.
Asked by pratikparwatwar on 2019-04-30 12:26:27 UTC
and case1 error happens in rtabmap terminal
Asked by pratikparwatwar on 2019-04-30 12:29:58 UTC
The problem is the camera driver, you should debug this before trying rtabmap. I think you can reproduce the problem without starting rtabmap, just by doing the following and wait a couple of seconds:
If it is the case, you could open a new question on why freenect and openni fail with your camera.
Asked by matlabbe on 2019-04-30 19:14:09 UTC
Yes you are right. the above commands reproduce the same issue. when you are saying camera driver issue. So what can the issue be with Kinect driver? or USB?. Also I''ll be putting up a question regarding 'why freenect and openni fail with my camera'. Thanks for showing patience.
Asked by pratikparwatwar on 2019-05-01 01:51:12 UTC
At this point, it could be the kinect version (see under the kinect), usb, or something else about the camera driver.
Asked by matlabbe on 2019-05-01 10:55:23 UTC
I have the same issue. It works ok on a desktop PC, but it doesn't work on raspberry pi, odroid xu4 and doesn't work on my laptop. I run on the first terminal
on a second one run
and everithing is ok, but when I add a third terminal with
it shows 3 or 4 measurements and then no new message on termianl 2 and 3.
openni_launch doesn't recognize my kinect
Asked by elgarbe on 2019-09-14 16:46:50 UTC
I am having the same problem right now. I am using rtabmap on a Raspberry Pi 4 2Gb Ram and it's running ubuntu 20.04 server. My camera is an xbox 360 Kinect. Rtabmap runs perfectly and creates maps while the Rpi is powered via a wall outlet. But when I switch to power from a lipo battery with a regulator regulating the voltage, I get the above errors noted by the OP. I have determined that the problem only happens when the Rpi ISN'T connected to a wall outlet. I tested all other scenarios ie. kinect powered through battery with rpi powered by wall outlet, and both Rpi and Kinect powered through wall outlet. I am using a 5000mAh battery at 14.8V regulated to 5V to power the Rpi.
Asked by chrish on 2022-03-26 16:21:46 UTC