手动添加环境变量
7bab8f1a-bc1a-4c98-a9ca-845c15d5c177-image.png
source添加环境变量
c6cd6eb5-01ef-4f56-bbf0-8a9d70053a5b-image.png
屏幕截图 2025-07-26 104436.png主控节点使用树莓派5安装的jazzy版本,机械臂为humble版本,我在连接机械臂的时候发现能找到动作但是查找不到节点,求解答
手动添加环境变量
7bab8f1a-bc1a-4c98-a9ca-845c15d5c177-image.png
source添加环境变量
c6cd6eb5-01ef-4f56-bbf0-8a9d70053a5b-image.png
我想用机器人做给定角度的旋转,下面是我的代码
void Motor::spin_with_angle(float angle, int speed_ratio, bool clockwise) { spin_mode(speed_ratio, clockwise); if(!clockwise){ angle = -angle; // If not clockwise, reverse the angle } Serial.printf("Spinning with angle: %.2f degrees, speed: %d, clockwise: %d\n", angle, speed_ratio, clockwise); imu.mpu.update(); // Update the IMU data float present_angle = imu.getAngle('z'); // Get the current angle from the IMU float target_angle = _calTargetAngle(angle, present_angle); // Calculate the target angle printf("Current angle: %.2f, Target angle: %.2f\n", imu.getAngle('z'), target_angle); while( clockwise ? imu.getAngle() < target_angle : imu.getAngle() > target_angle ) { printf("Current angle: %.2f, Target angle: %.2f\n", imu.getAngle('z'), target_angle); // Continuously check the angle until the target angle is reached delay(10); imu.mpu.update(); // Update the IMU data } spin_mode(0, true); // Stop the motors after reaching the target angle // Implement the actual spinning logic here }他的逻辑很简单,就是先算当前角跟目标角,然后开始转,并持续跟踪,等到到达后就停止,但结果我发现无论怎么设置,甚至我人为给目标角加上一个修正项(大概-20°),他还是会在我设置90度时转动到100多度,我测试下是每10次90°旋转大概转3圈(这个还挺精准的,我试过多次,都是大概10次3圈,相差不会大于+-10°),也就是每次大约都会转108°,即使我设置让他转70°,他还是会转这么多。这有什么解决的办法吗
我把mpu封装到了Imu类里,这个类只有一个mpu的实例和一些函数的简单再封装,而Motor类就定义了一些操作马达的函数,spin_mode就是设置pwmratio和顺时针还是逆时针。
我比较希望有离线的方案,因为我需要用到的测试软件只能在windows下用,但如果要无线链接又得用linux版本,而且我期望的测试目标是绕一个固定的路线,所以期望他的旋转角能精度比较高。
这是我在将宇树四足机器人go2的ros1开源代码移植到ros2时遇到的问题。
造成这个问题的原因是,在ros2的launch启动文件中,写入了加载控制器节点,但是ros2的controller_manager在搜索控制器时却搜索不到。所以解决本问题的思路是如何让controller_manager知道在哪搜索控制器。
1)新建xacro文件,添加ros2_control标签,并在标签中定义控制器,并加入你的yaml文件路径。注:如果你也是ros1移植ros2,要注意ros1定义控制器的标签是transmission,在ros2中已经替换成了ros2_control标签,你需要将transmission标签换成ros2_control标签,包括里面的内容也可能需要修改
<?xml version="1.0"?> <robot xmlns:xacro="http://www.ros.org/wiki/xacro"> <!-- 声明宏 --> <xacro:macro name="your_controller" params="name"> <!-- 需要替换成你的名字,可随便起 --> <ros2_control name="your_hardware_interface" type="system"> <!-- 需要替换成你的名字,可随便起 --> <hardware> <plugin>gazebo_ros2_control/GazeboSystem</plugin> </hardware> <joint name= "your_joint"> <!-- 需要替换成你的名字,需与模型文件里的关节名一致 --> <!-- 命令接口:力矩控制 --> <command_interface name="effort"> <param name="min">-10.0</param> <!-- 实际值需根据电机调整 --> <param name="max">10.0</param> <!-- 单位:牛顿米(N·m) --> </command_interface> <!-- 状态反馈接口 --> <state_interface name="position"/> <!-- 关节位置 --> <state_interface name="velocity"/> <!-- 关节速度 --> <state_interface name="effort"/> <!-- 关节力矩 --> </joint> </ros2_control> </xacro:macro> <gazebo> <plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control"> <parameters>$(find your_pkg)/config/your_config.yaml</parameters> <!-- 需要替换成你的包名和路径 --> </plugin> </gazebo> </robot>2)修改yaml文件格式,确保格式正确
controller_manager: ros__parameters: update_rate: 100 # Hz use_sim_time: true # 控制器列表及类型 joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster your_controller: type: unitree_legged_control/UnitreeJointController # 各个控制器的具体配置 joint_state_broadcaster: ros__parameters: # No specific parameters needed for the broadcaster usually update_rate: 1000 # FL Controllers Parameters your_controller: ros__parameters: joint: your_joint command_interfaces: - effort state_interfaces: - effort - position - velocity #!!!your_controller名字需一致3)如果你也是ros1迁移ros2,需要注意在xacro文件里的很多插件,如gazebo_ros_control,是ros1提供的插件,但是在ros2中是不能使用的,所以需要对其注释掉或者修改
按照“9.0.3. 主控板固件烧录与配置”视频,小车无法连接到agent。
实验环境windows 11,WSL安装的是ubuntu 22.03,WSL采用Mirrored网络,因此Ubuntu和宿主机的IP一样。
WSL的网络 fishros@LAPTOP-OCE4580C:~/chapt9/fishbot_ws/src$ ifconfig eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.14 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 2409:8a0c:862:9280:ecc:6923:90e6:bb9 prefixlen 64 scopeid 0x0<global> inet6 fe80::55de:f616:7b72:2a2 prefixlen 64 scopeid 0x20<link> inet6 2409:8a0c:862:9280:e048:414d:34e1:141 prefixlen 128 scopeid 0x0<global> ether ec:4c:8c:0d:e5:94 txqueuelen 1000 (以太网) RX packets 49946 bytes 46044245 (46.0 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 3682 bytes 386413 (386.4 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (本地环回) RX packets 163 bytes 19865 (19.8 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 163 bytes 19865 (19.8 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 loopback0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether 00:15:5d:d0:2a:f2 txqueuelen 1000 (以太网) RX packets 2730287 bytes 1746520738 (1.7 GB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1297832 bytes 830875329 (830.8 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 fishros@LAPTOP-OCE4580C:~/chapt9/fishbot_ws/src$ 宿主机网络 无线局域网适配器 WLAN: 连接特定的 DNS 后缀 . . . . . . . : IPv6 地址 . . . . . . . . . . . . : 2409:8a0c:862:9280:ecc:6923:90e6:bb9 临时 IPv6 地址. . . . . . . . . . : 2409:8a0c:862:9280:e048:414d:34e1:141 本地链接 IPv6 地址. . . . . . . . : fe80::55de:f616:7b72:2a2%19 IPv4 地址 . . . . . . . . . . . . : 192.168.1.14 子网掩码 . . . . . . . . . . . . : 255.255.255.0 默认网关. . . . . . . . . . . . . : fe80::1%19 192.168.1.1 以太网适配器 蓝牙网络连接: 媒体状态 . . . . . . . . . . . . : 媒体已断开连接 连接特定的 DNS 后缀 . . . . . . . : 以太网适配器 vEthernet (WSL (Hyper-V firewall)): 连接特定的 DNS 后缀 . . . . . . . : 本地链接 IPv6 地址. . . . . . . . : fe80::f274:6963:ff03:8ecf%46 IPv4 地址 . . . . . . . . . . . . : 172.26.144.1 子网掩码 . . . . . . . . . . . . : 255.255.240.0 默认网关. . . . . . . . . . . . . : PS C:\Windows\system32>e90a62f5-367a-4b71-8cb7-ac2bd24402a5.png
小车网络微信图片_2025-07-28_222626_277.jpg
agent无接受数据现象 fishros@LAPTOP-OCE4580C:~/chapt9/fishbot_ws/src$ ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 [1753711679.022870] info | UDPv4AgentLinux.cpp | init | running... | port: 8888 [1753711679.023137] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4问题已按照https://fishros.org.cn/forum/post/15555修改无效
import launch
import launch_ros
from ament_index_python.packages import get_package_share_directory
#import os
import launch_ros.parameter_descriptions
#import urdf_tutorial_path
def generate_launch_description():
#获取默认的urdf urdf_package_path = get_package_share_directory('fishbot_description') #default_urdf_path = os.path.join(urdf_package_path,'urdf','first_robot.urdf' default_model_path = urdf_package_path + '/urdf/first_robot.urdf' #为launch申明参数, 声明一个urdf目录的参数,方便修改 action_declare_arg_mode_path = launch.actions.DeclareLaunchArgument( name='model',default_value=str(default_model_path),description='URDF的绝对路径' ) #通过文件路径,获取内容,并转换成参数对象,以供转入 robot_state_publisher robot_description =launch_ros.parameter_descriptions.ParameterValue(launch.substitutions.Command(['cat ',launch.substitutions.LaunchConfiguration('model')]),value_type=str) #状态发布节点 robot_state_publisher_node = launch_ros.actions.Node( package='robot_state_publishers', executable='robot_state_publisher', parameters=[{'robot_description':robot_description}]) #关节状态发布节点 joint_state_publisher_node = launch_ros.actions.Node( package='joint_state_publisher', executable='joint_state_publisher') #rviz节点 rviz_node = launch_ros.actions.Node(package='rviz2', executable='rviz2') return launch.LaunchDescription([action_declare_arg_mode_path, joint_state_publisher_node, robot_state_publisher_node, rviz_node])报错内容如下,无论是update还是--fix-missing都没有
joshua@DESKTOP-UVEAJD2:~$ sudo apt install ros-humble-joint-state-publisher
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
ros-humble-joint-state-publisher
0 upgraded, 1 newly installed, 0 to remove and 362 not upgraded.
Need to get 16.1 kB of archives.
After this operation, 68.6 kB of additional disk space will be used.
Err:1 http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy/main amd64 ros-humble-joint-state-publisher amd64 2.4.0-1jammy.20250429.192014
404 Not Found [IP: 101.6.15.130 80]
E: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/pool/main/r/ros-humble-joint-state-publisher/ros-humble-joint-state-publisher_2.4.0-1jammy.20250429.192014_amd64.deb 404 Not Found [IP: 101.6.15.130 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
使用鱼香ROS雷达驱动系统时候,进行WIFI转串口测试,一直连接不上,发现TCP端口是8888,但教程资料中都是8889
ca9deb89-f284-4db2-939f-6ac25b0a046d-图片.png
雷达数据可以正常读取
2cca4e5f-fdea-4425-a6f9-54170d735caf-9fb43ee6009e4017ab24a3af7e97618b.jpg file:///home/zmy/文档/xwechat_files/wxid_tpb3or8y3jxo22_a70e/temp/2025-07/RWTemp/9fb43ee6009e4017ab24a3af7e97618b.jpg
ros2版本:humble
硬件环境:jetson nano aarch64
nav2版本:https://github.com/ros-navigation/navigation2.git(humble分支)
由于没有aarch64平台的nav2,所以自行编译了nav2,下载了gazebo_ros_pkgs和navigation2两个包,编译后运行官方示例,发现gazebo和riviz都正常启动,但是gazebo的激光雷达线束并没有展示出来
ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False2574beb3-4b21-4cd8-8a36-e32116884f6c-image.png
已经做过的排查查看具体的报错信息,发现是BT没有正常启动导致的
[component_container_isolated-6] [ERROR] [1753415761.365097867] [bt_navigator_navigate_through_poses_rclcpp_node]: "global_costmap/clear_entirely_global_costmap" service server not available after waiting for 1.00s [component_container_isolated-6] [ERROR] [1753415761.386311404] [bt_navigator]: Exception when loading BT: basic_string::_M_create [component_container_isolated-6] [ERROR] [1753415761.386476140] [bt_navigator]: Error loading XML file: /home/jetson/nav2_ws/install/nav2_bt_navigator/share/nav2_bt_navigator/behavior_trees/navigate_through_poses_w_replanning_and_recovery.xml [component_container_isolated-6] [ERROR] [1753415761.387238416] [lifecycle_manager_navigation]: Failed to change state for node: bt_navigator [component_container_isolated-6] [ERROR] [1753415761.387296976] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.继续往上看报错,出现下面两个报错
[component_container_isolated-6] [INFO] [1753415759.176987019] [global_costmap.global_costmap]: Using plugin "static_layer" [component_container_isolated-6] [ERROR] [1753415759.177916112] [global_costmap.global_costmap]: Caught exception in callback for transition 10 [component_container_isolated-6] [ERROR] [1753415759.177983088] [global_costmap.global_costmap]: Original error: MultiLibraryClassLoader: Could not create object of class type nav2_costmap_2d::StaticLayer as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary() [component_container_isolated-6] [WARN] [1753415759.178028976] [global_costmap.global_costmap]: Error occurred while doing error handling. [component_container_isolated-6] [FATAL] [1753415759.178051248] [global_costmap.global_costmap]: Lifecycle node global_costmap does not have error state implemented和
[component_container_isolated-6] [INFO] [1753415758.973267963] [local_costmap.local_costmap]: Using plugin "voxel_layer" [component_container_isolated-6] [ERROR] [1753415758.980190369] [local_costmap.local_costmap]: Caught exception in callback for transition 10 [component_container_isolated-6] [ERROR] [1753415758.980297794] [local_costmap.local_costmap]: Original error: MultiLibraryClassLoader: Could not create object of class type nav2_costmap_2d::VoxelLayer as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary() [component_container_isolated-6] [WARN] [1753415758.980353666] [local_costmap.local_costmap]: Error occurred while doing error handling. [component_container_isolated-6] [FATAL] [1753415758.980392482] [local_costmap.local_costmap]: Lifecycle node local_costmap does not have error state implemented这两个插件刚好是配置文件里面local_costmap和global_costmap的第一个要加载的插件,怀疑是这两个动态库没有编译成功,看了CMakeLists,这两个库放在叫做liblayers.so的动态链接库里面,查找后可以找到这个动态链接库
./install/nav2_costmap_2d/lib/liblayers.so用ldd命令查看这个动态链接库是否加载成功,发现是正常加载的,然后用nm的方式去找,也能找到VoxelLayer和StaticLayer的符号,证明这个动态链接库是没问题的,然后就去找动态库的路径是否有放在LD_LIBRARY_PATH里面,发现也是有的,后面写了个简单的demo去加载VoxelLayer和StaticLayer,发现也是正常加载,但是运行官方示例就没办法加载这两个插件,导致整个项目运行不起来,实在想不通是为什么
测试加载插件的程序 #include <pluginlib/class_loader.hpp> #include <nav2_costmap_2d/layer.hpp> #include <rclcpp/rclcpp.hpp> #include <iostream> int main(int argc, char** argv) { rclcpp::init(argc, argv); try { // 创建插件加载器 pluginlib::ClassLoader<nav2_costmap_2d::Layer> loader("nav2_costmap_2d", "nav2_costmap_2d::Layer"); std::cout << "插件加载器创建成功" << std::endl; // 获取所有可用的插件类 std::vector<std::string> classes = loader.getDeclaredClasses(); std::cout << "可用的插件类:" << std::endl; for (const auto& cls : classes) { std::cout << " - " << cls << std::endl; } // 专门测试VoxelLayer插件 std::cout << "\n专门测试 VoxelLayer 插件..." << std::endl; // 检查VoxelLayer是否在可用类列表中 bool found = false; for (const auto& cls : classes) { if (cls == "nav2_costmap_2d::VoxelLayer") { found = true; break; } } if (!found) { std::cerr << "错误: VoxelLayer 不在可用插件列表中!" << std::endl; return 1; } std::cout << "VoxelLayer 在可用插件列表中" << std::endl; // 尝试加载VoxelLayer插件 std::cout << "尝试创建 VoxelLayer 实例..." << std::endl; std::shared_ptr<nav2_costmap_2d::Layer> voxel_layer = loader.createSharedInstance("nav2_costmap_2d::VoxelLayer"); std::cout << "VoxelLayer 插件加载成功!" << std::endl; // 检查插件类型 std::cout << "插件类型: " << typeid(*voxel_layer).name() << std::endl; std::cout << "\nVoxelLayer 插件测试通过!" << std::endl; } catch (const pluginlib::PluginlibException& e) { std::cerr << "插件加载错误: " << e.what() << std::endl; return 1; } catch (const std::exception& e) { std::cerr << "其他错误: " << e.what() << std::endl; return 1; } rclcpp::shutdown(); return 0; }求问大佬们 在虚拟机上装了ros2+ groot 要实现apm相关飞行仿真 怎么实现ros2和groot的通信呢
目前可以在ros中打开groot,解锁后可以拖动行为树相关的节点,但是没有找到咋运行拖动后的文档,怎么让ros2里面实现通过直接拖动行为树来模拟仿真飞行
c3fc8201-7ebf-4efb-b71a-f1bcc4da1b28-image.png
这个问题怎么解决啊284273dc-65b5-48a9-ace8-1956f6bccee1-image.png这个是cmake的934ddaab-742c-4ff2-ad8b-75b23dd7922f-image.png
[我想用机械臂实现自动识别抓取操作,使用moveit规划从起始位置到目标位置的运动路径,具体来说,利用 MoveIt 的 MoveGroupInterface 进行运动规划]
问题描述:[在引入 MoveIt 的核心控制接口时,提示无法解析导入“moveit_commander”;换了清华源,依然无法定位件包 ros-humble-moveit-commander]
具体细节和上下文:[from moveit_commander import MoveGroupCommander, PlanningSceneInterface
def init(self):
super().init('auto_grasper_with_moveit_node')
ros2@ros2-virtual-machine:~$ sudo apt install ros-humble-moveit-commander
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
E: 无法定位软件包 ros-humble-moveit-commander]
a2ea9bee-df53-4903-81fc-ef1af0ce9bb3-image.png 求大佬指导
有啥比较一条龙(除moveit)的实现方案么。
除开视觉部分,我找到用tesseract库,但是,它的专属srdf模型生成工具,5年没有维护,已经用不了了,从moveit改,太困难了。
moveit2我上手,感觉难度曲线有些陡峭
您好:
目前我想讓TB4可以自行導航,但現在遭遇幾個問題:
Screenshot from 2025-07-19 17-39-29.png(圖一)
我們目前遭遇到Global Status為error,RobotModel的status為error,有嘗試重連後還是沒辦法執行。
Screenshot from 2025-07-19 17-30-58.png(圖二)這張圖由上至下執行的終端機分別為
終端機1:
ros2 launch turtlebot4_navigation localization.launch.py map:=office.yaml
終端機2:
ros2 launch turtlebot4_navigation nav2.launch.py
終端機3:
ros2 launch turtlebot4_viz view_robot.launch.py)Screenshot from 2025-07-19 17-39-29.png Screenshot from 2025-07-19 17-30-58.png
四驱v2的主控板使用下载的固件里程计正常,使用源码编译的就没有读取不到里程计数据和更新,使用了master版本源码和最新的2.0.6的源码都不可以
屏幕截图 2025-07-22 115300.png
按照图中下载示例代码部分中,出现一下提示。且两条都是如此,寻求一下解决办法
qing@qing-virtual-maveitchine:~/ws_moveit/src$ cd ~/ws_moveit/src
qing@qing-virtual-machine:~/ws_moveit/src$ git clone https://github.com/ros-planning/moveit_tutorials.git -b master
fatal: 目标路径 'moveit_tutorials' 已经存在,并且不是一个空目录。
我尝试在Nav2官方的示例上修改,但是今天启动的时候我却遇到了莫名奇妙的tf帧时间同步错误。下面是我的配置文件,同样的配置文件在昨天还是工作正常的。
bt_navigator: ros__parameters: use_sim_time: True global_frame: map robot_base_frame: base_link odom_topic: /demo/odom bt_loop_duration: 10 default_server_timeout: 20 wait_for_service_timeout: 1000 action_server_result_timeout: 900.0 #default_nav_to_pose_bt_xml: $(find-pkg-share sam_bot_description)/src/control/navigate_w_replanning_only_if_goal_is_updated.xml #default_nav_through_poses_bt_xml: $(find-pkg-share sam_bot_description)/src/control/no_global_map.bt.xml #default_nav_to_pose_bt_xml: "nav2_bt_navigator/navigate_w_replanning_only_if_goal_is_updated.xml" navigators: ["navigate_to_pose", "navigate_through_poses"] navigate_to_pose: plugin: "nav2_bt_navigator::NavigateToPoseNavigator" navigate_through_poses: plugin: "nav2_bt_navigator::NavigateThroughPosesNavigator" # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. # plugin_lib_names is used to add custom BT plugins to the executor (vector of strings). # Built-in plugins are added automatically # plugin_lib_names: [] error_code_name_prefixes: - assisted_teleop - backup - compute_path - dock_robot - drive_on_heading - follow_path - nav_thru_poses - nav_to_pose - route - spin - undock_robot - wait controller_server: ros__parameters: use_sim_time: True controller_frequency: 20.0 costmap_update_timeout: 0.30 min_x_velocity_threshold: 0.4 min_y_velocity_threshold: 0.0 min_theta_velocity_threshold: 0.001 failure_tolerance: 0.3 transform_tolerance: 0.5 progress_checker_plugins: ["progress_checker"] goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker" controller_plugins: ["FollowPath"] odom_topic: /demo/odom use_realtime_priority: false enable_stamped_cmd_vel: true # Progress checker parameters progress_checker: plugin: "nav2_controller::SimpleProgressChecker" required_movement_radius: 0.5 movement_time_allowance: 10.0 # Goal checker parameters general_goal_checker: stateful: True plugin: "nav2_controller::SimpleGoalChecker" xy_goal_tolerance: 0.25 yaw_goal_tolerance: 0.25 # RPP controller parameters FollowPath_RPP: plugin: "nav2_regulated_pure_pursuit_controller::RegulatedPurePursuitController" use_sim_time: True desired_linear_vel: 0.5 lookahead_dist: 3.0 min_lookahead_dist: 0.3 max_lookahead_dist: 6.0 lookahead_time: 1.5 rotate_to_heading_angular_vel: 1.8 transform_tolerance: 0.1 use_velocity_scaled_lookahead_dist: false min_approach_linear_velocity: 0.05 approach_velocity_scaling_dist: 1.0 use_collision_detection: true max_allowed_time_to_collision_up_to_carrot: 1.0 use_regulated_linear_velocity_scaling: true use_cost_regulated_linear_velocity_scaling: false regulated_linear_scaling_min_radius: 0.9 regulated_linear_scaling_min_speed: 0.25 use_fixed_curvature_lookahead: false curvature_lookahead_dist: 1.0 use_rotate_to_heading: true rotate_to_heading_min_angle: 0.785 max_angular_accel: 3.2 max_robot_pose_search_dist: 10.0 interpolate_curvature_after_goal: false cost_scaling_dist: 0.3 cost_scaling_gain: 1.0 inflation_cost_scaling_factor: 3.0 # 时间弹性带 FollowPath: #加载旋转控制器插件 plugin: "nav2_rotation_shim_controller::RotationShimController" primary_controller: "teb_local_planner::TebLocalPlannerROS" angular_dist_threshold: 0.785 forward_sampling_distance: 2.0 rotate_to_heading_angular_vel: 3.14 max_angular_accel: 1.57 simulate_ahead_time: 10.0 rotate_to_goal_heading: true use_path_orientations: true # 加载 TEB 控制器插件 footprint_model: type: "circular" radius: 0.5 use_sim_time: True max_vel_x: 2.0 max_vel_y: 0.0 max_vel_theta: 1.0 min_vel_x: 0.5 min_vel_y: 0.0 min_vel_theta: 0.4 acc_lim_x: 1.0 acc_lim_y: 1.0 acc_lim_theta: 0.5 # 时间弹性带参数 dt_ref: 0.3 dt_hysteresis: 0.1 global_plan_overwrite_orientation: True max_global_plan_lookahead_dist: 20.0 # MPC controller parameters FollowPath_MPPI: # 加载旋转控制器插件 plugin: "nav2_rotation_shim_controller::RotationShimController" primary_controller: "nav2_mppi_controller::MPPIController" angular_dist_threshold: 0.785 forward_sampling_distance: 2.0 rotate_to_heading_angular_vel: 3.14 max_angular_accel: 0.6 simulate_ahead_time: 10.0 rotate_to_goal_heading: true use_path_orientations: false # 加载 MPPI 控制器插件 # plugin: "nav2_mppi_controller::MPPIController" # MPPI 控制器参数 # 采样时间步长 time_steps: 200 # 采样时间间隔(秒) model_dt: 0.05 # 一次采样的轨迹数量 batch_size: 1000 # 加速度控制 ax_max: 3.0 ax_min: -3.0 ay_max: 3.0 az_max: 3.5 # 输入标准差 vx_std: 1.2 vy_std: 1.2 wz_std: 1.57 # 速度限制 vx_max: 10.0 vx_min: -0.35 vy_max: 10.0 wz_max: 1.9 # 每次规划迭代次数 iteration_count: 1 # 路径裁剪距离 prune_distance: 10.0 # 坐标变化容忍时间 transform_tolerance: 0.1 temperature: 0.3 gamma: 0.015 motion_model: "DiffDrive" visualize: true regenerate_noises: true TrajectoryVisualizer: trajectory_step: 30 time_step: 2 AckermannConstraints: min_turning_r: 0.01 critics: [ "ConstraintCritic", "CostCritic", "GoalCritic", "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic", "PathAngleCritic", "PreferForwardCritic", "TwirlingCritic"] ConstraintCritic: enabled: true cost_power: 1 cost_weight: 4.0 GoalCritic: enabled: true cost_power: 1 cost_weight: 5.0 threshold_to_consider: 1.4 GoalAngleCritic: enabled: true cost_power: 1 cost_weight: 5.0 threshold_to_consider: 0.3 PreferForwardCritic: enabled: true cost_power: 1 cost_weight: 3.0 threshold_to_consider: 0.5 CostCritic: enabled: true cost_power: 1 cost_weight: 5.0 critical_cost: 30.0 consider_footprint: true collision_cost: 1000000.0 near_goal_distance: 1.0 trajectory_point_step: 2 PathAlignCritic: enabled: true cost_power: 1 cost_weight: 5.0 max_path_occupancy_ratio: 0.05 trajectory_point_step: 4 threshold_to_consider: 5.0 offset_from_furthest: 20 use_path_orientations: false PathFollowCritic: enabled: true cost_power: 1 cost_weight: 4.0 offset_from_furthest: 5 threshold_to_consider: 3.0 PathAngleCritic: enabled: true cost_power: 1 cost_weight: 3.0 offset_from_furthest: 4 threshold_to_consider: 0.5 max_angle_to_furthest: 1.0 mode: 0 TwirlingCritic: enabled: true twirling_cost_power: 1 twirling_cost_weight: 1.0 local_costmap: local_costmap: ros__parameters: use_sim_time: True update_frequency: 24.0 publish_frequency: 24.0 global_frame: odom robot_base_frame: base_link rolling_window: true width: 30 height: 30 resolution: 0.05 footprint: "[ [0.8, 0.6], [0.8, -0.6], [-0.8, -0.6], [-0.8, 0.6] ]" plugins: ["voxel_layer", "static_layer", "inflation_layer"] inflation_layer: plugin: "nav2_costmap_2d::InflationLayer" cost_scaling_factor: 10.0 inflation_radius: 0.2 # 目前voxel_layer已经开启 voxel_layer: plugin: "nav2_costmap_2d::VoxelLayer" enabled: True publish_voxel_map: True origin_z: 0.0 z_resolution: 0.05 z_voxels: 16 max_obstacle_height: 2.0 mark_threshold: 0 observation_sources: pointcloud_front pointcloud_back pointcloud_front: topic: /scan_front/points data_type: "PointCloud2" clearing: True marking: True inf_is_valid: True max_obstacle_height: 3.0 min_obstacle_height: 0.0 obstacle_max_range: 6.0 obstacle_min_range: 0.0 raytrace_max_range: 5.0 raytrace_min_range: 0.0 pointcloud_back: topic: /scan_back/points data_type: "PointCloud2" clearing: True marking: True inf_is_valid: True max_obstacle_height: 3.0 min_obstacle_height: 0.0 obstacle_max_range: 6.0 obstacle_min_range: 0.0 raytrace_max_range: 5.0 raytrace_min_range: 0.0 static_layer: plugin: "nav2_costmap_2d::StaticLayer" map_subscribe_transient_local: True footprint_clearing_enabled: True subscribe_to_updates: True always_send_full_costmap: True global_costmap: global_costmap: ros__parameters: update_frequency: 1.0 publish_frequency: 1.0 global_frame: map robot_base_frame: base_link robot_radius: 0.3 resolution: 0.05 track_unknown_space: false plugins: ["static_layer", "obstacle_layer", "inflation_layer"] obstacle_layer: plugin: "nav2_costmap_2d::ObstacleLayer" enabled: True combination_method: 0 observation_sources: pointcloud_front pointcloud_back pointcloud_front: topic: /scan_front/points data_type: "PointCloud2" clearing: True marking: True max_obstacle_height: 10.0 min_obstacle_height: 0.0 obstacle_max_range: 30.0 obstacle_min_range: -1.0 raytrace_max_range: 3.0 raytrace_min_range: -3.0 pointcloud_back: topic: /scan_back/points data_type: "PointCloud2" clearing: True marking: True max_obstacle_height: 10.0 min_obstacle_height: 0.0 obstacle_max_range: 30.0 obstacle_min_range: -1.0 raytrace_max_range: 3.0 raytrace_min_range: -3.0 static_layer: plugin: "nav2_costmap_2d::StaticLayer" map_subscribe_transient_local: True inflation_layer: plugin: "nav2_costmap_2d::InflationLayer" cost_scaling_factor: 3.0 inflation_radius: 0.7 always_send_full_costmap: True map_saver: ros__parameters: use_sim_time: True save_map_timeout: 5.0 free_thresh_default: 0.25 occupied_thresh_default: 0.65 map_subscribe_transient_local: True smoother_server: ros__parameters: use_sim_time: True smoother_plugins: ["simple_smoother"] simple_smoother: plugin: "nav2_smoother::SimpleSmoother" tolerance: 1.0e-10 max_its: 1000 do_refinement: True behavior_server: ros__parameters: use_sim_time: True local_costmap_topic: local_costmap/costmap_raw global_costmap_topic: global_costmap/costmap_raw local_footprint_topic: local_costmap/published_footprint global_footprint_topic: global_costmap/published_footprint cycle_frequency: 20.0 behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"] spin: plugin: "nav2_behaviors::Spin" backup: plugin: "nav2_behaviors::BackUp" drive_on_heading: plugin: "nav2_behaviors::DriveOnHeading" wait: plugin: "nav2_behaviors::Wait" assisted_teleop: plugin: "nav2_behaviors::AssistedTeleop" local_frame: odom global_frame: map robot_base_frame: base_link transform_tolerance: 2.0 simulate_ahead_time: 2.0 max_rotational_vel: 1.0 min_rotational_vel: 0.4 rotational_acc_lim: 3.2 enable_stamped_cmd_vel: true waypoint_follower: ros__parameters: use_sim_time: True loop_rate: 20 stop_on_failure: false action_server_result_timeout: 900.0 waypoint_task_executor_plugin: "wait_at_waypoint" wait_at_waypoint: plugin: "nav2_waypoint_follower::WaitAtWaypoint" enabled: True waypoint_pause_duration: 200 planner_server: ros__parameters: plugins: ["GridBased"] use_sim_time: True GridBased: plugin: "nav2_straightline_planner::StraightLine" interpolation_resolution: 0.1 velocity_smoother: ros__parameters: use_sim_time: True smoothing_frequency: 20.0 scale_velocities: False feedback: "OPEN_LOOP" max_velocity: [1.0, 0.0, 2.0] min_velocity: [-1.0, 0.0, -2.0] max_accel: [2.5, 0.0, 3.2] max_decel: [-2.5, 0.0, -3.2] odom_topic: "/demo/odom" odom_duration: 0.1 deadband_velocity: [0.0, 0.0, 0.0] velocity_timeout: 1.0 enable_stamped_cmd_vel: true collision_monitor: ros__parameters: use_sim_time: True base_frame_id: "base_footprint" odom_frame_id: "odom" cmd_vel_in_topic: "cmd_vel_smoothed" cmd_vel_out_topic: "/demo/cmd_vel" enable_stamped_cmd_vel: true state_topic: "collision_monitor_state" transform_tolerance: 0.2 source_timeout: 1.0 base_shift_correction: True stop_pub_timeout: 2.0 # Polygons represent zone around the robot for "stop", "slowdown" and "limit" action types, # and robot footprint for "approach" action type. polygons: ["FootprintApproach"] FootprintApproach: type: "polygon" action_type: "approach" footprint_topic: "local_costmap/published_footprint" time_before_collision: 1.2 simulation_time_step: 0.1 min_points: 6 visualize: False enabled: True observation_sources: ["scan"] scan: type: "scan" topic: "scan" min_height: 0.15 max_height: 2.0 enabled: True docking_server: ros__parameters: use_sim_time: True controller_frequency: 50.0 initial_perception_timeout: 5.0 wait_charge_timeout: 5.0 dock_approach_timeout: 30.0 undock_linear_tolerance: 0.05 undock_angular_tolerance: 0.1 max_retries: 3 base_frame: "base_link" fixed_frame: "odom" dock_backwards: false dock_prestaging_tolerance: 0.5 # Types of docks dock_plugins: ['simple_charging_dock'] simple_charging_dock: plugin: 'opennav_docking::SimpleChargingDock' docking_threshold: 0.05 staging_x_offset: -0.7 use_external_detection_pose: true use_battery_status: false # true use_stall_detection: false # true external_detection_timeout: 1.0 external_detection_translation_x: -0.18 external_detection_translation_y: 0.0 external_detection_rotation_roll: -1.57 external_detection_rotation_pitch: -1.57 external_detection_rotation_yaw: 0.0 filter_coef: 0.1 # Dock instances # The following example illustrates configuring dock instances. # docks: ['home_dock'] # Input your docks here # home_dock: # type: 'simple_charging_dock' # frame: map # pose: [0.0, 0.0, 0.0] controller: k_phi: 3.0 k_delta: 2.0 v_linear_min: 0.15 v_linear_max: 0.15 use_collision_detection: true costmap_topic: "/local_costmap/costmap_raw" footprint_topic: "/local_costmap/published_footprint" transform_tolerance: 0.1 projection_time: 5.0 simulation_step: 0.1 dock_collision_threshold: 0.3 loopback_simulator: ros__parameters: use_sim_time: True base_frame_id: "base_footprint" odom_frame_id: "odom" map_frame_id: "map" scan_frame_id: "base_scan" # tb4_loopback_simulator.launch.py remaps to 'rplidar_link' update_duration: 0.02 enable_stamped_cmd_vel: true我遇到的错误是这个
[controller_server-8] [ERROR] [1753155010.957683345] [controller_server]: Extrapolation Error: Lookup would require extrapolation into the future. Requested time 80.830000 but the latest data is at time 80.600000, when looking up transform from frame [odom] to frame [map] [controller_server-8] [controller_server-8] [ERROR] [1753155010.957710639] [controller_server]: Global Frame: odom Plan Frame size 63: map [controller_server-8] [controller_server-8] [ERROR] [1753155010.957740037] [controller_server]: Could not transform the global plan to the frame of the controller [controller_server-8] [WARN] [1753155010.957826901] [controller_server]: [follow_path] [ActionServer] Aborting handle. [behavior_server-11] [INFO] [1753155010.972874419] [behavior_server]: Running backup [planner_server-10] [INFO] [1753155011.310881979] [global_costmap.global_costmap]: Message Filter dropping message: frame 'back_lidar_link' at time 80.850 for reason 'the timestamp on the message is earlier than all the data in the transform cache' [rviz2-3] [INFO] [1753155011.502784946] [rviz2]: Message Filter dropping message: frame 'odom' at time 80.645 for reason 'discarding message because the queue is full' [planner_server-10] [INFO] [1753155011.563139438] [global_costmap.global_costmap]: Message Filter dropping message: frame 'front_lidar_link' at time 80.950 for reason 'the timestamp on the message is earlier than all the data in the transform cache' [planner_server-10] [INFO] [1753155011.600570306] [global_costmap.global_costmap]: Message Filter dropping message: frame 'back_lidar_link' at time 80.950 for reason 'the timestamp on the message is earlier than all the data in the transform cache' [rviz2-3] [INFO] [1753155011.664746872] [rviz2]: Message Filter dropping message: frame 'odom' at time 80.704 for reason 'discarding message because the queue is full' [rviz2-3] [INFO] [1753155011.820135330] [rviz2]: Message Filter dropping message: frame 'odom' at time 80.754 for reason 'discarding message because the queue is full' [rviz2-3] [INFO] [1753155011.947982501] [rviz2]: Message Filter dropping message: frame 'odom' at time 80.803 for reason 'discarding message because the queue is full'我检查了我的其他配置文件,确定这些配置在之前都从未修改,工作正常。
请大佬看看我是不是错漏了什么?
版块
-
1.4k
主题4.9k
帖子 -
457
主题3.0k
帖子 -
67
主题261
帖子 -
1.1k
主题4.3k
帖子 -
1.0k
主题3.7k
帖子 -
5
主题11
帖子 -
358
主题1.6k
帖子