Skip to content

Commit

Permalink
Find the appropriate extension
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jun 18, 2012
1 parent 63f3280 commit c150b3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion desktop_camera/src/desktop_camera
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ roslib.load_manifest("sensor_msgs")
import rospy
from sensor_msgs.msg import Image
import os
import platform

path = os.path.dirname(os.path.realpath(__file__))

Expand All @@ -49,7 +50,9 @@ class convert2rosimage_node:
self.width = rospy.get_param("width", 600);
self.height = rospy.get_param("height", 400);

self.myclib = cdll.LoadLibrary(substitution_args.resolve_args("$(find screen2im)")+ os.path.sep + "lib" + os.path.sep +"screen2im.dylib")
libname = substitution_args.resolve_args("$(find screen2im)")+ os.path.sep + "lib" + os.path.sep +"screen2im.";
ext = "dylib" if platform.system() == 'Darwin' else "so" if platform.system() == "Linux" else None
self.myclib = cdll.LoadLibrary(libname+ext)
self.data = (c_ubyte*(self.width*self.height*4))()
self.myclib.InitImage(self.left,self.top,self.width,self.height);
ret = self.myclib.ImageSetup()
Expand Down

0 comments on commit c150b3f

Please sign in to comment.