报错内容如下,无论是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?
报错内容如下,无论是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'我检查了我的其他配置文件,确定这些配置在之前都从未修改,工作正常。
请大佬看看我是不是错漏了什么?
首先是提示信息:
[INFO] [1753014822.443208735] [move_group_interface]: Ready to take commands for planning group left_hand.
Planning frame: base_link
[INFO] [1753014822.444405420] [moveit_ros.current_state_monitor]: Listening to joint states on topic 'joint_states'
[INFO] [1753014823.444763207] [moveit_ros.current_state_monitor]: Didn't receive robot state (joint angles) with recent timestamp within 1.000000 seconds. Requested time 1753014822.444444, but latest received state has time 0.000000.
Check clock synchronization if your are running ROS across multiple machines!
[ERROR] [1753014823.444899784] [move_group_interface]: Failed to fetch current robot state
根据官方文档一直查到提示信息在waitForCurrentState()的函数中被打印,函数主要逻辑是使用while阻塞等待回调执行,直到接收到数据的时间戳大于指定的目标时间,但是为了避免一直阻塞,函数会在每次循环求出与初始时间的间隔,然后做一个超时判断,可以看到提示信息第三个浮点数,含义是接收到数据的时间戳,但是它为0,这说明在对象初始化结束后,从未接收到过数据,回调函数没有被执行。检查回调绑定的函数startStateMonitor(),函数接受默认参数主题名joint_states,然后绑定回调然后打印监听中的信息。但是回调似乎不被执行。
已验证主题存在,并且数据正常发布,自已写一个订阅节点也能够正常输出得到的时间戳。
#include <memory> #include <stdio.h> #include <rclcpp/rclcpp.hpp> #include <moveit/move_group_interface/move_group_interface.h> #include <moveit_msgs/msg/move_it_error_codes.h> int main(int argc, char * argv[]) { // Initialize ROS and create the Node rclcpp::init(argc, argv); auto const node = std::make_shared<rclcpp::Node>( "ib_moveit", rclcpp::NodeOptions().automatically_declare_parameters_from_overrides(true) ); // Create a ROS logger auto const logger = rclcpp::get_logger("ib_moveit"); // Create the MoveIt MoveGroup Interface using moveit::planning_interface::MoveGroupInterface; auto move_group_interface = MoveGroupInterface(node, "left_hand"); std::string planning_frame = move_group_interface.getPlanningFrame(); printf("Planning frame: %s\n", planning_frame.c_str()); // Set a target Pose auto const target_pose = []{ geometry_msgs::msg::Pose msg; msg.orientation.x = 0.00503518; msg.orientation.y = 0.707089; msg.orientation.z = 0.707089; msg.orientation.w = 0.00503523; msg.position.x = 0.22454; msg.position.y = 0.424263; msg.position.z = 0.3421; return msg; }(); move_group_interface.setPoseTarget(target_pose); //move_group_interface.setRandomTarget(); auto target_pose_ = move_group_interface.getCurrentPose(); printf("Target Position: [x=%.3f, y=%.3f, z=%.3f]\n", target_pose_.pose.position.x, target_pose_.pose.position.y, target_pose_.pose.position.z); // Create a plan to that target pose auto const [success, plan] = [&move_group_interface]{ moveit::planning_interface::MoveGroupInterface::Plan msg; moveit::core::MoveItErrorCode error_code = move_group_interface.plan(msg); if (error_code == moveit::core::MoveItErrorCode::SUCCESS) { printf("Planning succeeded\n"); } else { // 输出详细错误信息 printf("Planning failed with error code: %d\n", error_code.val); // 检查特定错误类型 if (error_code == moveit_msgs::msg::MoveItErrorCodes::NO_IK_SOLUTION) { printf("No IK solution found for target pose!\n"); } else if (error_code == moveit_msgs::msg::MoveItErrorCodes::PLANNING_FAILED) { printf("General planning failure. Check constraints or environment.\n"); } } auto const ok = static_cast<bool>(error_code); return std::make_pair(ok, msg); }(); // Execute the plan if(success) { move_group_interface.execute(plan); } else { RCLCPP_ERROR(logger, "Planning failed!"); } // Shutdown ROS rclcpp::shutdown(); return 0; }CMake Error at components/micro_ros_espidf_component/CMakeLists.txt:90 (message):
FAILED: no such file or directory
以上是报错内容,cmake文件的第九十行是代码块的一部分,涉及libmicroros.mk这个文件,这个文件存在而且可以正常访问,克隆的仓库完整,但是不知道为什么还是报错,还恳请各位大佬帮忙看看,以下是cmake的部分代码块
execute_process(
WORKING_DIRECTORY ${COMPONENT_DIR}
RESULT_VARIABLE libmicroros_ret
COMMAND
${submake} -j -f libmicroros.mk
X_CC=${CMAKE_C_COMPILER}
X_AR=${CMAKE_AR}
X_STRIP=${CMAKE_STRIP}
X_CFLAGS=${CMAKE_C_FLAGS}
X_CXX=${CMAKE_CXX_COMPILER}
X_CXXFLAGS=${CMAKE_CXX_FLAGS}
C_STANDARD=${CMAKE_C_STANDARD}
MIDDLEWARE=${MIDDLEWARE}
BUILD_DIR=${CMAKE_BINARY_DIR}
IDF_INCLUDES=${IDF_INCLUDES}
IDF_PATH=${IDF_PATH}
IDF_TARGET=${IDF_TARGET}
APP_COLCON_META=${APP_COLCON_META}
IDF_VERSION_MAJOR=${IDF_VERSION_MAJOR}
IDF_VERSION_MINOR=${IDF_VERSION_MINOR}
EXTRA_ROS_PACKAGES=${EXTRA_ROS_PACKAGES}
)
if(libmicroros_ret AND NOT libmicroros_ret EQUAL 0)
message(FATAL_ERROR "FAILED: ${libmicroros_ret}")
endif()
00c18932-581b-4473-a8f4-6b717984c08e-image.png
bd258953-bc17-4c7c-99d7-f890a20f049c-图片.png
使用ROS2 humble开发机器人导航系统,主控机除了接入底盘STM32外,还接入了雷达和IMU。
请问我该选择树莓派4B还是5?
运行如下代码时,如果使用fish的源码会出现的问题,
a5b2f5c7-de48-4b96-b3e4-db418b84034e.png
有:
50a0e1bb-a315-4de2-b706-004f298f95f7.png
就是时间戳的问题,因为我增大过slam_toolbox的online_async这个文件的配置文件的栈的大小和保存数据的时间但是都没有效果,也不是网络问题,然后就发现了只可能是时间戳的问题。电脑有自己的时钟,小车也是,就发现了odom2tf.cpp文件里面的一个地方出现了问题,时间戳应该都要用电脑的时间戳,不能两者混在一起。
具体的解释你们可以把代码发给AI问一下,我可能说的不清除,但是一定能解决。
只要按照下面的方法把时间戳统一到电脑的就完美解决问题了,
找到odom2tf.cpp文件,按照下面的改:
de71100b-d44d-4862-a5cb-bec133d9c35f.png
😊 😊 😊 😊
版块
-
1.3k
主题4.9k
帖子 -
455
主题3.0k
帖子 -
67
主题261
帖子 -
1.1k
主题4.3k
帖子 -
1.0k
主题3.7k
帖子 -
5
主题11
帖子 -
358
主题1.6k
帖子