Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
irstea-ros
labjack_driver
Commits
b218f4c7
Commit
b218f4c7
authored
Jul 27, 2018
by
Rousseau Vincent
Browse files
Close device
parent
9e468637
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
b218f4c7
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 ##
#############
...
...
README.md
View file @
b218f4c7
...
...
@@ -4,7 +4,9 @@
## exodriver
`git clone git://github.com/labjack/exodriver.git`
`cd exodriver/`
`sudo ./install.sh`
## LabJackPython
...
...
scripts/stream_node.py
View file @
b218f4c7
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment