Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use rqt_console Debug Log

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you how to use the rqt_console debug log, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.

1. Use rqt_console to debug logs

In ROS, we often use logging when debugging programs. Log,ROS provides rqt_console to output the information of a node.

We can also use rqt_logger_level to change the display level of the log (from low to high): Debug,Warn,Info,Error,Fatal.

For example, when we set the log level to Warn, then ROS will output the four types of Warn,Info,Error,Fatal logs, and the others are the same.

I remember that the log management of Android and ROS seems to be a bit similar.

Let's take a look at how to use the log system. Let's start the ROS log program and logger_level in two terminals:

# rosrun command is used to run node rosrun rqt_console rqt_console in a package

Then open the new terminal "Ctrl + Alt + T":

Rosrun rqt_logger_level rqt_logger_level

Then we can start the little turtle node and view the log messages output by the node. The default log level is Info:

# start a new terminal running node rosrun turtlesim turtlesim_node

Looking at the rqt_console program, you can see the XMagne y coordinate information output by the little tortoise node:

Let's change the log level of the next output. Click Reflesh in the lower left corner, select Loggers to change Info to Warn, and see if the new log will be output:

In order to get the little turtle node to generate Warn warning output, we use the rostopic command to send instructions to the little turtle node, causing the little turtle to hit the wall:

Rostopic pub / turtle1/cmd_vel geometry_msgs/Twist-r 1 -'{linear: {x: 2, y: 0. 0Magnez: 0. 0}, angular: {x: 0. 0L y: 0. 0LZ: 0}}'

You can see that the rqt_console program outputs the Warn log information:

The above is how to use the rqt_console debug log. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report