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

Stream Asus Xtion Pro Live rgb with openni2 and mjpeg_server

asked 2014-10-29 21:51:57 -0600

Andrew.A gravatar image

updated 2014-10-29 23:11:36 -0600

Currently, I'm running Indigo on Ubuntu 14.04 on my Nvidia Jetson TK1.

I'm trying to stream rgb from my Asus Xtion Pro Live rgb to a web browser using openni2 and mjpeg_server. I used openni v1 previously, and how i did it was simply by running roslaunch openni_launch openni.launch, and rosrun mjpeg_server mjpeg_server _port:=8181 . I put the url (in my case, ) in an img tag on a webserver, and I could see the rgb stream perfectly.

But with openni2, I tried to do the same, running roslaunch openni2_launch openni2.launch and rosrun mjpeg_server mjpeg_server, but I can't view any rgb stream on my web browser. When I connect though, I can see that mjpeg_server recognises it and says Client connected. 1 subscribers for /camera/rgb/image_color.

$ roslaunch openni2_launch openni2.launch
... logging to /home/ubuntu/.ros/log/bc719cc2-5fdc-11e4-8705-00044b25c9e6/roslaunch-tegra-ubuntu-21571.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://tegra-ubuntu:42313/


 * /camera/camera_nodelet_manager/num_worker_threads: 4
 * /camera/depth_rectify_depth/interpolation: 0
 * /camera/driver/auto_exposure: True
 * /camera/driver/auto_white_balance: True
 * /camera/driver/color_depth_synchronization: False
 * /camera/driver/depth_camera_info_url: 
 * /camera/driver/depth_frame_id: /camera_depth_opt...
 * /camera/driver/depth_registration: False
 * /camera/driver/device_id: #1
 * /camera/driver/rgb_camera_info_url: 
 * /camera/driver/rgb_frame_id: /camera_rgb_optic...
 * /rosdistro: indigo
 * /rosversion: 1.11.9

    camera_nodelet_manager (nodelet/nodelet)
    depth_metric (nodelet/nodelet)
    depth_metric_rect (nodelet/nodelet)
    depth_points (nodelet/nodelet)
    depth_rectify_depth (nodelet/nodelet)
    driver (nodelet/nodelet)
    points_xyzrgb_sw_registered (nodelet/nodelet)
    rectify_color (nodelet/nodelet)
    register_depth_rgb (nodelet/nodelet)
    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)

auto-starting new master
process[master]: started with pid [21582]

setting /run_id to bc719cc2-5fdc-11e4-8705-00044b25c9e6
process[rosout-1]: started with pid [21595]
started core service [/rosout]
process[camera/camera_nodelet_manager-2]: started with pid [21612]
process[camera/driver-3]: started with pid [21613]
[ INFO] [1414636240.011987344]: Initializing nodelet with 4 worker threads.
process[camera/rectify_color-4]: started with pid [21632]
process[camera/depth_rectify_depth-5]: started with pid [21660]
process[camera/depth_metric_rect-6]: started with pid [21671]
Warning: USB events thread - failed to set priority. This might cause loss of data...
process[camera/depth_metric-7]: started with pid [21688]
process[camera/depth_points-8]: started with pid [21707]
process[camera/register_depth_rgb-9]: started with pid [21717]
process[camera/points_xyzrgb_sw_registered-10]: started with pid [21735]
process[camera_base_link-11]: started with pid [21749]
process[camera_base_link1-12]: started with pid [21763]
process[camera_base_link2-13]: started with pid [21774]
process[camera_base_link3-14]: started with pid [21785]
[ INFO] [1414636240.516221719]: Device "1d27/0601@3/3" with serial number "1306010085" connected

Warning: USB events thread - failed to set priority. This might cause loss of data...

$ rosrun mjpeg_server mjpeg_server _port:=8181
[ INFO] [1414636245.969765456]: Starting mjpeg server
[ INFO] [1414636245.972252946]: Bind(8181) succeeded
[ INFO] [1414636245.972826527]: waiting for clients to connect
[ INFO] [1414636249.914464389]: Client connected
[ INFO] [1414636250.113366284]: 1 subscribers for /camera/rgb/image_color/
[ INFO] [1414636250.492810561]: Subscribing to topic /camera/rgb/image_color/

Can anyone tell me if I did anything wrong?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2014-10-29 23:11:20 -0600

Andrew.A gravatar image

The topic /camera/rgb/image_color/ didn't exist! I checked available topics by doing a rostopic list, and the topic I was interested turned out to be /camera/rgb/image_raw. After changing image_color to image_raw, it worked!

edit flag offensive delete link more

answered 2015-01-02 11:10:05 -0600

Myzhar gravatar image

Hi, I have a question for you: how have you installed OpenNI2 for Asus XTion Pro Live? I compiled it by source, but I cannot find a sensor connected....

edit flag offensive delete link more


Please ask this as a new question

Andrew.A gravatar image Andrew.A  ( 2015-01-03 07:34:20 -0600 )edit

answered 2014-10-30 12:23:11 -0600

rtoris288 gravatar image

Check out a new version of MJPEG server we are getting ready to release. It does proper conversions of the actual depth and IR image topics which can no be streamed to the browser. Install it from and point your browser to http://localhost:8080 after running. It will present you with an index of all the valid topics that exist.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-10-29 21:51:57 -0600

Seen: 4,193 times

Last updated: Jan 02 '15