check_librealsense_installed.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 """
3 @file check_librealsense_installed.py
4 """
5 import os
6 import sys
7 import commands
8 import unittest
9 import rospy
10 import rostest
11 
12 PKG = 'realsense_camera'
13 NAME = 'check_librealsense_installed'
14 LIB = 'librealsense.so'
15 
16 
17 class CheckLibrealsenseInstalled(unittest.TestCase):
18  """
19  @class CheckLibrealsenseInstalled
20  """
21 
22  def setUp(self):
23  """
24  @fn setUp
25  @param self
26  @return
27  """
28  self.success = False
29 
31  """verify that librealsense library has been installed
32  @fn test_basic_librealsense_installaton
33  @param self
34  @return
35  """
36  rospy.init_node(NAME, anonymous=True, log_level=rospy.INFO)
37 
38  ros_version = commands.getoutput("rosversion -d")
39  if os.path.exists('/opt/ros/' + ros_version + '/lib/' + LIB) == True \
40  or os.path.exists('/opt/ros/' + ros_version +
41  '/lib/x86_64-linux-gnu/' + LIB) == True:
42  self.success = True
43 
44  self.assert_(self.success, str(self.success))
45 
46 if __name__ == '__main__':
47  rostest.rosrun(PKG, NAME, CheckLibrealsenseInstalled, sys.argv)


realsense_camera
Author(s): Rajvi Jingar , Reagan Lopez , Matt Hansen , Mark Horn
autogenerated on Mon Jun 10 2019 14:40:37