]> defiant.homedns.org Git - ros_wild_thumper.git/commitdiff
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 0884e2b9be0493c086f6e5fd4449f7d74450db71..64314b7afe1771176a2350e1845cccf2a3834684 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 927f41ec4613b306fa8bbb08e259b2d06055ed68..88b66580db9cc20ecf3e4952c41f07156d588c16 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 e431b576a1569c34b4e3f178dd6b72e8fb91c2c8..c688ff9616c019d5f7b5c5c3b30cb1d8a54a6d3f 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()