check_librealsense_installed.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 """
00003 @file check_librealsense_installed.py
00004 """
00005 import os
00006 import sys
00007 import commands
00008 import unittest
00009 import rospy
00010 import rostest
00011 
00012 PKG = 'realsense_camera'
00013 NAME = 'check_librealsense_installed'
00014 LIB = 'librealsense.so'
00015 
00016 
00017 class CheckLibrealsenseInstalled(unittest.TestCase):
00018     """
00019     @class CheckLibrealsenseInstalled
00020     """
00021 
00022     def setUp(self):
00023         """
00024         @fn setUp
00025         @param self
00026         @return
00027         """
00028         self.success = False
00029 
00030     def test_basic_librealsense_installaton(self):
00031         """verify that librealsense library has been installed
00032         @fn test_basic_librealsense_installaton
00033         @param self
00034         @return
00035         """
00036         rospy.init_node(NAME, anonymous=True, log_level=rospy.INFO)
00037 
00038         ros_version = commands.getoutput("rosversion -d")
00039         if os.path.exists('/opt/ros/' + ros_version + '/lib/' + LIB) == True \
00040                 or os.path.exists('/opt/ros/' + ros_version +
00041                                   '/lib/x86_64-linux-gnu/' + LIB) == True:
00042             self.success = True
00043 
00044         self.assert_(self.success, str(self.success))
00045 
00046 if __name__ == '__main__':
00047     rostest.rosrun(PKG, NAME, CheckLibrealsenseInstalled, sys.argv)


realsense_camera
Author(s): Rajvi Jingar , Reagan Lopez , Matt Hansen , Mark Horn
autogenerated on Thu Jun 6 2019 21:15:58