record kinect v1 topics for offline mapping

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

record kinect v1 topics for offline mapping

elgarbe
Hi, I'm working on a kinect v1 connected to an odroid xu4, using freenect.
I would like to record topics (I'm not sure which ones) to make offline 3d mapping.
Can you point me out on the launch files and topics to record? I don't have odometry and I don't have lidar data.

Thank!
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

matlabbe
Administrator
Hi,

Record:
$ roslaunch freenect_launch freenect.launch depth_registration:=true
$ rosbag record /tf /tf_static /camera/rgb/camera_rect_color /camera/depth_registered/image_raw /camera/rgb/camera_info
Note that you can use "data_skip" argument to freenect.launch to avoid recording at 30 Hz, the bag will be smaller.

Replay:
$ roslaunch rtabmap_ros rtabmap.launch args:="-d" use_sim_time:=true
$ rosbag play --clock my_recording.bag

The tricky part is that if we don't do visual odometry during the recording, we cannot have a live feedback if the recorded images will be usable to avoid lost odometry.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

elgarbe
Oh, right, and how can I run viual odometry on my laptop while the robot is running?

thank!
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

matlabbe
Administrator
Look the the remote mapping example here: http://wiki.ros.org/rtabmap_ros/Tutorials/RemoteMapping
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

elgarbe
Ok, I've installed rtabmpa and rtabmap_ros (binaries) on odroid, created thorttle launch file and run it:
roslaunch freenect_throttle.launch rate:=5

On client PC install rtabmap and _ros (binaries), export ROS_IP and Master_URI,then launch
$ roslaunch rtabmap_ros rtabmap.launch subscribe_rgbd:=true rgbd_topic:=/camera/rgbd_image compressed:=true rtabmap_args:="--delete_db_on_start"

And I get:
ERROR: cannot launch node of type [rtabmap_ros/rgbd_relay]: can't locate node [rgbd_relay] in package [rtabmap_ros]
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

matlabbe
Administrator
Hi,

On your PC, which ubuntu version do you have? rgbd_relay should be included if cv_bridge package version is over 1.10 (https://github.com/introlab/rtabmap_ros/blob/986ed79d35b0fb6e77eb2a1e2723954d75f27941/CMakeLists.txt#L217-L218).

You can also try the approach without rgbd_sync in the tutorial.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

elgarbe
I have ubuntu 16.04.

I need to make my robot setup more robust. Running kinect 1 on ubuntu 16.04 and odroid xu4 with rtabmap_ros from binaries and freenect_launch from binaries works for a couple of seconds and die. I need to know about some tested setup, I have a kinect 1 but I could buy a kinect 2 and I have odroid xu4, but I can buy a rapberry pi 3b+. Is there a tested setup with this elements?
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

matlabbe
Administrator
This post was updated on .
For rgbd_relay, the node version is not installed by default with the binaries, only the nodelet. I fixed the problem in this commit. A workaround with the current version is to edit rtabmap.launch and change this line to:
<node name="republish_rgbd_image"  type="nodelet" pkg="nodelet" args="standalone rtabmap_ros/rgbd_relay">
 
Which nodes are dying? If it is freenect_launch, it may be a power/usb problem. I just tried a kinect 360 on RPI3 + Ubuntu mate 18.04 + rtabmap binaries and it cannot open the device with freenect, openni or openni2 drivers. I remember however a couple years ago having successfully run rtabmap + kinect360 on RPI with raspbian.

I think the biggest issue here is not rtabmap, but the drivers. If you make freenect or openni working on odroid, you should be able to use rtabmap binaries with their image outputs.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

elgarbe
In fact there isn't a node that die, but I made the following test:
I uninstall all freenect and rtabmpa* from my system. then
Install just ros-kinetic-freenect_launch (it install ros-kinetic-libfreenect and other dependencies)

I run freenect_launch on a terminal
run rostopic hz /camera/rgb/image_raw on a second terminal and confirm 30fps
run rostopic hz /camera/depth_registered/image and get a couple of 30fps messages and then "no new message" on terminal 2 and 3. From there I have to shutdown all unplug kinect, replug and launch everithing again.
This happen on my laptop PC (dell inspiron 5000) and on odroid xu4, the same issue. It don't happen on my desktop PC running lubuntu.
One option would be to discard raspberrys and install my laptop PC, but I need to make it work on it!

For your tests on raspberry pi 3 and ubuntu 18, how do you install freenect, openni and onpenni2 driver? and how do you test if it is working or not?

I already saw your post about raspberry pi3 and I'm working trying to reproduce.

I know the problem is the drivers, so I'm looking for some setup that is tested to work, I found this:
https://forum.odroid.com/viewtopic.php?f=95&t=16149
and wondering if rtabmpa_ros would run on ros jade.
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

matlabbe
Administrator
Hi,

rtabmap works on Jade, there are also some binaries (though not latest version).

On raspbian, I think I installed ros kinetic binaries for armhf. For the freenect stuff, it seems I compiled from source: https://github.com/introlab/rtabmap/wiki/Installation#raspberrypi

For rtabmap_ros, not need to rebuild from source on the PI, you can use the binaries if you will use ROS.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

elgarbe
what version of raspbian (Stretch? ) do you use?
Reply | Threaded
Open this post in threaded view
|

Re: record kinect v1 topics for offline mapping

matlabbe
Administrator
I don't remember unfortunately :(