ros2foxy cannot import name 'Log' from 'rosgraph_msgs.msg'
时间: 2023-07-24 17:56:54 浏览: 800
mav_msgs.zip
This error occurs when the 'Log' message is not available in the 'graph_msgs' package. In ROS 2 Foxy the 'Log' message has been moved to the 'cl_interfaces' package.
To resolve this issue, you need to update your code to import the 'Log' message from the package. Here's an of the updated import statement:
python
from rcl_interfaces.msg import Log
`
Make sure you have 'rcl_interfaces' package in your workspace. You can it using the following command:
```
sudo apt-get install ros-foxy-rcl-interfaces-msgs
```
After updating the import statement and ensuring the package is installed, the error should be resolved.
阅读全文