Skip to content
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

Log messages on robot connection and disconnection #107

Closed
urmahp opened this issue May 10, 2021 · 3 comments
Closed

Log messages on robot connection and disconnection #107

urmahp opened this issue May 10, 2021 · 3 comments

Comments

@urmahp
Copy link
Collaborator

urmahp commented May 10, 2021

When using the ROS2 driver with external-control URCap I would expect that the ROS2 driver terminal should output log messages once the robot is connected to the driver, currently this is not the case. Currently when the robot connects to the driver no log message is printed, meaning that it is actually not possible to see in the driver terminal that the robot has connected to the driver. If the robot disconnects it also not possible to see that the robot has disconnected in the terminal.

I would expect an output similar to below terminal output, this is the terminal output from the ROS driver, when the robot connects to the ROS driver.

[ INFO] [1620633422.400343214]: Robot requested program
[ INFO] [1620633422.400784839]: Sent program to robot
[ INFO] [1620633422.418806644]: Robot connected to reverse interface. Ready to receive control commands.

I think this is related to that only error and warning messages are currently printed from the client library in the ROS2 driver. Because I can see error and warning messages from the client library in the ROS2 drivers terminal output, but not any log messages above warning level.

@MGBla
Copy link
Contributor

MGBla commented May 21, 2021

Ok this is rather weird. According to the launch files the input of the client library should be forwarded to the screen. When adding std::out to the client library code the get printed as well but somehow it seems the UR logging is not captured correctly

@urmahp
Copy link
Collaborator Author

urmahp commented May 25, 2021

I think it is related to that currently the client library uses console bridge when logging messages, if console bridge is found in the system when building. See description in the client library. As default log level is set to warning in the console bridge.

A quick fix could be to change the log level to INFO, when using console bridge.

console_bridge::setLogLevel(console_bridge::CONSOLE_BRIDGE_LOG_INFO);

I think that the best solution is to use the loghandler interface to create a log handler to translate the log messages from the client library into ROS2 log messages. I will be happy to look into this, as I will most likely be implementing something similar in the ROS driver, when I have the time.

@destogl
Copy link
Contributor

destogl commented Jul 6, 2021

Closed in #126

@destogl destogl closed this as completed Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants