Ejemplo n.º 1
0
#! /usr/bin/env python

import rospy
from std_msgs.msg import Float32, Bool, String
import threading
from geometry_msgs.msg import Twist

# Creates proxy node
rospy.init_node('proxy')

# For simulating the robot's server
if not rospy.get_param("~sim_server", False):
    from networktables import NetworkTables
else:
    from sim_server import SimServer
    NetworkTables = SimServer()

cond = threading.Condition()
notified = [False]


# Checks if connected to networktables
def connectionListener(connected, info):
    print(info, '; Connected=%s' % connected)
    with cond:
        notified[0] = True
        cond.notify()


if not rospy.get_param("~sim_server", False):
    server_ip = rospy.get_param('~server_ip', "10.06.24.2")