Ask Your Question
0

Kinect + Openni/Freenect + Multiple machines

asked 2016-04-02 13:17:49 -0500

jacksonkr_ gravatar image

I've learned that ROS allows for talking/subscribing of topics over the network by utilizing ROS_MASTER_URI. I'm trying to get my Kinect data to work in a similar fashion.

Senario:

  • Computer (10.0.0.22) "Master" runs roscore and rviz
  • Computer (10.0.0.4) "Bot" runs roslaunch openni_launch openni.launch OR roslaunch freenect_launch freenect.launch

Both computers have export ROS_MASTER_URI=http://10.0.0.22:11311

So roscore is running and roslaunch openni_launch openni.launch are both running fine but things get weird with the introduction of rosrun rviz rviz. On "Bot" I see the terminal print out the following immediately when rviz boots up:

$ roslaunch openni_launch openni.launch
... logging to /home/ubuntu/.ros/log/b945d67e-f8fd-11e5-a7b3-0800270c17fb/roslaunch-ubuntu-3091.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://ubuntu:43440/

SUMMARY
========

PARAMETERS
 * /camera/camera_nodelet_manager/num_worker_threads: 4
 * /camera/depth_rectify_depth/interpolation: 0
 * /camera/depth_registered_rectify_depth/interpolation: 0
 * /camera/disparity_depth/max_range: 4.0
 * /camera/disparity_depth/min_range: 0.5
 * /camera/disparity_registered_hw/max_range: 4.0
 * /camera/disparity_registered_hw/min_range: 0.5
 * /camera/disparity_registered_sw/max_range: 4.0
 * /camera/disparity_registered_sw/min_range: 0.5
 * /camera/driver/depth_camera_info_url: 
 * /camera/driver/depth_frame_id: camera_depth_opti...
 * /camera/driver/depth_registration: False
 * /camera/driver/device_id: #1
 * /camera/driver/rgb_camera_info_url: 
 * /camera/driver/rgb_frame_id: camera_rgb_optica...
 * /rosdistro: indigo
 * /rosversion: 1.11.16

NODES
  /camera/
    camera_nodelet_manager (nodelet/nodelet)
    debayer (nodelet/nodelet)
    depth_metric (nodelet/nodelet)
    depth_metric_rect (nodelet/nodelet)
    depth_points (nodelet/nodelet)
    depth_rectify_depth (nodelet/nodelet)
    depth_registered_hw_metric_rect (nodelet/nodelet)
    depth_registered_metric (nodelet/nodelet)
    depth_registered_rectify_depth (nodelet/nodelet)
    depth_registered_sw_metric_rect (nodelet/nodelet)
    disparity_depth (nodelet/nodelet)
    disparity_registered_hw (nodelet/nodelet)
    disparity_registered_sw (nodelet/nodelet)
    driver (nodelet/nodelet)
    points_xyzrgb_hw_registered (nodelet/nodelet)
    points_xyzrgb_sw_registered (nodelet/nodelet)
    rectify_color (nodelet/nodelet)
    rectify_ir (nodelet/nodelet)
    rectify_mono (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)

ROS_MASTER_URI=http://10.0.0.22:11311

core service [/rosout] found
process[camera/camera_nodelet_manager-1]: started with pid [3100]
process[camera/driver-2]: started with pid [3101]
process[camera/debayer-3]: started with pid [3102]
process[camera/rectify_mono-4]: started with pid [3103]
process[camera/rectify_color-5]: started with pid [3107]
process[camera/rectify_ir-6]: started with pid [3112]
process[camera/depth_rectify_depth-7]: started with pid [3113]
process[camera/depth_metric_rect-8]: started with pid [3121]
process[camera/depth_metric-9]: started with pid [3122]
process[camera/depth_points-10]: started with pid [3126]
process[camera/register_depth_rgb-11]: started with pid [3127]
process[camera/points_xyzrgb_sw_registered-12]: started with pid [3128]
process[camera/depth_registered_sw_metric_rect-13]: started with pid [3138]
process[camera/depth_registered_rectify_depth-14]: started with pid [3145]
process[camera/points_xyzrgb_hw_registered-15]: started with pid [3147]
process[camera/depth_registered_hw_metric_rect-16]: started with pid [3155]
process[camera/depth_registered_metric-17]: started with pid [3157]
process[camera/disparity_depth-18]: started with pid [3161]
[ INFO] [1459620448.933287052]: Initializing nodelet with 4 worker threads.
process[camera/disparity_registered_sw-19]: started with pid [3162]
process[camera/disparity_registered_hw-20]: started with pid [3174]
process[camera_base_link-21]: started with pid [3182]
process[camera_base_link1-22]: started with pid [3183]
process[camera_base_link2-23]: started with pid [3184]
process[camera_base_link3-24]: started with pid [3185]
Warning: USB events thread - failed to set priority. This might cause loss of data...
Warning: USB events thread - failed to ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-04-09 17:34:01 -0500

jacksonkr_ gravatar image

updated 2016-04-11 09:25:33 -0500

* EDIT *

I didn't have all my facts and figures straight before writing this answer. The fact is that it doesn't matter where the master is or where the camera is. Once your settings correspond correctly then everything should work. Make sure the following two items are addressed on ALL machines.

  • ROS_MASTER_URI - IP of the machine to act as the "server", needs be the same on all machines
  • ROS_IP - the IP of the current machine, needs to be different on all machines

--- Original Answer Below ---

I had the right idea and found out where I was wrong. The "master" is really the robot, which seems a little backward to me but now that I know that roscore needs to run on the robot I'm set straight. Here's the article that put me on the right track:

Getting RVIZ to Work Over Multiple Computers

And in case the link ever dies, here's the content of the link since it's short:

README on getting RVIS to work over

multiple computers

A common task is to SSH into the robot's computer and run RVIZ to get the laser output and other visualization. Running RVIZ directly on the remote computer will not work due to the way RVIZ is implemented. The workaround is to run RVIZ locally. To do this we need to set the local computer to locate the remote MASTER NODE in order to display the right information.

Assume: IP: 192.168.1.0 // remote computer (robot) IP: 192.168.1.1 // local computer (host)

* ssh into remote computer * 1. ssh -X erratic@192.168.1.0

At the remote terminal: 2. export ROS_MASTER_URI=http://192.168.1.0:11311 //this ensures that we do not use localhost, but the real IP address as master node

  1. export ROS_IP=192.168.1.0 //this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)

  2. roscore

At the local terminal: 1. export ROS_MASTER_URI=http://192.168.1.0:11311 //tells local computer to look for the remote here

  1. export ROS_IP=192.168.1.1 //this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)

  2. rosrun rviz rviz // fires up rviz on local computer. It will attach to the master node of the remote computer

* to check, open a remote terminal * 1. rxgraph

** Note, everytime a new terminal is open on the local/remote computer, we have to call the 2 exports commands. To make this permanent, edit the ~/.bashrc file: 1. sudo gedit ~/.bashrc //add the two export commands at the end of the file.

  1. source ~/.bashrc //and restart terminal
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-04-02 13:17:49 -0500

Seen: 535 times

Last updated: Apr 11 '16