Add sensor_board to wild_thumper.launch
authorErik Andresen <erik@vontaene.de>
Fri, 2 Mar 2018 22:20:50 +0000 (23:20 +0100)
committerErik Andresen <erik@vontaene.de>
Fri, 2 Mar 2018 22:20:50 +0000 (23:20 +0100)
.screen-startup
launch/wild_thumper.launch
scripts/sensor_board.py

index 0884e2b..64314b7 100644 (file)
@@ -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
index 927f41e..88b6658 100644 (file)
@@ -54,4 +54,6 @@
        </node>
 
        <include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch"/>
+
+       <node pkg="wild_thumper" type="sensor_board.py" name="sensor_board" output="screen"/>
 </launch>
index e431b57..c688ff9 100755 (executable)
@@ -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()