openhumanoids / signal-scope

A live plotting tool for LCM message fields.
BSD 3-Clause "New" or "Revised" License
13 stars 17 forks source link

Unable to subscribe and plot to my custom LCM Message #39

Open zulfiqar-zaidi opened 5 years ago

zulfiqar-zaidi commented 5 years ago

I am trying to use lcm-signal-scope to plot values from my custom LCM message. My LCM message has the following definition:

`struct my_message { // The timestamp in microseconds. int64_t utime;

// position float q[23];

// velocity float v[22]; }`

The name of the channel is "MY_MESSAGE". I wrote the following python script to plot the signal:

addSignal('MY_MESSAGE', msg.utime, msg.q[0])

I used the following command to run the signal scope:

$ build/bin/signal-scope examples/example9.py

I get the following error: File "<string>", line 143, in decodeMessageFunction KeyError: 'R\xff\xd3\tO\x1a\x9b\x1f'

Any suggestions to overcome this issue will be highly appreciated.

patmarion commented 5 years ago

That error indicates that signal-scope wasn't able to determine the message type. Sorry, that error message isn't very helpful.

When signal-scope starts it will search for lcm messages types and print information about all the types that it finds. You'll see information printed in the terminal that looks like:

Loaded <count> lcm message types from: <package name>

You have to make sure:

  1. you compiled your message types for python
  2. the message type python module is installed in a standard location or somewhere in your PYTHONPATH