From 3e393a12f0aea0302fefa4616dcd93c1b3bf6299 Mon Sep 17 00:00:00 2001 From: Erik Andresen Date: Fri, 2 Mar 2018 23:20:50 +0100 Subject: [PATCH] Add sensor_board to wild_thumper.launch --- .screen-startup | 1 - launch/wild_thumper.launch | 2 ++ scripts/sensor_board.py | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.screen-startup b/.screen-startup index 0884e2b..64314b7 100644 --- a/.screen-startup +++ b/.screen-startup @@ -6,6 +6,5 @@ source $HOME/.screenrc screen 0 zsh -is eval 'roscore' screen 1 zsh -is eval 'roslaunch --wait wild_thumper wild_thumper.launch' screen 2 zsh -is eval 'roslaunch --wait wild_thumper teleop.launch' -#screen 3 zsh -is eval 'rosrun wild_thumper sensor_board.py' #screen 3 zsh -is eval 'roslaunch --wait wild_thumper move_base.launch nomap:=true' select 2 diff --git a/launch/wild_thumper.launch b/launch/wild_thumper.launch index 927f41e..88b6658 100644 --- a/launch/wild_thumper.launch +++ b/launch/wild_thumper.launch @@ -54,4 +54,6 @@ + + diff --git a/scripts/sensor_board.py b/scripts/sensor_board.py index e431b57..c688ff9 100755 --- a/scripts/sensor_board.py +++ b/scripts/sensor_board.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: iso-8859-15 -*- +import sys import rospy import struct import prctl @@ -11,7 +12,7 @@ from pyshared.humidity import * from wild_thumper.msg import Sensor # Board warming offset -TEMP_ERROR = 0 # -5 # degree celsius +TEMP_ERROR = 0 # -2.5 # -5 # degree celsius PRESSURE_ERROR = -2.5 """ @@ -57,6 +58,11 @@ class SensorBoard: def __init__(self): rospy.init_node('sensor_board') prctl.set_name("sensor_board") + try: + get() + except: + print >>sys.stderr, "No sensor board, shutting down" + exit(1) self.pub = rospy.Publisher("sensors", Sensor, queue_size=16) self.run() -- 2.39.2