When executing sudo route -v, we get:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
link-local * 255.255.0.0 U 1 0 0 eth0
224.0.0.0 * 240.0.0.0 U 0 0 0 lo
The computer that sends the data has IP 169.254.145.79. The computer that fails to receive LCM data has IP 169.254.145.242. We have checked with tcmdump and wireshark that the RX is correctly getting the UDP packets; it's just that LCM is not processing them.
Despite not sending to the multicast address, sometimes LCM has managed receive and decode the data, without changing anything. It usually works when the RX is powered on before the TX. The TX has an integrated switch which is powered on at the same time as the TX.
However now we are trying the exact same code on another computer (exam same hardware and LCM installation) and it never works.
The following code is being tested:
class Handler
{
public:
~Handler() {}
void handleMessage(const lcm::ReceiveBuffer* rbuf,
const std::string& chan,
const VisualizationBus* msg)
{
std::cout << "Received and decoded data!" << std::endl;
}
};
int main()
{
lcm::LCM *lcm_ = new lcm::LCM("udpm://
239.255.76.67:
8010?ttl=1");
if (!lcm_->good())
{
std::cerr << "Failed to initialize LCM" << std::endl;
return -1;
}
Handler h;
lcm_->subscribe("VisualizationBus", &Handler::handleMessage, &h);
if(lcm_->handleTimeout(1000) > 0)
{
std::out << "OK" << std::endl;
}
else
{
std::cerr << "Did not receive LCM data" << std::endl;
}
return 0;
}
In red I noted the main change with respect to the example code. Hope this provides a clearer understanding of the situation!
Thanks a lot.