-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic polling for exogenous signals #570
Conversation
b1ea423
to
79b8b2c
Compare
79b8b2c
to
f0bae2f
Compare
…pRobotLoggerDevice - The remote control board will use udp as carrier - the readouts from the genericSensorClient (wrenches) are retrieved using udp - the multipleanalogsensorsclient data are colleced with fast_tcp - the logging of the robot cameras are disabled - The files are formatted
f0bae2f
to
0783aca
Compare
19ea37a
to
8958341
Compare
if (!allPortsConnected) | ||
{ | ||
// check for new messages | ||
yarp::profiler::NetworkProfiler::getPortsList(yarpPorts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need the full list of ports if you already know the name of the port to connect to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to check if the port exists to establish the connection. maybe we can directly do the connection if not connected. I don't know if we can improve the performances in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
bipedal-locomotion-framework/devices/YarpRobotLoggerDevice/src/YarpRobotLoggerDevice.cpp
Line 698 in 8958341
&& yarp::os::Network::exists(port.name)) |
you should be already querying the server for the existence of that port. So, I guessed that maybe asking the entire list of ports is not necessary. I think you can try to connect anyway, but I suspect in this case you will have errors printed in the terminal if the connection is not successful: https://github.com/robotology/yarp/blob/ea6ed180dd/src/libYARP_os/src/yarp/os/Network.cpp#L676
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok let me try to rephrase this part of the code 😃
bipedal-locomotion-framework/devices/YarpRobotLoggerDevice/src/YarpRobotLoggerDevice.cpp
Lines 687 to 718 in 8958341
if (!allPortsConnected) | |
{ | |
// check for new messages | |
yarp::profiler::NetworkProfiler::getPortsList(yarpPorts); | |
for (const auto& port : yarpPorts) | |
{ | |
// check if the port has not be already connected if exits, its resposive | |
auto vectorsCollectionSignal = m_vectorsCollectionSignals.find(port.name); | |
if (vectorsCollectionSignal != m_vectorsCollectionSignals.end()) | |
{ | |
if (!vectorsCollectionSignal->second.connected | |
&& yarp::os::Network::exists(port.name)) | |
{ | |
std::lock_guard<std::mutex> lock(vectorsCollectionSignal->second.mutex); | |
vectorsCollectionSignal->second.connected | |
= vectorsCollectionSignal->second.connect(); | |
} | |
} else | |
{ | |
// check if the port has not be already connected if exits, its resposive | |
auto vectorSignal = m_vectorSignals.find(port.name); | |
if (vectorSignal != m_vectorSignals.end()) | |
{ | |
if (!vectorSignal->second.connected && yarp::os::Network::exists(port.name)) | |
{ | |
std::lock_guard<std::mutex> lock(vectorSignal->second.mutex); | |
vectorSignal->second.connected = vectorSignal->second.connect(); | |
} | |
} | |
} | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0534224 should implement what you suggested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's pretty neat!
…oggerDevice::lookForExogenousSignals
Thanks to this PR the
YarpRobotLoggerDevice
will automatically connect to the exogenous ports. So no need to run it before the walking-controllerMoreover: