In the end, I did manage to get it to work to communicate between the Raspberry Pi and a virtual machine running Ubuntu on my desktop PC. Unfortunately, I don't remember any details of how I did the build other than following the guide at the LCM project home page. (I never did get it working in Windows, but the virtual machine gave me a way to work around that problem.) I found the following note that I wrote up to remind myself how to set up a new LCM channel, though it doesn't explain how to set up LCM in the first place. If you continue to have trouble, I can try to dig deeper into my notes and see if I wrote anything else down that might be helpful.
Good luck with your project!
(Here's my reminder on setting up the channel:)
''' This document describes how to set up a new lcm channel.'''
1) Create a .lcm file with the following format:
package exlcm;
struct example_t
{
int64_t timestamp;
double position[3];
double orientation[4];
int32_t num_ranges;
int16_t ranges[num_ranges];
string name;
boolean enabled;
}
Save with .lcm extension in the /lcm folder. To reduce confusion, the
file name should match the struct name.
For more info, see:
https://lcm-proj.github.io/tut_lcmgen.html2) Generate Python bindings by opening a Linux terminal in the /lcm
folder and entering the command:
$lcm-gen -p example_t.lcm
-p designates python bindings will be generated. Use the file name
in place of 'example_t.lcm'
3) A python file has now been generated in the lcm/exlcm folder. Unless
this folder has been added to the python script import path, the file will
need to be copied to the location where the python packages are installed.
Substituting the correct directory path, from the Linux terminal enter:
$cp -R lcm/exlcm/example_t.py .local/lib/python3.8/site-packages/exlcm
4) The '__init__.py' file is automatically updated by lcm-gen. This file
will need to be copied to same exlcm folder as the script was copied to
in step 3, replacing the previous version of '__init__.py'.