lcm::LCM lcm("file://log.txt?mode=w");
if (!lcm.good())
{
return 1;
}
Handler handler;
lcm.subscribe("EXAMPLE", &Handler::handleMessage, &handler);
if (0 == lcm.handle());
"file:///home/albert/path/to/logfile?speed=4"
--
You received this message because you are subscribed to the Google Groups "Lightweight Communications and Marshalling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lcm-users+...@googlegroups.com.
To post to this group, send email to lcm-...@googlegroups.com.
Visit this group at https://groups.google.com/group/lcm-users.
For more options, visit https://groups.google.com/d/optout.
lcm::LCM lcm("");
if (!lcm.good())
{
return 1;
}
Handler handler;
lcm.subscribe("EXAMPLE", &Handler::handleMessage, &handler);
while (0 == lcm.handle());
cout << "done..." << endl;
However, once I set the log path (local path or full file path), the function 'lcm.handle()' returns -1.
lcm::LCM lcm("file://d:/data/text/log.txt?mode=w");
Do I have to record the broadcast data by myself? I used to think tha the lcm instance will do tha for me if I set the file path of log.
Sorry to bother you again, but I'm really confused.
Best,
Kumius
I think there's a fundamental misunderstanding of the API here. When you create a new instance of lcm, you pass in a URL. That URL indicates the transport to be used for that instance of lcm.
The "file://" syntax is a way to get lcm to read or write from a log. So if you create a new instance of lcm with a "file://" URL in mode "w", you can "publish" events into the file. That instance of lcm will have no other traffic that it processes other than the messages you publish into the file. It seems like maybe you thought the instance would also have access to UDP lcm traffic? It would not unless initialized with a URL indicating it should set up a UDP transport.
What is the ultimate goal here? What exactly are you trying to do? Just log data coming over a transport? Take a look at lcm-logger if that's what you're trying to do. If not, feel free to provide a few more details.
Best,
Jonathan
--
You received this message because you are subscribed to the Google Groups "Lightweight Communications and Marshalling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lcm-users+...@googlegroups.com.
To post to this group, send email to lcm-...@googlegroups.com.
Visit this group at https://groups.google.com/group/lcm-users.
For more options, visit https://groups.google.com/d/optout.