Example #1
0
 def callback(self, cmd_msg):
     pos = cmd_msg.data
     if (pos > 100):
         pos = 100
     elif (pos < 0):
         pos = 0
     Setter.callback(self, pos)
Example #2
0
    def run(self, rospy, hostname):
        # initialize the connection and create subscribers
        Setter.init(self,(1206,1207))

        rospy.Subscriber('/'+hostname+'/cmd_vel', Twist, self.callback)
        rospy.Subscriber('/'+hostname+'/cmd_vel_left', Float64, self.set_left)
        rospy.Subscriber('/'+hostname+'/cmd_vel_right', Float64, self.set_right)
Example #3
0
 def callback(self, cmd_msg):
     # callback function - extends the setter.callback functionality
     # formats data to be passed to mindprobe
     pos = cmd_msg.data
     if (pos > 100):
         pos = 100
     elif (pos < 0):
         pos = 0
     Setter.callback(self, pos)
Example #4
0
    def handleData(self, data: bytearray):
        text = data[1:len(data) - 5].decode(encoding="utf-8", errors='ignore')
        splitted = text.split("|", )
        name = True
        currName = ""
        for i in reversed(range(self.settingsContentWidget.layout().count())
                          ):  #clear layout from previous settings
            self.settingsContentWidget.layout().itemAt(i).widget().setParent(
                None)

        for item in splitted:
            if (len(item) > 0):
                if (name):
                    name = False
                    currName = item
                else:
                    name = True
                    setter = Setter(currName, item, None)
                    self.settingsContentWidget.layout().addWidget(setter)
                    setter.changeAvailable.connect(self.requestChange)
        '''if(len(data)<6): return
Example #5
0
# This is the code that visits the warehouse.
import sys

import Pyro4
import Pyro4.util
from setter import Setter

sys.excepthook = Pyro4.util.excepthook

times = Pyro4.Proxy("PYRONAME:example.times")
setter = Setter("myset")
setter.set(times)
Example #6
0
 def set_right(self,cmd_msg):
     # callback to set the right wheel
     vel = cmd_msg.data
     Setter.callback(self,[0,vel])
Example #7
0
 def set_left(self,cmd_msg):
     # callback to set the left wheel
     vel = cmd_msg.data
     Setter.callback(self,[vel,0])
Example #8
0
 def callback(self, cmd_msg):
     # differential drive callback. 
     vel = twist_to_vel(cmd_msg)
     Setter.callback(self,vel)
Example #9
0
 def set_right(self, cmd_msg):
     vel = cmd_msg.data
     Setter.callback(self, [0, vel])
Example #10
0
 def set_left(self, cmd_msg):
     vel = cmd_msg.data
     Setter.callback(self, [vel, 0])
Example #11
0
 def callback(self, cmd_msg):
     vel = twist_to_vel(cmd_msg)
     Setter.callback(self, vel)
Example #12
0
 def init(self):
     Setter.init(self, (1206, 1207))
Example #13
0
 def run(self, rospy, hostname):
     # intializes the mp connection and runs a subscriber for setting the arm position.
     Setter.init(self, 1077)
     rospy.Subscriber('/' + hostname + '/set_arm_pos', Float32,
                      self.callback)
Example #14
0
 def init(self):
     Setter.init(self, 1080)
Example #15
0
# This is the code that visits the warehouse.
import sys

import Pyro4
import Pyro4.util
from setter import Setter


sys.excepthook = Pyro4.util.excepthook

times = Pyro4.Proxy("PYRONAME:example.times")
setter = Setter("myset")
setter.set(times)