SHARE
TWEET

Untitled

a guest Jan 25th, 2016 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. echo 'appending kinect2_bridge launch to upstart file...'
  4.  
  5. if [ -d "/etc/ros/groovy" ];
  6. then
  7.     echo "groovy exists..."
  8.     sudo sed -i 's:</launch>:\
  9.     <machine name="pr2-head" address="pr2-head" user="pr2-head" password="clearpath" env-loader="/home/pr2-head/kinect_ws/devel/env.sh"/>\
  10.     <node machine="pr2-head" pkg="kinect2_bridge" type="kinect2_bridge" name="kinect2_bridge">\
  11.     \t<param name="publish_tf" value="true"/>\
  12.     </node>\
  13.     <node pkg="tf" type="static_transform_publisher" name="kinect2_transform" args="0 0 0 0 0 0 head_mount_kinect2_ir_optical_frame kinect2_link 300" />\
  14.     \
  15.     </launch>:i' /etc/ros/groovy/robot.launch
  16. fi
  17.  
  18. if [ -d "/etc/ros/hydro" ];
  19. then
  20.     echo "hydro exists..."
  21.     sudo sed -i 's:</launch>:\
  22.     <machine name="pr2-head" address="pr2-head" user="pr2-head" password="clearpath" env-loader="/home/pr2-head/kinect_ws/devel/env.sh"/>\
  23.     <node machine="pr2-head" pkg="kinect2_bridge" type="kinect2_bridge" name="kinect2_bridge">\
  24.     \t<param name="publish_tf" value="true"/>\
  25.     </node>\
  26.     <node pkg="tf" type="static_transform_publisher" name="kinect2_transform" args="0 0 0 0 0 0 head_mount_kinect2_ir_optical_frame kinect2_link 300" />\
  27.     \
  28.     </launch>:i' /etc/ros/hydro/robot.launch
  29. fi
  30.  
  31. if [ -d "/etc/ros/indigo" ];
  32. then
  33.     echo "indigo exists..."
  34.     sudo sed -i 's:</launch>:\
  35.     <machine name="pr2-head" address="pr2-head" user="pr2-head" password="clearpath" env-loader="/home/pr2-head/kinect_ws/devel/env.sh"/>\
  36.     <node machine="pr2-head" pkg="kinect2_bridge" type="kinect2_bridge" name="kinect2_bridge">\
  37.     \t<param name="publish_tf" value="true"/>\
  38.     </node>\
  39.     <node pkg="tf" type="static_transform_publisher" name="kinect2_transform" args="0 0 0 0 0 0 head_mount_kinect2_ir_optical_frame kinect2_link 300" />\
  40.     \
  41.     </launch>:i' /etc/ros/indigo/robot.launch
  42. fi
  43.  
  44. sudo sed -i 's:</launch>:\
  45.     <machine name="pr2-head" address="pr2-head" user="pr2-head" password="clearpath" env-loader="/home/pr2-head/kinect_ws/devel/env.sh"/>\
  46.     <node machine="pr2-head" pkg="kinect2_bridge" type="kinect2_bridge" name="kinect2_bridge">\
  47.     \t<param name="publish_tf" value="true"/>\
  48.     </node>\
  49.     <node pkg="tf" type="static_transform_publisher" name="kinect2_transform" args="0 0 0 0 0 0 head_mount_kinect2_ir_optical_frame kinect2_link 300" />\
  50.     \
  51.     </launch>:i' /etc/ros/robot.launch
  52.  
  53. echo 'kinect2_bridge appended to upstart'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top