def __init__(self, robot_name='/lwr/left'):
    full_name = robot_name+'/torque_analysis'

    self.torque_p = yarp_tools.new_port(full_name + '/toRobot_torque', 'in', robot_name+'/robot/torque')

    self.torque_raw_p = yarp_tools.new_port(full_name + '/toRobot_torque_raw', 'in', robot_name+'/robot/torque_raw')
    self.pos_p = yarp_tools.new_port(full_name + '/toRobot_pos', 'in', robot_name+'/robot/pos')

    self.torque_stat = []
    self.torque_raw_stat = []
    self.pos_stat = Statistics()

    for i in range(7):
      self.torque_stat.append(Statistics()) 
      self.torque_raw_stat.append(Statistics()) 

    self.max_iter = 100
  def __init__(self, port_name='/jacobian', name='/density_viz'):
    """ get data from YARP bottle """

    self.callback = (lambda x: None)

    import yarp
    from yarp_tools import yarp_connect_blocking, new_port
    self.inport = new_port(name+'/data', 'in', port_name, 'udp')

    self._timer = wx.Timer()
    self._timer.Bind(wx.EVT_TIMER, self._on_timer)
    self._timer.Start(100)