@小鱼
鱼哥,我看到底层控制代码有.bin文件,但是配置助手烧录是采用网址进行烧录的,有没有通过本地进行烧录的
f1742066-63f7-4b94-a980-e69530d6de4a-image.png
83529148-b21c-4288-a765-8b3799971eb7-image.png
16c344d7-c15c-4be3-81cf-7d421667cf7a-image.png
编译日志如图,用的是humble,之前重装过一次humble
尝试 按照 Ubuntu22.04 CH340系列串口芯片无法识别终极问题解决方案 | 鱼香ROS (fishros.org.cn) 步骤分别禁用/卸载 占用项,然后重启Ubuntu,还是不行。Warning! Please install 99-platformio-udev.rules.
More details: https://docs.platformio.org/en/latest/core/installation/udev-rules.html
Auto-detected: /dev/ttyS0
Uploading .pio/build/featheresp32/firmware.bin
esptool.py v4.5.1
Serial port /dev/ttyS0
A fatal error occurred: Could not open /dev/ttyS0, the port doesn't exist
*** [upload] Error 2
=========================================================================== [FAILED] Took 5.21 seconds ===========================================================================
The terminal process "platformio 'run', '--target', 'upload'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
[标题: No module named 'example_ros2_interfaces']
问题描述:
运行时无法找到example_ros2_interfaces此模块
具体细节和上下文:
使用以下命令:
cat@lubancat:~/ros/d2lros2/chapt3/chapt3_ws$ ros2 run example_interfaces_rclpy example_interfaces_robot_02
报错内容:
cat@lubancat:~/ros/d2lros2/chapt3/chapt3_ws$ ros2 run example_interfaces_rclpy example_interfaces_robot_02
Traceback (most recent call last):
File "/home/cat/ros/d2lros2/chapt3/chapt3_ws/install/example_interfaces_rclpy/lib/example_interfaces_rclpy/example_interfaces_robot_02", line 33, in <module>
sys.exit(load_entry_point('example-interfaces-rclpy==0.0.0', 'console_scripts', 'example_interfaces_robot_02')())
File "/home/cat/ros/d2lros2/chapt3/chapt3_ws/install/example_interfaces_rclpy/lib/example_interfaces_rclpy/example_interfaces_robot_02", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/init.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/cat/ros/d2lros2/chapt3/chapt3_ws/install/example_interfaces_rclpy/lib/python3.10/site-packages/example_interfaces_rclpy/example_interfaces_robot_02.py", line 4, in <module>
from example_ros2_interfaces.msg import RobotStatus
ModuleNotFoundError: No module named 'example_ros2_interfaces'
[ros2run]: Process exited with failure 1
问题补充:
使用的是python3.10
系统是Ubuntu 22.04
使用如下命令安装yolo
sudo pip3 install yolov5 -i https://pypi.tuna.tsinghua.edu.cn/simple下载教程中的图片和yolov5.pt,输入命令
yolov5 detect --source zidane.jpg --weights yolov5n.pt报错
/usr/lib/python3/dist-packages/requests/__init__.py:87: RequestsDependencyWarning: urllib3 (2.2.1) or chardet (4.0.0) doesn't match a supported version! warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported " YOLOv5 🚀 2024-5-12 Python-3.10.12 torch-2.3.0+cu121 CPU Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 198, in _new_conn sock = connection.create_connection( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/connection.py", line 85, in create_connection raise err File "/usr/local/lib/python3.10/dist-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachable The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 793, in urlopen response = self._make_request( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 491, in _make_request raise new_e File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 467, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 1099, in _validate_conn conn.connect() File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 616, in connect self.sock = sock = self._new_conn() File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 213, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7640e824e0e0>: Failed to establish a new connection: [Errno 101] Network is unreachable The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 847, in urlopen retries = retries.increment( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/yolov5n.pt/tree/main?recursive=True&expand=False (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7640e824e0e0>: Failed to establish a new connection: [Errno 101] Network is unreachable')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/bin/yolov5", line 8, in <module> sys.exit(app()) File "/usr/local/lib/python3.10/dist-packages/yolov5/cli.py", line 18, in app fire.Fire( File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 143, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 477, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 693, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/yolov5/detect.py", line 107, in run model = DetectMultiBackend(weights, device=device, dnn=dnn, data=data, fp16=half) File "/usr/local/lib/python3.10/dist-packages/yolov5/models/common.py", line 338, in __init__ result = attempt_download_from_hub(w, hf_token=hf_token) File "/usr/local/lib/python3.10/dist-packages/yolov5/utils/downloads.py", line 154, in attempt_download_from_hub repo_files = list_repo_files(repo_id=repo_id, repo_type='model', token=hf_token) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py", line 2677, in list_repo_files return [ File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py", line 2677, in <listcomp> return [ File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/hf_api.py", line 2814, in list_repo_tree for path_info in paginate(path=tree_url, headers=headers, params={"recursive": recursive, "expand": expand}): File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_pagination.py", line 36, in paginate r = session.get(path, params=params, headers=headers) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 557, in get return self.request('GET', url, **kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 544, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 657, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_http.py", line 66, in send return super().send(request, *args, **kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/yolov5n.pt/tree/main?recursive=True&expand=False (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7640e824e0e0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"), '(Request ID: e07a3350-96b3-4819-bd1e-6285ac2d3ba0)')构建功能包错误日志:
tingbo@tingbo-i7:~/chapt10/chapt10_ws$ colcon build Starting >>> learn_qos_cpp Starting >>> learn_qos_py --- stderr: learn_qos_cpp CMake Error at /opt/ros/humble/share/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake:42 (message): ament_target_dependencies() the first argument must be a valid target name Call Stack (most recent call first): CMakeLists.txt:25 (ament_target_dependencies) gmake: *** [Makefile:267:cmake_check_build_system] 错误 1 --- Failed <<< learn_qos_cpp [2.66s, exited with code 2] Aborted <<< learn_qos_py [3.33s] Summary: 0 packages finished [3.99s] 1 package failed: learn_qos_cpp 1 package aborted: learn_qos_py 1 package had stderr output: learn_qos_cppcmakelists.txt代码:
cmake_minimum_required(VERSION 3.8) project(learn_qos_cpp) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() # find dependencies find_package(ament_cmake REQUIRED) find_package(nav_msgs REQUIRED) find_package(rclcpp REQUIRED) if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) # the following line skips the linter which checks for copyrights # comment the line when a copyright and license is added to all source files set(ament_cmake_copyright_FOUND TRUE) # the following line skips cpplint (only works in a git repo) # comment the line when this package is in a git repo and when # a copyright and license is added to all source files set(ament_cmake_cpplint_FOUND TRUE) ament_lint_auto_find_test_dependencies() endif() add_executable(learn_qos_cpp src/reliability_test.cpp) ament_target_dependencies(reliability_test rclcpp nav_msgs) install(DIRECTORY reliability_test DESTINATION share/${PROJECT_NAME}) ament_package()reliability_test代码:
#include <nav_msgs/msg/odometry.hpp> #include <rclcpp/rclcpp.hpp> class OdomPublsherSubscriber : public rclcpp::Node { public: OdomPublsherSubscriber() : Node("odom_publisher_subscriber") { // 创建发布者并设置 qos为sensor odom_publisher_ = this->create_publisher<nav_msgs::msg::Odometry>( "odom", rclcpp::SensorDataQoS()); //创建订阅者(默认Qos配置)队列设深度设置为5 odom_subscription_ = this->create_subscription<nav_msgs::msg::Odometry>( "odom", rclcpp::SensorDataQoS(), [this] (const nav_msgs::msg::Odometry::SharedPtr msg) { (void)msg; RCLCPP_INFO(this->get_logger(), "收到里程计消息"); }); //创建一个1秒的定时器,并指定回调函数 timer_ = this->create_wall_timer(std::chrono::seconds(1), [this](){ odom_publisher_->publish(nav_msgs::msg::Odometry()); }); } private: rclcpp::Publisher<nav_msgs::msg::Odometry>::SharedPtr odom_publisher_; rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr odom_subscription_; rclcpp::TimerBase::SharedPtr timer_; }; int main(int argc, char *argv[]) { rclcpp::init(argc, argv); auto odom_node = std::make_shared<OdomPublsherSubscriber>(); rclcpp::spin(odom_node); rclcpp::shutdown(); return 0; }我是一个初学者 在我复现别人的代码时出现了下示错误
3971f2f5-114a-437c-ab7d-1fe5e512b6a5-图片.png
在CMakeLists.txt文件中我已经进行了以下配置
24d2200c-0e37-4b03-8f6b-5752cdf60ee7-图片.png
0e0dae40-5048-450b-9fa7-4456370b71cf-图片.png
并且在c_cpp_properties.json进行了如下配置 但还是报错找不到ros.h文件
8f936538-7582-4aba-a5ee-4a53ee60101c-图片.png
对我的包进行catkin build编译时没有出现报错
希望能得到一些建议来改正这个错误 ,谢谢!
屏幕截图 2024-05-12 112535.png
换源
e212ca68-c116-4571-9b3a-3470f82dd33c-image.png 回复: 如何在qt中配置ros2的环境
截图 2024-05-10 22-54-59.png 截图 2024-05-10 22-55-06.png 截图 2024-05-10 22-55-20.png
截图 2024-05-10 22-56-05.png
launch无法运行
雷达驱动版蓝色灯常亮
在配置模式下
用的是windows烧录助手
无法配置WIFI烧录
36446276-b667-4450-865d-c41b05d8cba0-Screenshot from 2024-05-09 11-08-28.png
机械臂是一个4自由度的机械臂,使用代码进行设置目标位置的方法进行规划,报错如图。通过google 把默认的KDL更改成trace_ik后一样报错。尝试把4自由度的机械增加两个可微量转动的虚拟关节,凑成6自由度也失败了。大佬们有遇到过同样的错误吗?求指教。感谢。
我在moveit2的setup assistant 中导入了自己机械臂的urdf,生成的一系列文件中的demo.launch.py是这样的c1e47c0c-471b-432d-a155-9e31a2397266-image.png
但是launch的时候却报错
e16beac7-873b-43a0-b778-af02a2bae105-image.png 请问有大佬可以教一下怎么解决吗
chen@chen-virtual-machine:~$ wget http://fishros.com/install -O fishros && . fishros
--2024-05-10 15:12:02-- http://fishros.com/install
正在连接 10.22.21.249:7890... 失败:拒绝连接。
11f4028e-e015-4bb9-9bd1-c2a15bf289a8-fe259ba6e9ca5bbcdaba2b2b9b0f362.png 1760abf4-9dc0-423c-97b8-35d3e837a8f4-95e146204b65b2259338b3e6c3e4fb9.png 已经尝试以上方法不能解决
1c88a854-2f62-4c30-9102-0302a321ddaf-image.png
按github上的命令安装livox_ros_driver时一切正常(已经安装了ROS(melodic)和Livox-SDK)再执行catkin_make时报错
在96%进度时出现一大堆其他的东西最后显示
livox_ros_driver/CMakeFiles/livox_ros_driver_node.dir/build.make:230: recipe for target 'livox_ros_driver/CMakeFiles/livox_ros_driver_node.dir/livox_ros_driver/livox_ros_driver.cpp.o' failed
make[2]: *** [livox_ros_driver/CMakeFiles/livox_ros_driver_node.dir/livox_ros_driver/livox_ros_driver.cpp.o] Error 1
make[2]: *** 正在等待未完成的任务....
livox_ros_driver/CMakeFiles/livox_ros_driver_node.dir/build.make:206: recipe for target 'livox_ros_driver/CMakeFiles/livox_ros_driver_node.dir/livox_ros_driver/lddc.cpp.o' failed
make[2]: *** [livox_ros_driver/CMakeFiles/livox_ros_driver_node.dir/livox_ros_driver/lddc.cpp.o] Error 1
CMakeFiles/Makefile2:1012: recipe for target 'livox_ros_driver/CMakeFiles/livox_ros_driver_node.dir/all' failed
make[1]: *** [livox_ros_driver/CMakeFiles/livox_ros_driver_node.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j16 -l16" failed
四驱板使用一键配置后发生4号轮一直旋转,且microros无法读取到串口
[1715257077.700502] info | TermiosAgentLinux.cpp | init | Serial port not found. | device: /dev/ttyUSB0, error 2, waiting for connection... ^C[ros2run]: Interrupt但是串口文件确实存在
ls /dev/ttyUSB* /dev/ttyUSB0而且后续我烧录自己的代码也出现microROS无法使用的问题。且不同设备上之前好用的microROS都不行
sudo docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:$ROS_DISTRO serial --dev /dev/ttyUSB0 -v6 -b 921600 [1715259674.486368] info | TermiosAgentLinux.cpp | init | running... | fd: 3 [1715259674.486496] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 6换成教学中的那个microROS命令,则什么都不输出
又换成我的代码,教学中的microROS命令可以github上的又不行了。
好像破案了,我的代码可以是因为我的默认为串口模式,而一键配置默认为udb,教学中有加sudo,而github上的没有。而且一键配置从普通模式切成4驱模式有bug,会造成4号轮一直旋转