BlazingForests / realsense_camera

use realsense camera in ROS
Other
36 stars 26 forks source link

ARM-ubuntu #19

Open ZahraBoroujeni opened 8 years ago

ZahraBoroujeni commented 8 years ago

Hello,

Is it possible to compile and use this package (intel realsense f200) using ARM-Ubuntu? I have odroid xu4, ubuntu 14.04. ROS indigo?

Best, Zahra

ZahraBoroujeni commented 8 years ago

Finally I cross compiled it. And I use your package in Odroidxu4. Still there are some errors I am working on.

ZahraBoroujeni commented 8 years ago

I can see the RGB image and point clouds but unfortunately I could not recieve IRStream , I recompile the odroidxu kernel by using patch file from link below, but there is not solve the problem. :(

https://github.com/teknotus/depthview/tree/kernelpatchfmt

Please find my log below:

   # 00:07:11 Konrad-1:/> roslaunch realsense_camera realsense_camera.launch 
... logging to /root/.ros/log/4628afbc-53a7-11e2-8c6f-001e063116f4/roslaunch-Konrad-1-9014.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://localhost:41149/

SUMMARY
========

PARAMETERS
 * /realsense_node/debug_depth_unit: False
 * /realsense_node/depth_cx: 320.0
 * /realsense_node/depth_cy: 240.0
 * /realsense_node/depth_frame_id: camera_depth_opti...
 * /realsense_node/depth_fx: 463.888885
 * /realsense_node/depth_fy: 463.888885
 * /realsense_node/depth_scale: 0.001
 * /realsense_node/depth_unit: 33.1
 * /realsense_node/depth_uv_enable_max: 800
 * /realsense_node/depth_uv_enable_min: 0
 * /realsense_node/ir_camera_info_url: 
 * /realsense_node/realsense_camera_type: Intel(R) RealSens...
 * /realsense_node/rgb_camera_info_url: 
 * /realsense_node/rgb_frame_h: 720
 * /realsense_node/rgb_frame_id: camera_rgb_optica...
 * /realsense_node/rgb_frame_w: 1280
 * /realsense_node/topic_depth_points_id: camera/depth/points
 * /realsense_node/topic_depth_registered_points_id: camera/depth_regi...
 * /realsense_node/topic_image_depth_raw_id: camera/depth/imag...
 * /realsense_node/topic_image_infrared_raw_id: camera/ir/image_raw
 * /realsense_node/topic_image_rgb_raw_id: camera/rgb/image_raw
 * /rosdistro: indigo
 * /rosversion: 1.11.16

NODES
  /
    camera_base_link (tf/static_transform_publisher)
    camera_base_link1 (tf/static_transform_publisher)
    camera_base_link2 (tf/static_transform_publisher)
    camera_base_link3 (tf/static_transform_publisher)
    realsense_node (realsense_camera/realsense_camera_node)

auto-starting new master
process[master]: started with pid [9050]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 4628afbc-53a7-11e2-8c6f-001e063116f4
process[rosout-1]: started with pid [9087]
started core service [/rosout]
process[realsense_node-2]: started with pid [9124]
process[camera_base_link-3]: started with pid [9134]
process[camera_base_link1-4]: started with pid [9141]
process[camera_base_link2-5]: started with pid [9146]
process[camera_base_link3-6]: started with pid [9155]

===================
realsense_camera_type = Intel(R) RealSense(TM) 3D Camer
rgb_frame_id = camera_rgb_optical_frame
depth_frame_id = camera_depth_optical_frame
depth_unit = 33.099998
depth_scale = 0.001000
depth_fxinv = 0.002156
depth_fyinv = 0.002156
depth_cx = 320.000000
depth_cy = 240.000000
depth_uv_enable_min = 0
depth_uv_enable_max = 800
topic_depth_points_id = camera/depth/points
topic_depth_registered_points_id = camera/depth_registered/points
topic_image_rgb_raw_id = camera/rgb/image_raw
topic_image_depth_raw_id = camera/depth/image_raw
topic_image_infrared_raw_id = camera/ir/image_raw
debug_depth_unit = 0
rgb_camera_info_url = 
ir_camera_info_url = 
=======================

depthWithIRStream - NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
if you want IR stream, please visit
http://solsticlipse.com/2015/03/31/intel-real-sense-3d-on-linux-macos.html
https://github.com/teknotus/depthview/tree/kernelpatchfmt

===========================================
Intel(R) RealSense(TM) 3D Camera lists

PCI: usb-xhci-hcd.2.auto-1.2.1
Serial: 019150133901
    /dev/video0
    /dev/video1
===========================================

use camera 019150133901
Directory /root/catkin_ws/src/realsense_camera/data/uvmap/019150133901 does not exist!!!!
video rgb name is /dev/video0
video depth name is /dev/video1

============== VIDIOC_QUERYCAP
/dev/video0 
   driver = uvcvideo
   card = Intel(R) RealSense(TM) 3D Camer
   bus_info = usb-xhci-hcd.2.auto-1.2.1
   version = 0x00030A5C
   capabilities = 0x85000001
   device_caps = 0x05000001
   reserved[3] = [0x00000000, 0x00000000, 0x00000000]

======================== get
/dev/video0 
v4l2_pix_format
   width = 1280
   height = 720
   pixelformat_value = 0x56595559
   pixelformat = YUYV
   field = 1
   bytesperline = 2560
   sizeimage = 1843200
   colorspace = 0
   priv = 0

======================== set
/dev/video0 
v4l2_pix_format
   width = 1280
   height = 720
   pixelformat_value = 0x56595559
   pixelformat = YUYV
   field = 1
   bytesperline = 2560
   sizeimage = 1843200
   colorspace = 0
   priv = 0

============ VIDIOC_S_PARM
/dev/video0 
v4l2_streamparm
   timeperframe.numerator = 1
   timeperframe.denominator = 30

video rgb w,h - 1280, 720

============== VIDIOC_QUERYCAP
/dev/video1 
   driver = uvcvideo
   card = Intel(R) RealSense(TM) 3D Camer
   bus_info = usb-xhci-hcd.2.auto-1.2.1
   version = 0x00030A5C
   capabilities = 0x85000001
   device_caps = 0x05000001
   reserved[3] = [0x00000000, 0x00000000, 0x00000000]

======================== get
/dev/video1 
v4l2_pix_format
   width = 640
   height = 480
   pixelformat_value = 0x56595559
   pixelformat = YUYV
   field = 1
   bytesperline = 1280
   sizeimage = 614400
   colorspace = 0
   priv = 0

======================== set
/dev/video1 
v4l2_pix_format
   width = 640
   height = 480
   pixelformat_value = 0x56595559
   pixelformat = YUYV
   field = 1
   bytesperline = 1280
   sizeimage = 614400
   colorspace = 0
   priv = 0

============ VIDIOC_S_PARM
/dev/video1 
v4l2_streamparm
   timeperframe.numerator = 1
   timeperframe.denominator = 30

video depth w,h - 640, 480
RealSense Camera is running!
Control 134217728 is not supported
Could not set Laser Power to 16
Control 134217729 is not supported
Could not set Accuracy to 2
Control 134217730 is not supported
Could not set Motion Range Trade Off to 0
Control 134217731 is not supported
Could not set Filter Option to 5
Control 134217732 is not supported
Could not set Confidence Threshold to 6

Did anyone run the package using ARM core?

teknotus commented 8 years ago

I've gotten the F200 working with a different ARM processor so I think it should be possible with the ODROID. It has USB 3.0. What do you get when you list the available formats for each of the three cameras?

v4l2-ctl --list-formats

Also what do you get from dmesg directly after attaching the camera?

Control 134217728 is not supported

Tells me that you don't have the control mapping code running. https://github.com/teknotus/depthview/tree/udev

Nikvand commented 8 years ago

Hi I am in a similar situation,

``SUMMARY

PARAMETERS

NODES / camera_base_link (tf/static_transform_publisher) camera_base_link1 (tf/static_transform_publisher) camera_base_link2 (tf/static_transform_publisher) camera_base_link3 (tf/static_transform_publisher) realsense_node (realsense_camera/realsense_camera_node)

auto-starting new master process[master]: started with pid [8257] ROS_MASTER_URI=http://localhost:11311

setting /run_id to 1e694fce-e24a-11e5-aebd-0060e063bfde process[rosout-1]: started with pid [8270] started core service [/rosout] process[realsense_node-2]: started with pid [8273] process[camera_base_link-3]: started with pid [8274] process[camera_base_link1-4]: started with pid [8280] process[camera_base_link2-5]: started with pid [8281] process[camera_base_link3-6]: started with pid [8299]

realsense_camera_type = Intel(R) RealSense(TM) 3D Camer rgb_frame_id = camera_rgb_optical_frame depth_frame_id = camera_depth_optical_frame depth_unit = 33.099998 depth_scale = 0.001000 depth_fxinv = 0.002156 depth_fyinv = 0.002156 depth_cx = 320.000000 depth_cy = 240.000000 depth_uv_enable_min = 0 depth_uv_enable_max = 800 topic_depth_points_id = camera/depth/points topic_depth_registered_points_id = camera/depth_registered/points topic_image_rgb_raw_id = camera/rgb/image_raw topic_image_depth_raw_id = camera/depth/image_raw topic_image_infrared_raw_id = camera/ir/image_raw debug_depth_unit = 0 rgb_camera_info_url =

ir_camera_info_url =

depthWithIRStream - NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO if you want IR stream, please visit http://solsticlipse.com/2015/03/31/intel-real-sense-3d-on-linux-macos.html https://github.com/teknotus/depthview/tree/kernelpatchfmt

Intel(R) RealSense(TM) 3D Camera lists

PCI: usb-0000:00:14.0-3.1 Serial: 018150165706 /dev/video0

/dev/video1

use camera 018150165706 Directory /home/teamuav/catkin_ws/src/realsense_camera/data/uvmap/018150165706 does not exist!!!! video rgb name is /dev/video0 video depth name is /dev/video1

============== VIDIOC_QUERYCAP /dev/video0 driver = uvcvideo card = Intel(R) RealSense(TM) 3D Camer bus_info = usb-0000:00:14.0-3.1 version = 0x00031308 capabilities = 0x85200001 device_caps = 0x05200001 reserved[3] = [0x00000000, 0x00000000, 0x00000000]

======================== get /dev/video0 v4l2_pix_format width = 640 height = 480 pixelformat_value = 0x56595559 pixelformat = YUYV field = 1 bytesperline = 1280 sizeimage = 614400 colorspace = 0 priv = -17970434

======================== set /dev/video0 v4l2_pix_format width = 1280 height = 720 pixelformat_value = 0x56595559 pixelformat = YUYV field = 1 bytesperline = 2560 sizeimage = 1843200 colorspace = 0 priv = -17970434

============ VIDIOC_S_PARM /dev/video0 v4l2_streamparm timeperframe.numerator = 1 timeperframe.denominator = 30

video rgb w,h - 1280, 720

============== VIDIOC_QUERYCAP /dev/video1 driver = uvcvideo card = Intel(R) RealSense(TM) 3D Camer bus_info = usb-0000:00:14.0-3.1 version = 0x00031308 capabilities = 0x85200001 device_caps = 0x05200001 reserved[3] = [0x00000000, 0x00000000, 0x00000000]

======================== get /dev/video1 v4l2_pix_format width = 640 height = 480 pixelformat_value = 0x56595559 pixelformat = YUYV field = 1 bytesperline = 1280 sizeimage = 614400 colorspace = 0 priv = -17970434

======================== set /dev/video1 v4l2_pix_format width = 640 height = 480 pixelformat_value = 0x56595559 pixelformat = YUYV field = 1 bytesperline = 1280 sizeimage = 614400 colorspace = 0 priv = -17970434

============ VIDIOC_S_PARM /dev/video1 v4l2_streamparm timeperframe.numerator = 1 timeperframe.denominator = 30

video depth w,h - 640, 480 RealSense Camera is running! Control 134217728 is not supported Could not set Laser Power to 16 Control 134217729 is not supported Could not set Accuracy to 2 Control 134217730 is not supported Could not set Motion Range Trade Off to 0 Control 134217731 is not supported Could not set Filter Option to 5 Control 134217732 is not supported Could not set Confidence Threshold to 6

Any updates on this error?

BlazingForests commented 8 years ago

@Nikvand Hi

Make sure your kernel patch is OK.

You can follow @teknotus 's answer. The guy who made the IR stream kernel patch.

Thx DD

Nikvand commented 8 years ago

@BlazingForests @teknotus Hi guys is the v4l2-ctl compatible code available for R200? the current code is for F200 and I am getting the same messages when I run my F200 using:

roslaunch realsense_camera realsense_camera_r200_camera.launch

Results:

video depth w,h - 314, 938 RealSense Camera is running! Control 134217728 is not supported Could not set Laser Power to 16 Control 134217729 is not supported Could not set Accuracy to 2 Control 134217730 is not supported Could not set Motion Range Trade Off to 0 Control 134217731 is not supported Could not set Filter Option to 5 Control 134217732 is not supported Could not set Confidence Threshold to 6

teknotus commented 8 years ago

@BlazingForests @teknotus Hi guys is the v4l2-ctl compatible code available for R200? the current code is for F200 and I am getting the same messages when I run my F200 using:

The controls stuff is F200 specific. The R200 controls work very differently, and very strangely. There are also many controls on the R200. It wouldn't be a simple matter to add support for them. The controls don't have a consistent interface so some would be much easier to add support for than others. The control to set the scale of z units would be easy. It's locked while streaming but otherwise sane and acts like an F200 control. It is just an integer get, or set. Other controls might be a little bit harder like getting and setting a struct, or a lot harder like a communication protocol. It is in my to do queue.

https://github.com/teknotus/depthview/tree/udev

ZahraBoroujeni commented 8 years ago

Hi,

I have a new camera SR300, after patching uvc folder and install new uvcvideo.ko, still it could not find IR Stream, any suggestion? I am working on odroid xu4, ubuntu 14.04.

v4l2-ctl --device /dev/video1 --list-formats
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUV 4:2:2 (YUYV)

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'INVZ'
    Name        : Depth 16-bit (INVZ)

    Index       : 2
    Type        : Video Capture
    Pixel Format: 'INZI'
    Name        : Depth:IR 16:8 24-bit (INZI)

    Index       : 3
    Type        : Video Capture
    Pixel Format: ''
    Name        : 435a4e49-b602-480f-978c-e4e88ae

    Index       : 4
    Type        : Video Capture
    Pixel Format: 'INVI'
    Name        : Infrared 8-bit (INVI)
depthview-udev> ./realsense-map-controls /dev/video1
# 00:17:46 Konrad-1:~/depthview-udev> v4l2-ctl --device=/dev/video1 --list-ctrls-menus
                        privacy (bool)   : default=0 value=0
                    laser_power (int)    : min=0 max=16 step=1 default=16 value=16
                        pattern (menu)   : min=0 max=2 default=0 value=0
                0: 11 patterns 50fps
                1: 10 patterns 55fps
                2: 9 patterns 60fps
                       exposure (int)    : min=0 max=220 step=1 default=9 value=9
                         filter (menu)   : min=0 max=7 default=5 value=5
                0: Skeleton
                1: Raw
                2: Raw + Gradiants
                3: Range optimized < 350mm
                4: Range optimized 350mm - 550mm
                5: Range optimized 550mm - 850mm
                6: Range optimized 850mm - 1000mm
                7: Range optimized > 1000mm
           confidence_threshold (int)    : min=0 max=15 step=1 default=3 value=3
ZahraBoroujeni commented 8 years ago

when I run the rosnode realsense_camera, and subscribe to /camera/rgb/image_raw/compressed topic using my android APP, after 30 seconds the realsense camera node makes an error below:

video depth w,h - 640, 480
RealSense Camera is running!
***** Error in `/root/catkin_ws/devel/lib/realsense_camera/realsense_camera_node': free(): invalid pointer: 0xae54d008 ***
[realsense_node-2] process has died [pid 4526, exit code -6, cmd /root/catkin_ws/devel/lib/realsense_camera/realsense_camera_node camera/rgb/image_raw:=app/camera/rgb/image_raw __name:=realsense_node __log:=/root/.ros/log/8d6e5256-53a6-11e2-8ec2-001e063116f4/realsense_node-2.log].
log file: /root/.ros/log/8d6e5256-53a6-11e2-8ec2-001e063116f4/realsense_node-2*.log**
ZahraBoroujeni commented 8 years ago

Another issue, the depth image output is always white! I do not which setting should I change. any suggestion?

ZahraBoroujeni commented 8 years ago

Another issue: When I want to subscribe to /camera/depth/image_raw/compressedDepth, I received errors below: [ERROR] [1357000030.096993652]: Compressed Depth Image Transport - Compression requires single-channel 32bit-floating point or 16bit raw depth images (input format is: mono8).

BlazingForests commented 8 years ago

@ZahraBoroujeni Hi, I am very sorry. This project is not tested for SR300.

ZahraBoroujeni commented 8 years ago

@BlazingForests I have also F200, And I have the same issue for F200 as well.

BlazingForests commented 8 years ago

@ZahraBoroujeni Hi

Sorry, There don't have this topic "/camera/rgb/image_raw/compressed"

The default topic are

sensor_msgs::Image /camera/rgb/image_raw raw image for RGB sensor /camera/depth/image_raw raw image for depth sensor /camera/ir/image_raw raw image for infrared sensor

ZahraBoroujeni commented 8 years ago

@BlazingForests Hi How is it possible? When you use image publisher, it will automatically publish /compressed and other subtopics! I can subscribe to /camera/rgb/image_raw/compressed. And I can see the video real time on our android APP, the problem is that after 30 seconds/1 minute the node will crash! and then I will get error below:

***** Error in `/root/catkin_ws/devel/lib/realsense_camera/realsense_camera_node': free(): invalid pointer: 0xae54d008 ***
[realsense_node-2] process has died [pid 4526, exit code -6, cmd /root/catkin_ws/devel/lib/realsense_camera/realsense_camera_node camera/rgb/image_raw:=app/camera/rgb/image_raw __name:=realsense_node __log:=/root/.ros/log/8d6e5256-53a6-11e2-8ec2-001e063116f4/realsense_node-2.log].
log file: /root/.ros/log/8d6e5256-53a6-11e2-8ec2-001e063116f4/realsense_node-2*.log**

And it is my rostopic list:

> :$ rostopic list
> /camera/depth/camera_info
> /camera/depth/image_raw
> /camera/depth/image_raw/compressed
> /camera/depth/image_raw/compressed/parameter_descriptions
> /camera/depth/image_raw/compressed/parameter_updates
> /camera/depth/image_raw/compressedDepth
> /camera/depth/image_raw/compressedDepth/parameter_descriptions
> /camera/depth/image_raw/compressedDepth/parameter_updates
> /camera/depth/image_raw/theora
> /camera/depth/image_raw/theora/parameter_descriptions
> /camera/depth/image_raw/theora/parameter_updates
> /camera/depth/points
> /camera/depth_registered/points
> /camera/rgb/camera_info
> /camera/rgb/image_raw
> /camera/rgb/image_raw/compressed
> /camera/rgb/image_raw/compressed/parameter_descriptions
> /camera/rgb/image_raw/compressed/parameter_updates
> /camera/rgb/image_raw/compressedDepth
> /camera/rgb/image_raw/compressedDepth/parameter_descriptions
> /camera/rgb/image_raw/compressedDepth/parameter_updates
> /camera/rgb/image_raw/theora
> /camera/rgb/image_raw/theora/parameter_descriptions
> /camera/rgb/image_raw/theora/parameter_updates
> /realsense_camera_config
> /realsense_node/parameter_descriptions
> /realsense_node/parameter_updates
> /rosout
> /rosout_agg
> /tf

Our Android APP which subscribe to /app/camera/rgb/image_raw/compressed https://github.com/neumann89/android_ros_model_car/tree/master/car_control I did remapping to see the image! <remap from="camera/rgb/image_raw" to="app/camera/rgb/image_raw" />

ZahraBoroujeni commented 8 years ago

I solved some of the problem by reducing fps from 60 to 30!

ZahraBoroujeni commented 8 years ago

@BlazingForests And if you install ros-indigo-image-transport-plugins, you could see other subtopics like /camera/depth/image_raw/compressed

BlazingForests commented 8 years ago

@ZahraBoroujeni OK, Thank you. :)

jonabert commented 7 years ago

Hi @ZahraBoroujeni , just bought the SR300 and our standard platform is Odroid XU4, is the situation now ok for the SR300 to work on on Ubuntu 14.04 and XU4? So if fps downgraded to 30fps and the patches are applied, everything is ok?

ZahraBoroujeni commented 7 years ago

@jonabert Yes, I am using SR300 with ROS indigo, It works for me if I run the launch file twice! To install glfw and librealsense you can follow the setup section from link below: https://github.com/AutoModelCar/AutoModelCarWiki/wiki/Flashing-the-eMMC