示例#1
0
  def __init__(self, name = "MorselMOOS", configFile = "",
      serverHost = "localhost", serverPort = 9000, commTick = 10,
      quiet = True, **kargs):
    Node.__init__(self, name, **kargs)

    self.configFile = configFile
    self.serverHost = serverHost
    self.serverPort = serverPort
    self.commTick = commTick
    self.quiet = quiet

    self.client = CMOOSClient(name, self.configFile, self.serverHost,
      self.serverPort, self.commTick, self.quiet)
    self.client.reparentTo(self)

    framework.scheduler.addTask(name+"Receive", self.receive,
      1.0/self.client.getCommTick())
示例#2
0
    def __init__(self, client=None, platform=None, message="", **kargs):
        super(EuropaOdometry, self).__init__(**kargs)

        self.client = client
        self.platform = platform
        self.message = message

        self.publisher = CEuropaOdometry("CEuropaOdometry", self.client.client, self.message)
        self.publisher.reparentTo(self)

        self.origin = Node("Origin", parent=self)
        self.origin.clearTransform(self.platform)
示例#3
0
    def __init__(self,
                 name="MorselMOOS",
                 configFile="",
                 serverHost="localhost",
                 serverPort=9000,
                 commTick=10,
                 quiet=True,
                 **kargs):
        Node.__init__(self, name, **kargs)

        self.configFile = configFile
        self.serverHost = serverHost
        self.serverPort = serverPort
        self.commTick = commTick
        self.quiet = quiet

        self.client = CMOOSClient(name, self.configFile, self.serverHost,
                                  self.serverPort, self.commTick, self.quiet)
        self.client.reparentTo(self)

        framework.scheduler.addTask(name + "Receive", self.receive,
                                    1.0 / self.client.getCommTick())
class Europa6DOFOdometry(Output):
  def __init__(self, client = None, platform = None, message = "", **kargs):
    super(Europa6DOFOdometry, self).__init__(**kargs)

    self.client = client
    self.platform = platform
    self.message = message

    self.publisher = CEuropa6DOFOdometry("CEuropa6DOFOdometry",
      self.client.client, self.message)
    self.publisher.reparentTo(self)

    self.origin = Node("Origin", parent = self)
    self.origin.clearTransform(self.platform)

#-------------------------------------------------------------------------------

  def outputData(self, time):
    position = self.platform.getPosition(self.origin)
    orientation = self.platform.getOrientation(self.origin)

    self.publisher.publish(time, framework.scheduler.frameTime,
      panda.Vec3(*position), panda.Vec3(*orientation))
示例#5
0
  def __init__(self, name = None, log = None, masterUri = None,
      namespace = None, frequency = 10.0, **kargs):
    if not name:
      name = ros.name
    if not masterUri:
      masterUri = ros.masterUri
    if not log:
      log = ros.log
    if not namespace:
      namespace = ros.namespace
      
    Node.__init__(self, name, masterUri, **kargs)
    
    self.masterUri = masterUri
    self.log = log
    self.namespace = namespace;
    self.frequency = frequency;

    self.node = CROSNode(name, self.masterUri, self.log, self.namespace)
    self.node.reparentTo(self)

    framework.scheduler.addTask(name+"Receive", self.receive,
      1.0/self.frequency)