Ejemplo n.º 1
0
 def __init__(self):
     rospy.init_node("tms_db_writer")
     rospy.on_shutdown(self.shutdown)
     db_host = 'localhost'
     db_port = 27017
     self.is_connected = db_util.check_connection(db_host, db_port);
     if not self.is_connected:
         raise Exception("Problem of connection")
     rospy.Subscriber("tms_db_data", TmsdbStamped, self.dbWriteCallback)
     self.writeInitData();
Ejemplo n.º 2
0
 def __init__(self):
     rospy.init_node("tms_db_writer")
     rospy.on_shutdown(self.shutdown)
     db_host = 'localhost'
     db_port = 27017
     self.is_connected = db_util.check_connection(db_host, db_port)
     if not self.is_connected:
         raise Exception("Problem of connection")
     rospy.Subscriber("tms_db_data", TmsdbStamped, self.dbWriteCallback)
     self.writeInitData()
Ejemplo n.º 3
0
    def __init__(self):
        rospy.init_node("tms_db_reader")
        rospy.on_shutdown(self.shutdown)

        db_host = 'localhost'
        db_port = 27017
        self.is_connected = db_util.check_connection(db_host, db_port);
        if not self.is_connected:
            raise Exception("Problem of connection")

        self.db_reader_srv = rospy.Service('tms_db_reader', TmsdbGetData, self.dbReaderSrvCallback)
Ejemplo n.º 4
0
    def __init__(self):
        rospy.init_node("tms_db_backuper")
        rospy.on_shutdown(self.shutdown)
        db_host = 'localhost'
        db_port = 27017
        self.is_connected = db_util.check_connection(db_host, db_port);
        if not self.is_connected:
            raise Exception("Problem of connection")

        rospy.Timer(rospy.Duration(60), self.manageDataCallback) #60sec
        rospy.Timer(rospy.Duration(12*60*60), self.removeForeverDataCallback) # 12hour
Ejemplo n.º 5
0
    def __init__(self):
        rospy.init_node("tms_db_backuper")
        rospy.on_shutdown(self.shutdown)
        db_host = 'localhost'
        db_port = 27017
        self.is_connected = db_util.check_connection(db_host, db_port)
        if not self.is_connected:
            raise Exception("Problem of connection")

        rospy.Timer(rospy.Duration(60), self.manageDataCallback)  # 60sec
        rospy.Timer(rospy.Duration(12 * 60 * 60),
                    self.removeForeverDataCallback)  # 12hour
Ejemplo n.º 6
0
    def __init__(self):
        rospy.init_node("tms_db_publisher")
        rospy.on_shutdown(self.shutdown)

        db_host = 'localhost'
        db_port = 27017
        self.is_connected = db_util.check_connection(db_host, db_port);
        if not self.is_connected:
            raise Exception("Problem of connection")

        self.data_pub = rospy.Publisher('tms_db_publisher', TmsdbStamped, queue_size=10)

        self.sendDbCurrentInformation()
Ejemplo n.º 7
0
def main():
    print "tms_db_timer_hl"
    rospy.init_node('tms_db_timer_hl')

    db_host = 'localhost'
    db_port = 27017
    is_connected = db_util.check_connection(db_host, db_port)
    if not is_connected:
        raise Exception("Problem of connection")

    service = rospy.Service("tms_db_timer_hl", tmsdb_time, TimerCallback)
    r = rospy.Rate(30)
    while not rospy.is_shutdown():
        r.sleep()
Ejemplo n.º 8
0
    def __init__(self):
        rospy.init_node("tms_db_replayer")
        rospy.on_shutdown(self.shutdown)

        db_host = 'localhost'
        db_port = 27017
        self.is_connected = db_util.check_connection(db_host, db_port)
        if not self.is_connected:
            raise Exception("Problem of connection")

        self.data_pub = rospy.Publisher('tms_db_replayer',
                                        TmsdbStamped,
                                        queue_size=10)

        self.sendDbHistoryInformation()
Ejemplo n.º 9
0
<<<<<<< HEAD

class TmsDbReader():

=======
class TmsDbReader():
>>>>>>> 51ecc3540900cfe208d8c2ca1ecaf2184d407ca7
    def __init__(self):
        rospy.init_node("tms_db_reader")
        rospy.on_shutdown(self.shutdown)

        db_host = 'localhost'
        db_port = 27017
<<<<<<< HEAD
        self.is_connected = db_util.check_connection(db_host, db_port)
=======
        self.is_connected = db_util.check_connection(db_host, db_port);
>>>>>>> 51ecc3540900cfe208d8c2ca1ecaf2184d407ca7
        if not self.is_connected:
            raise Exception("Problem of connection")

        self.db_reader_srv = rospy.Service('tms_db_reader', TmsdbGetData, self.dbReaderSrvCallback)

    def dbReaderSrvCallback(self, req):
        rospy.loginfo("Received the service call!")
        rospy.loginfo(req)
        temp_dbdata = Tmsdb()
        TmsdbGetData()
        result = False