Check the space occupied by the log folder
The launch package is also responsible for checking how big the folder where the log is saved is. In the main function of the ros_comm-noet-develtoolsroslaunchsrcroslaunch_ init _.py file, there is the following statement.
You can tell what it does by looking at the name.
rlul.check_log_disk_usage()
Open rlutil.py in the same path again and find that it calls the get_disk_usage function in the rosclean package.
We found that the upper limit of comparison is directly written into this function: disk_usage > 1073741824. Of course, this is not good and should be changed to configurable.
The number 1073741824 is in bytes, which is exactly 1GB (102 4 3 1024^31024 3by).
If we want to change the upper limit of the log folder alarm, just change this value.
def check_log_disk_usage():
"""
Check size of log directory. If high, print warning to user
"""
try:
d = rospkg.get_log_dir()
roslaunch.core.printlog("Checking log directy for disk usage. This may take a while.nPress Ctrl-C to interrupt")
disk_usage = rosclean.get_disk_usage(d)
# warn if over a gig
if disk_usage > 1073741824:
roslaunch.core.printerrlog("WARNING: disk usage in log directory [%s] is over 1GB.nIt's mended that you use the 'rosclean' command."%d)
else:
roslaunch.core.printlog("Done checking log file disk usage. Usage is < 1GB.")
except:
pass
Let's dig deeper and find out how rosclean.get_disk_usage(d) is implemented.
The rosclean package is not included in ros_comm and needs to be installed separately.
After opening it, I found that this package is cross-platform and provides implementations for Windows and .
If it is a Windows system, use the os.path.getsize function to get the size of the file, and use the os.walk function to traverse all files, and the total is the size of the folder.
If it is a Linux system, use the du -sb command in Linux to get the size of the folder. Hey, not only do you have to learn Python, but you also have to be familiar with Linux. Is it easy?
The master node will obtain the URI address and number listed in the ROS_MASTER_URI variable set by the user (the default is the current local IP and port number 11311).
Previous article:Dependencies between ROS files
Next article:How is the node manager master started in ROS?
- Popular Resources
- Popular amplifiers
- Using IMU to enhance robot positioning: a fundamental technology for accurate navigation
- Researchers develop self-learning robot that can clean washbasins like humans
- Universal Robots launches UR AI Accelerator to inject new AI power into collaborative robots
- The first batch of national standards for embodied intelligence of humanoid robots were released: divided into 4 levels according to limb movement, upper limb operation, etc.
- New chapter in payload: Universal Robots’ new generation UR20 and UR30 have upgraded performance
- Humanoid robots drive the demand for frameless torque motors, and manufacturers are actively deploying
- MiR Launches New Fleet Management Software MiR Fleet Enterprise, Setting New Standards in Scalability and Cybersecurity for Autonomous Mobile Robots
- Nidec Drive Technology produces harmonic reducers for the first time in China, growing together with the Chinese robotics industry
- DC motor driver chip, low voltage, high current, single full-bridge driver - Ruimeng MS31211
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Network Control of ROS Melodic
- Let’s take a look at how this overvoltage protection circuit can be optimized?
- Inverter and Motor Control
- 【ST NUCLEO-H743ZI Review】(2) First experience with Ethernet testing
- Disassembling a common fire emergency light
- [NXP Rapid IoT Review] Mobile APP connection finally succeeded
- Buy an oscilloscope and get the essential analysis software 5-PWR for power engineers
- Analysis of common problems of touch switches
- Which power chip is BNOF?
- The 2019 TI Industrial Applications Seminar is coming, and the Ningbo special session is waiting for you to sign up!