0
$\begingroup$

Rosanswers logo

Hello, experts~ I am a new in ROS. And recently, I am trying to get image and make it detected by the node ar_track_alvar. However, this ar node requires sensor_msgs/PointCloud2 data. Firstly I tried to use usb_cam_node and I got sensor_msgs/Image. The same situation happened using Pointgrey camera with its driver: pointgrey_camera_driver. After searching some files, I find that it might work if I can use openni to get the image, after all it is discribed in wiki: "Launch files to open an OpenNI device and load all nodelets to convert raw depth/RGB/IR streams to depth images, disparity images, and (registered) point clouds."here. And after I run the command: " roslaunch openni2_launch openni2.launch " it says there is no device. I really don't know how to make it out. Can anyone help me answer the following question:

  1. Can pointgrey camera be directly used by openni launch file?
  2. Can common USB camera be used by openni launch?
  3. If the answer of both is negative, how can I get pointcloud2 data with what kind of device and with which driver? P.S. Here is what shell says after I run roslaunch openni2_launch openni2.launch [ INFO] [1431337093.836048605]: No matching device found.... waiting for devices. Reason: std::string openni2_wrapper::OpenNI2Driver::resolveDeviceURI(const string&) @ /tmp/buildd/ros-indigo-openni2-camera-0.2.3-0trusty-20150327-0611/src/openni2_driver.cpp @ 623 : Invalid device number 1, there are 0 devices connected.

Originally posted by david059 on ROS Answers with karma: 13 on 2015-05-11

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

For using openni package and also for generating point cloud you should have Kinect or Asus Xtion ( Depth Sensor). OpenNI wont work with normal usb camera. usb_cam package is to capture rgb image using usb camera.

For generating pointcloud u can use either Kinect with freenect package or rgbdslam ( available for electric Older version of ROS)

If you are only interested in creating 3D, you can use lsd_slam or ORB slam, it will give nice 3d in real time but it wont publish any pointcloud message.


Originally posted by KDROS with karma: 67 on 2015-05-11

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by david059 on 2015-05-11:
WOW! So quick! Thank you very much for your guidance! So now I understand what can be used for OpenNI and what cannot. But can I take it that the pointcloud can just only be generated by OpenNI which means I have to have devices you mentioned? Is there any other way I can get pointcloud with uabcam?

Comment by KDROS on 2015-05-11:
Yup I mentioned, lsd_slam and ORB_Slam you can get good pointcloud, but for very good pointcloud either use lsd_slam with global shutter camera with fish eye lens or Kinect/Asus Xiton with freenect/openNI2 package.

Comment by david059 on 2015-05-11:
I think you just really did me a great favor! Even though I can't find LSD_SLAM nor ORB_SLAM in http://www.ros.org/browse/list.php, I find them in github! I will try them right now and I hope this time I can make it. Thank you, KDROS!

Comment by KDROS on 2015-05-11:
Thanx, Yup It is not available in ROS, check this links lsd_slam. You can ask if you will be in trouble.

Comment by david059 on 2015-05-12:
Hey KDROS, after reading about what it says in github, I realize the problem you mentioned , LSD_SLAM indeed can not be used for live-pointcloud use in ROS. ButI think I find another way to get PointCloud2 data. By using image_proc

Comment by david059 on 2015-05-12:
I will talk in more detail in my answer below

$\endgroup$
0
$\begingroup$

Rosanswers logo

To obtain sensor_msgs/PointCloud or sensor_msgs/PointCloud2 data, I think there is an easy way to realize it. No matter what your camera_driver is, there will always have Image_raw data. I use PointGrey carema and usb camera, both drivers of them can get raw image whose format is sensor_msgs/Image. Next use image_proc http://wiki.ros.org/image_proc?distro=indigo we can get Image_rect [Image] which is the data format needed in the next step. I find depth_image_proc can produce PoindCloud or PointCloud2 data by using Image_rect. Here: http://wiki.ros.org/depth_image_proc. I think this is a way worthy of trying, even though I don't know what kind of image will finally get. I'm trying now, and I will update this question informing any one who see this question. Welcome everyone to come to discuss.


Originally posted by david059 with karma: 13 on 2015-05-12

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by KDROS on 2015-05-12:
Flow is good.. I will also try this, its very cheaper approach. Thanx. But till now I am using lsd_slam and kinect and getting good result.

Comment by KDROS on 2015-05-13:
Is it working fine ? In my case am getting error manager arg need to be set, I rectified this by giving true.. and there is no node/launch file for depth_image_proc. Tell me the detail execution process, it sounds interesting. I was using this package earlier but that time also i was unable to solve

Comment by david059 on 2015-05-13:
I just get it through, you have to write a launch file according to the nodelet_plugins.xml file in depth_image_proc. You have to run a nodelet and here is the tutorial, I can get some thing in RVIZ, but still some trouble in ar_track

Comment by KDROS on 2015-05-13:
I run image_proc, it is running successfully but its not publishing any topic. are you getting this? did you change any thing in launch file except manager arg?

Comment by david059 on 2015-05-13:
if you are running a node, run this ROS_NAMESPACE=my_camera rosrun image_proc image_proc. my_camera is the relative name provided by your camera driver there will have topic shown in http://wiki.ros.org/image_proc?distro=indigo Nodes section.

Comment by david059 on 2015-05-13:
If you roslaunch a launch file you have to rectify the original launch file, assign specific arg value like args="load image_proc/debayer $(arg manager) $(arg bond)" you need replace $(arg manager) with standalone_nodelet, like tutorial in the [](http://wiki.ros.org/nodelet/Tutorials/Running%20a%20n

Comment by KDROS on 2015-05-14:
Main benefit of lsd_slam over this is that it fuses all pointcloud (like PCL) but in image_proc it is just publishing pointcloud for each image. which is easily doable by Kinect.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.