按照代码检查多,但是图形只出现一半。8c85c536-8137-4f7a-8628-0c761a26dac7-5406ce9cb6beaf2c856d8bc1493085e.png
按照代码检查多,但是图形只出现一半。8c85c536-8137-4f7a-8628-0c761a26dac7-5406ce9cb6beaf2c856d8bc1493085e.png
89cacf8c-4a9b-4de4-9202-cadc789c1aff-image.png 在ros2中我想通过rosbridge传输imu节点信息,但在运行节点时报错,问了ai是时间戳转换时类型断言失败,是 ROS2 消息类型版本不兼容导致,之后更新了ros-jazzy-rosidl-generator-py,还是会出现同样的错误
报错:[INFO] [launch]: All log files can be found below /home/shang/.ros/log/2025-11-16-17-32-40-975825-shang-VirtualBox-10910
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught multiple exceptions when trying to load file of format [py]:
已经source了环境依旧报错
这个是代码:
mport launch
import launch_ros
from ament_index_python.package import get_package_share_directory
def generate_launch_description():
#动作一,启动其他launch
mutisim_launch_path = [get_package_share_directory('turtlesim'),'/launch/','multisim.launch.py']
#包名,文件夹名,文件名
action_include_launch = launch.actions.IncludeLaunchDescription(
launch.launch_description_sources.PythonLaunchDescriptionSource(
mutisim_launch_path
)
)
//patrol_client.cpp
#include "rclcpp/rclcpp.hpp"
#include "chapt4_interfaces/srv/patrol.hpp"
#include <chrono>
#include <ctime>
#include "rcl_interfaces/msg/parameter.hpp"
#include "rcl_interfaces/msg/parameter_value.hpp"
#include "rcl_interfaces/msg/parameter_type.hpp"
#include "rcl_interfaces/srv/set_parameters.hpp"
using SetP = rcl_interfaces::srv::SetParameters;
using namespace std::chrono_literals;//可以使用10s,100ms表示时间
using Patrol = chapt4_interfaces::srv::Patrol;
class PatrolClientNode: public rclcpp::Node //定义类,继承自rclcpp::Node
{
public:
PatrolClientNode():Node("turtle_controller")
{
srand(time(NULL));//初始化随机数种子
private://私有成员变量 声明定时器和客户端
rclcpp::TimerBase::SharedPtr timer_;
rclcpp::Client<Patrol>::SharedPtr patrol_client_;
};
int main(int argc,char* argv[])//俩命令行参数
{
rclcpp::init(argc,argv);
auto node = std::make_shared<PatrolClientNode>();//创建节点turtle-circle,创建TCN类的共享指针
node->update_server_param_k(4.0);
rclcpp::spin(node);//启动节点循环
rclcpp::shutdown();//关闭环境
return 0;
}
//turtle_control.cpp
#include "rclcpp/rclcpp.hpp"
#include "geometry_msgs/msg/twist.hpp"
#include "turtlesim/msg/pose.hpp"
#include "chapt4_interfaces/srv/patrol.hpp"
#include "rcl_interfaces/msg/set_parameters_result.hpp"
#include "rclcpp/parameter_client.hpp"
#include "rclcpp/parameter.hpp"
using Patrol = chapt4_interfaces::srv::Patrol;
using SetParametersResult = rcl_interfaces::msg::SetParametersResult;
class TurtleController: public rclcpp::Node //定义类,继承自rclcpp::Node
{
private:
OnSetParametersCallbackHandle::SharedPtr parameter_callback_handle_;
rclcpp::Service<Patrol>::SharedPtr patrol_server_;
rclcpp::Publisher<geometry_msgs::msg::Twist>::SharedPtr publisher_; //发布者的智能指针
rclcpp::Subscriptionturtlesim::msg::Pose::SharedPtr subscriber_; //订阅者的智能共享指针
double target_x_{1.0};
double target_y_{1.0};
double k_{1.0};//比例系数
double max_speed_{3.0};
public:
TurtleController() : Node("turtle_controller")
{
this->declare_parameter("k",1.0);
this->declare_parameter("max_speed",1.0);
this->get_parameter("k",k_);
this->get_parameter("max_speed",max_speed_);
this->set_parameter(rclcpp::Parameter("k",2.0));
private:
void on_pose_received_(const turtlesim::msg::Pose::SharedPtr pose){
//1.获取当前位置
auto current_x = pose->x;
auto current_y = pose->y;
RCLCPP_INFO(get_logger(),"当前:x=%f,y=%f",current_x,current_y);
};
int main(int argc,char* argv[])//俩命令行参数
{
rclcpp::init(argc,argv);
auto node = std::make_shared<TurtleController>();//创建节点turtle-circle,创建TCN类的共享指针
rclcpp::spin(node);//启动节点循环
rclcpp::shutdown();//关闭环境
return 0;
}
如何在保证模型大小的情况下,让机器人位于坐标原点
7a97ee91-ec22-47d7-b47c-0f05d53fae82-屏幕截图 2025-11-15 144430.png 0445fd86-70cc-46e7-99b1-744f4e7e8bb6-屏幕截图 2025-11-15 144417.png cbceb2f9-9366-4d23-89bf-a4ada0f576be-屏幕截图 2025-11-15 144411.png a4d6d4d8-3228-483e-8336-8ac392b180a9-屏幕截图 2025-11-15 144444.png
手柄已通过usbipd共享给wsl,wsl中jstest能读取手柄信息,就是ros无法读到,/joy已发布,但没有任何消息
截图 2025-11-12 10-45-02.png ``
Run CMD Task:[wget https://fishros.org.cn/forum/topic/1733 -O /tmp/t1733 -q --timeout 10 && rm -rf /tmp/t1733]
[-][0.00s] CMD Result:code:5
这个是什么问题导致的
=================3.下载镜像(该步骤因网络原因会慢一些,若失败请重试)==================
Run CMD Task:[sudo docker pull fishros2/ros:melodic-desktop-full ]
Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp 127.0.0.1:80: connect: connection refused
Run CMD Task:[sudo docker pull fishros2/ros:melodic-desktop-full ]
Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp 127.0.0.1:80: connect: connection refused
Run CMD Task:[sudo docker pull fishros2/ros:melodic-desktop-full ]
Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp 127.0.0.1:80: connect: connection refused
下载的时候都是错误
Traceback (most recent call last):
File "/tmp/fishinstall/tools/translation/translator.py", line 60, in loadTranslationFile
self._translations = importlib.import_module(_import_command).translations
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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tools.translation.assets.zh_CN'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/fishinstall/install.py", line 138, in <module>
main()
File "/tmp/fishinstall/install.py", line 68, in main
importlib.import_module("tools.translation.translator").Linguist()
File "/tmp/fishinstall/tools/translation/translator.py", line 52, in init
self.loadTranslationFile()
File "/tmp/fishinstall/tools/translation/translator.py", line 64, in loadTranslationFile
self._translations = importlib.import_module(_import_command).translations
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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tools.translation.assets.en_US'
d05fb751-0d03-4195-89c3-b09a5dd44439-image.png
为什么 输入python3 hello.py之后不输出hello(代码与博主一样)
ba85cb56-36aa-4317-a17d-f0ae31466d37-图片.png
d933c5311a877e87357f26a536827e99.png
我自己建模了一个阿克曼小车,一开始都没什么问题,在urdf上面加入阿克曼插件的时候,就出现问题了,但是终端并没有显示报错,而且加载插件成功了,当我把阿克曼插件去掉的时候,小车就又变好了,轮子也能正常显示在底盘的4个角,请问这是怎么回事```
<?xml version="1.0" ?>
<robot name="fishbot">
</robot>
2025-11-08 09:20:29 (185 MB/s) - ‘fishros’ saved [960/960]
--2025-11-08 09:20:29-- http://fishros.com/install
Resolving fishros.com (fishros.com)... 47.119.165.169
Connecting to fishros.com (fishros.com)|47.119.165.169|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://fishros.com/install/ [following]
--2025-11-08 09:20:29-- http://fishros.com/install/
Reusing existing connection to fishros.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 960 [application/octet-stream]
Saving to: ‘fishros’
fishros 100%[===========================================>] 960 --.-KB/s in 0s
2025-11-08 09:20:29 (141 MB/s) - ‘fishros’ saved [960/960]
--2025-11-08 09:20:29-- http://fishros.com/install
Resolving fishros.com (fishros.com)... 47.119.165.169
Connecting to fishros.com (fishros.com)|47.119.165.169|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://fishros.com/install/ [following]
--2025-11-08 09:20:29-- http://fishros.com/install/
Reusing existing connection to fishros.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 960 [application/octet-stream]
Saving to: ‘fishros’
fishros 100%[===========================================>] 960 --.-KB/s in 0s
2025-11-08 09:20:30 (183 MB/s) - ‘fishros’ saved [960/960]
--2025-11-08 09:20:30-- http://fishros.com/install
Resolving fishros.com (fishros.com)... 47.119.165.169
Connecting to fishros.com (fishros.com)|47.119.165.169|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://fishros.com/install/ [following]
--2025-11-08 09:20:30-- http://fishros.com/install/
Reusing existing connection to fishros.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 960 [application/octet-stream]
Saving to: ‘fishros’
fishros 100%[===========================================>] 960 --.-KB/s in 0s
2025-11-08 09:20:30 (87.3 MB/s) - ‘fishros’ saved [960/960]
--2025-11-08 09:20:30-- http://fishros.com/install
Resolving fishros.com (fishros.com)... 47.119.165.169
Connecting to fishros.com (fishros.com)|47.119.165.169|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://fishros.com/install/ [following]
--2025-11-08 09:20:30-- http://fishros.com/install/
Reusing existing connection to fishros.com:80.
HTTP request sent, awaiting response... ^C
root@WP:/tmp/fish#
背景:在统信UOS系统上安装ROS 2
行动:
执行wget http://fishros.com/install -O fishros之后,. fishros,按“1”出现问题
Traceback (most recent call last):
File "/tmp/fishinstall/install.py", line 138, in <module>
main()
File "/tmp/fishinstall/install.py", line 123, in main
run_tool_file(tools[code]['tool'].replace("/","."))
File "/tmp/fishinstall/tools/base.py", line 1550, in run_tool_file
if tool.run()==False: return False
File "/tmp/fishinstall/tools/tool_install_ros.py", line 457, in run
self.install_ros()
File "/tmp/fishinstall/tools/tool_install_ros.py", line 442, in install_ros
if not self.support_install(): return False
File "/tmp/fishinstall/tools/tool_install_ros.py", line 342, in support_install
if (osversion.get_codename() not in ros_dist_dic.keys()) and (osversion.get_codename() not in ros2_dist_dic.keys()):
File "/tmp/fishinstall/tools/base.py", line 735, in get_codename
self.detect_os()
File "/tmp/fishinstall/tools/base.py", line 695, in detect_os
raise OsNotDetected("Could not detect OS, tried %s" % attempted)
tools.base.GetOsVersion.<locals>.OsNotDetected: Could not detect OS, tried ['zorin', 'windows', 'nixos', 'clearlinux', 'ubuntu', 'slackware', 'rocky', 'rhel', 'qnx', 'pop', 'osx', 'sailfishos', 'tizen', 'oracle', 'opensuse', 'opensuse', 'opensuse', 'opensuse', 'opensuse', 'openembedded', 'neon', 'mx', 'mint', 'linaro', 'gentoo', 'funtoo', 'freebsd', 'fedora', 'elementary', 'elementary', 'debian', 'cygwin', 'euleros', 'centos', 'manjaro', 'buildroot', 'arch', 'amazon', 'alpine', 'almalinux']
分析:在系统程序判断中不支持uos系统。不过uos系统底层也是基于debian的吧,所以我认为代码应该优化一下,谢谢。
在7.4.3 调用接口进行单点导航中,启动仿真→启动导航→初始化位姿→设置导航,导航整体没有问题,无论是距离还是位姿也都符合nav2_params中的配置,但是在导航结束,节点退出后,不输出SUCCEEDED ,一直是UNKNOW。106a0afa-8709-4940-8696-9b909f2c446c-image.png f3153815-a73e-4d67-8698-c654f5c763e2-image.png
f625a466-96fe-4d2e-9765-22c14620b915.png
不知道这个图片发不发得出来,就是今天看文档发现一个比较严重的翻译错误(指令行也有错),然后就点击那个校准想去提交一体一条修改意见,填完之后发现提交不了
SLam导航中,对于在ROS2_Humble中的时间不同步的问题导致的rviz2中的TF和机器人模型出现警号,并且rviz2中机器人模型一闪一闪,控制台报错如图所示:4f963bed-1e89-42ba-9220-a640eb61cb78-image.png
我是用的是STL模型,在导航的过程中,会出现漂移,瞬间移动,但是把虚拟机界面缩小就会好很多,或者是机器人在RVIZ中运行一段时间就会好很多。
在ROS2中打开URDF文件出现以下报错:[ERROR] [launch]: Caught exception in launch (see debug for traceback): [Errno 2] No such file or directory: '/opt/ros/humble/share/gazebo_ros/launch/empty_world.launch.py'
重新安装一遍gazebo_ROS软件包还是没有解决
终端中可以启动#ROS2#gazebo
版块
-
1.4k
主题5.1k
帖子 -
468
主题3.0k
帖子 -
69
主题264
帖子 -
1.1k
主题4.4k
帖子 -
1.0k
主题3.7k
帖子 -
5
主题11
帖子 -
364
主题1.7k
帖子