def on_atlas_imu_batch(channel, data):
  global state
  m = atlas_raw_imu_batch_t.decode(data)

  num_new = 0
  verbose = False
  counter_for_microstrain=0
  for i in range(m.num_packets-1,-1,-1):
    if (m.raw_imu[i].packet_count > state.last_packet):
      if verbose: print "new ", state.last_packet, i, m.raw_imu[i].packet_count
      state.last_packet = m.raw_imu[i].packet_count
      num_new= num_new+1
      if (state.publishAt1000Hz):
        publishIMUPacket(m.raw_imu[i])
      if (state.printPacketAt1000Hz):
        printIMUPacket(m.raw_imu[i])
      if (state.publishMicrostrainPacketAt1000Hz):
        publishMicrostrainPacketAt1000Hz(m.raw_imu[i], m.utime, i)
      state.last_packet_utime = m.raw_imu[i].utime
    else:
      if verbose: print "old ", state.last_packet, i, m.raw_imu[i].packet_count


  if (state.publishMicrostrainPacketAt330Hz):
    publishMicrostrainPacketAt330Hz(m)

  if verbose: print num_new , "---"
Ejemplo n.º 2
0
def on_atlas_imu_batch(channel, data):
    global state
    m = atlas_raw_imu_batch_t.decode(data)

    num_new = 0
    verbose = False
    counter_for_microstrain = 0
    for i in range(m.num_packets - 1, -1, -1):
        if (m.raw_imu[i].packet_count > state.last_packet):
            if verbose:
                print "new ", state.last_packet, i, m.raw_imu[i].packet_count
            state.last_packet = m.raw_imu[i].packet_count
            num_new = num_new + 1
            if (state.publishAt1000Hz):
                publishIMUPacket(m.raw_imu[i])
            if (state.printPacketAt1000Hz):
                printIMUPacket(m.raw_imu[i])
            if (state.publishMicrostrainPacketAt1000Hz):
                publishMicrostrainPacketAt1000Hz(m.raw_imu[i], m.utime, i)
            state.last_packet_utime = m.raw_imu[i].utime
        else:
            if verbose:
                print "old ", state.last_packet, i, m.raw_imu[i].packet_count

    if (state.publishMicrostrainPacketAt330Hz):
        publishMicrostrainPacketAt330Hz(m)

    if verbose: print num_new, "---"
Ejemplo n.º 3
0
def on_imu_batch(channel, data):
    m = atlas_raw_imu_batch_t.decode(data)
    for i in range(0, m.num_packets - 1):
        print i, m.raw_imu[i].utime, " ", m.raw_imu[i].delta_rotation[0]
    print " ", m.utime
    print " "
Ejemplo n.º 4
0
def on_imu_batch(channel, data):
  m = atlas_raw_imu_batch_t.decode(data)
  for i in range(0,m.num_packets-1):
    print i , m.raw_imu[i].utime , " ", m.raw_imu[i].delta_rotation[0]
  print " ",m.utime
  print " "
Ejemplo n.º 5
0
def on_imu(channel, data):
    m = atlas_raw_imu_batch_t.decode(data)
    print "                        ", m.utime, " imu"
Ejemplo n.º 6
0
def on_imu_batch(channel, data):
  m = atlas_raw_imu_batch_t.decode(data)
  print "2, ",m.utime