diff --git a/CMakeLists.txt b/CMakeLists.txt index 13d32ad68b2bafd56c0c1437fdcda00fc0b4fafa..a8a9a16b1be2c615b42ef46ae7685e76b0cdc599 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8.3) project(labjack_driver) -set(${PROJECT_NAME}_CATKIN_DEPS rospy std_msgs) +set(${PROJECT_NAME}_CATKIN_DEPS std_msgs) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) @@ -12,63 +12,11 @@ find_package(catkin REQUIRED COMPONENTS ${${PROJECT_NAME}_CATKIN_DEPS}) ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html # catkin_python_setup() -################################################ -## Declare ROS dynamic reconfigure parameters ## -################################################ -## To declare and build dynamic reconfigure parameters within this -## package, follow these steps: -## * In the file package.xml: -## * add a build_depend and a run_depend tag for "dynamic_reconfigure" -## * In this file (CMakeLists.txt): -## * add "dynamic_reconfigure" to -## find_package(catkin REQUIRED COMPONENTS ...) -## * uncomment the "generate_dynamic_reconfigure_options" section below -## and list every .cfg file to be processed - -## Generate dynamic reconfigure parameters in the 'cfg' folder -# generate_dynamic_reconfigure_options( -# cfg/DynReconf1.cfg -# cfg/DynReconf2.cfg -# ) - -################################### -## catkin specific configuration ## -################################### -## The catkin_package macro generates cmake config files for your package -## Declare things to be passed to dependent projects -## INCLUDE_DIRS: uncomment this if you package contains header files -## LIBRARIES: libraries you create in this project that dependent projects also need -## CATKIN_DEPENDS: catkin_packages dependent projects also need -## DEPENDS: system dependencies of this project that dependent projects also need catkin_package( -# INCLUDE_DIRS include -# LIBRARIES labjack_driver CATKIN_DEPENDS ${${PROJECT_NAME}_CATKIN_DEPS} -# DEPENDS system_lib -) - -########### -## Build ## -########### - -include_directories( - include ${catkin_INCLUDE_DIRS} ) -## Declare a C++ library -# add_library(labjack_driver -# src/${PROJECT_NAME}/labjack_driver.cpp -# ) - -## Declare a C++ executable -# add_executable(labjack_driver_node src/labjack_driver_node.cpp) - -## Specify libraries to link a library or executable target against -# target_link_libraries(labjack_driver_node -# ${catkin_LIBRARIES} -# ) - ############# ## Install ## ############# diff --git a/README.md b/README.md index 8e266839006659f3916e55770868507b8f810715..e16833fd954db0a1c32533b8cc3f8c58f9928519 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ ## exodriver `git clone git://github.com/labjack/exodriver.git` + `cd exodriver/` + `sudo ./install.sh` ## LabJackPython diff --git a/scripts/stream_node.py b/scripts/stream_node.py index e13482e807222625d8614e0ba9fb2b6f288bb0c5..9a86eb32e346b4558185ab3156622e963c4963b2 100755 --- a/scripts/stream_node.py +++ b/scripts/stream_node.py @@ -21,7 +21,7 @@ import ue9 class Labjack(object): def __init__(self, channel, resolution=16, scan_freq=150): - self.channel_name = "AIN"+channel + self.channel_name = "AIN"+str(channel) self.d = ue9.UE9() self.d.getCalibrationData() self.d.streamConfig( @@ -42,6 +42,9 @@ class Labjack(object): self.timer = rospy.Timer(rospy.Duration(timer_period), self.timer_callback) rospy.spin() + self.d.streamStop() + self.d.close() + def timer_callback(self, event): msg = Float32() # Conversion in milli volt for gain 1 @@ -52,11 +55,7 @@ class Labjack(object): self.pub.publish(msg) -def main(args=None): +if __name__ == '__main__': rospy.init_node('labjack', anonymous=True) - node = Labjack(1) - - -if __name__ == '__main__': - main() + node = Labjack(1) \ No newline at end of file