有啥比较一条龙(除moveit)的实现方案么。
除开视觉部分,我找到用tesseract库,但是,它的专属srdf模型生成工具,5年没有维护,已经用不了了,从moveit改,太困难了。
moveit2我上手,感觉难度曲线有些陡峭
有啥比较一条龙(除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
😊 😊 😊 😊
报错代码如下
Processing featheresp32 (platform: espressif32; board: featheresp32; framework: arduino) -------------------------------------------------------------------------------- Tool Manager: Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5 Tool Manager: Error: Please read https://bit.ly/package-manager-ioerror Tool Manager: Warning! Package Mirror: HTTPSConnectionPool(host='dl.registry.ns3.platformio.org', port=443): Max retries exceeded with url: /tools/58/c9/d6f867f93b6e55491c200cb539274c8ae3dccf76daf29428aa64dd54d727/toolchain-xtensa-esp32-linux_x86_64-8.4.0+2021r2-patch5.tar.gz (Caused by ProxyError('Unable to connect to proxy', ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7cf79f596140>, 'Connection to fishros.org timed out. (connect timeout=10)')))是跟镜像问题相关吗?我在安装PlateformIO MicroROS开发环境前已经用一键安装命令更换了系统镜像源,并且根据视频教程【《ROS 2机器人开发从入门到实践》9.2.1开发平台介绍与安装】 https://www.bilibili.com/video/BV1pLf2YxEzv/?share_source=copy_web&vd_source=b55b762ce28a6ddb1537f871dc7d4a1d 配置完platformio.ini文件后,用
pio run编译运行时下载速度也特别慢。求各位大佬指点下解决方法。
如题,我自己整了个YDLIDAR X2激光雷达,用wifi发给电脑能收到,但是小鱼的雷达驱动的tcp通信无法解析,我想知道通信协议。
虚拟机使用VM,系统乌班图22.04
d05a7d8c-33b3-4f47-b9c4-22b0e579be28-image.png
ub@ub-virtual-machine:~/chapt6/chapt6_ws$ ros2 launch fishbot_description gazebo_sim.launch.py
[INFO] [launch]: All log files can be found below /home/ub/.ros/log/2025-07-16-20-10-55-594522-ub-virtual-machine-4590
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [4595]
[INFO] [gzserver-2]: process started with pid [4597]
[INFO] [gzclient-3]: process started with pid [4599]
[INFO] [spawn_entity.py-4]: process started with pid [4601]
[robot_state_publisher-1] [INFO] [1752667856.267970093] [robot_state_publisher]: got segment back_caster_link
[robot_state_publisher-1] [INFO] [1752667856.268156632] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1752667856.268172869] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1752667856.268181356] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1752667856.268188438] [robot_state_publisher]: got segment camera_optical_link
[robot_state_publisher-1] [INFO] [1752667856.268195597] [robot_state_publisher]: got segment front_caster_link
[robot_state_publisher-1] [INFO] [1752667856.268202887] [robot_state_publisher]: got segment imu_link
[robot_state_publisher-1] [INFO] [1752667856.268209962] [robot_state_publisher]: got segment laser_cylinder_link
[robot_state_publisher-1] [INFO] [1752667856.268216871] [robot_state_publisher]: got segment laser_link
[robot_state_publisher-1] [INFO] [1752667856.268223440] [robot_state_publisher]: got segment left_wheel_link
[robot_state_publisher-1] [INFO] [1752667856.268230619] [robot_state_publisher]: got segment right_wheel_link
[gzclient-3] Gazebo multi-robot simulator, version 11.10.2
[gzclient-3] Copyright (C) 2012 Open Source Robotics Foundation.
[gzclient-3] Released under the Apache 2 License.
[gzclient-3] http://gazebosim.org
[gzclient-3]
[gzserver-2] Gazebo multi-robot simulator, version 11.10.2
[gzserver-2] Copyright (C) 2012 Open Source Robotics Foundation.
[gzserver-2] Released under the Apache 2 License.
[gzserver-2] http://gazebosim.org
[gzserver-2]
[spawn_entity.py-4] [INFO] [1752667856.804856341] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1752667856.805229257] [spawn_entity]: Loading entity published on topic /robot_description
[spawn_entity.py-4] [INFO] [1752667856.807024211] [spawn_entity]: Waiting for entity xml on /robot_description
[gzserver-2] [Wrn] [gazebo_ros_init.cpp:178]
[gzserver-2] # # ####### ####### ### ##### #######
[gzserver-2] ## # # # # # # # #
[gzserver-2] # # # # # # # # #
[gzserver-2] # # # # # # # # #####
[gzserver-2] # # # # # # # # #
[gzserver-2] # ## # # # # # # #
[gzserver-2] # # ####### # ### ##### #######
[gzserver-2]
[gzserver-2] This version of Gazebo, now called Gazebo classic, reaches end-of-life
[gzserver-2] in January 2025. Users are highly encouraged to migrate to the new Gazebo
[gzserver-2] using our migration guides (https://gazebosim.org/docs/latest/gazebo_classic_migration?utm_source=gazebo_ros_pkgs&utm_medium=cli)
[gzserver-2]
[gzserver-2]
[spawn_entity.py-4] [INFO] [1752667856.911160252] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-4] [INFO] [1752667856.911831738] [spawn_entity]: Waiting for service /spawn_entity
[gzserver-2] [Msg] Waiting for master.
[gzserver-2] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gzserver-2] [Msg] Publicized address: 192.168.28.130
[gzserver-2] [Err] [RTShaderSystem.cc:480] Unable to find shader lib. Shader generating will fail. Your GAZEBO_RESOURCE_PATH is probably improperly set. Have you sourced <prefix>/share/gazebo/setup.bash?
[gzclient-3] [Msg] Waiting for master.
[gzclient-3] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gzclient-3] [Msg] Publicized address: 192.168.28.130
[gzclient-3] [Err] [RTShaderSystem.cc:480] Unable to find shader lib. Shader generating will fail. Your GAZEBO_RESOURCE_PATH is probably improperly set. Have you sourced <prefix>/share/gazebo/setup.bash?
[gzclient-3] [Wrn] [GuiIface.cc:120] Could not find the Qt platform plugin "wayland" in ""
[spawn_entity.py-4] [INFO] [1752667857.956423711] [spawn_entity]: Calling service /spawn_entity
[gzserver-2] [Msg] Loading world file [/home/ub/chapt6/chapt6_ws/install/fishbot_description/share/fishbot_description/world/custom_room.world]
[gzserver-2] [Err] [RenderEngine.cc:197] Failed to initialize scene
[gzserver-2] gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:728: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::rendering::Scene; typename boost::detail::sp_member_access<T>::type = gazebo::rendering::Scene*]: Assertion `px != 0' failed.
[ERROR] [gzserver-2]: process has died [pid 4597, exit code -6, cmd 'gzserver /home/ub/chapt6/chapt6_ws/install/fishbot_description/share/fishbot_description/world/custom_room.world --verbose -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so'].
[gzserver-2]
[gzclient-3] [Err] [Scene.cc:227] Service call[/shadow_caster_material_name] timed out
[gzclient-3] [Err] [Scene.cc:249] Service call[/shadow_caster_render_back_faces] timed out
[gzclient-3] [Err] [RenderEngine.cc:197] Failed to initialize scene
[gzclient-3] [Err] [GLWidget.cc:177] GLWidget could not create a scene. This will likely result in a blank screen.
[gzclient-3] gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:728: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::rendering::Camera; typename boost::detail::sp_member_access<T>::type = gazebo::rendering::Camera*]: 断言 "px != 0" 失败。
[ERROR] [gzclient-3]: process has died [pid 4599, exit code -6, cmd 'gzclient --gui-client-plugin=libgazebo_ros_eol_gui.so --verbose'].
[gzclient-3]
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-1] [INFO] [1752667879.936981925] [rclcpp]: signal_handler(signum=2)
[spawn_entity.py-4] Traceback (most recent call last):
[spawn_entity.py-4] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 372, in <module>
[spawn_entity.py-4] main()
[spawn_entity.py-4] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 367, in main
[spawn_entity.py-4] exit_code = spawn_entity_node.run()
[spawn_entity.py-4] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 228, in run
[spawn_entity.py-4] success = self._spawn_entity(entity_xml, initial_pose, spawn_service_timeout)
[spawn_entity.py-4] File "/opt/ros/humble/lib/gazebo_ros/spawn_entity.py", line 290, in _spawn_entity
[spawn_entity.py-4] rclpy.spin_once(self)
[spawn_entity.py-4] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/init.py", line 206, in spin_once
[spawn_entity.py-4] executor.spin_once(timeout_sec=timeout_sec)
[spawn_entity.py-4] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 751, in spin_once
[spawn_entity.py-4] self._spin_once_impl(timeout_sec)
[spawn_entity.py-4] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 740, in _spin_once_impl
[spawn_entity.py-4] handler, entity, node = self.wait_for_ready_callbacks(timeout_sec=timeout_sec)
[spawn_entity.py-4] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 723, in wait_for_ready_callbacks
[spawn_entity.py-4] return next(self._cb_iter)
[spawn_entity.py-4] File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 620, in _wait_for_ready_callbacks
[spawn_entity.py-4] wait_set.wait(timeout_nsec)
[spawn_entity.py-4] KeyboardInterrupt
[ERROR] [spawn_entity.py-4]: process has died [pid 4601, exit code -2, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -topic /robot_description -entity fishbot --ros-args'].
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 4595]
shaannj@shaannj-virtual-machine:~$ sudo apt install ros-humble-tf-transformations
[sudo] shaannj 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
下列【新】软件包将被安装:
ros-humble-tf-transformations
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 276 个软件包未被升级。
需要下载 19.6 kB 的归档。
解压缩后会消耗 110 kB 的额外空间。
错误:1 http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy/main amd64 ros-humble-tf-transformations amd64 1.1.0-1jammy.20250325.170033
404 Not Found [IP: 2402:f000:1:400::2 80]
E: 无法下载 http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/pool/main/r/ros-humble-tf-transformations/ros-humble-tf-transformations_1.1.0-1jammy.20250325.170033_amd64.deb 404 Not Found [IP: 2402:f000:1:400::2 80]
E: 有几个软件包无法下载,要不运行 apt-get update 或者加上 --fix-missing 的选项再试试?
如题,楼主的ubuntu安装在win11的wsl2上,
numpy是安装在win系统中的,
但是根据AI,一般来说ros2调用numpy,会直接链接到ubuntu之外的numpy即win上的那个。
然后楼主根据AI的建议,重新设置了这个链接。
楼主问AI结果如下:
708ffdef-2232-49d7-a35f-c289188fd931-image.png
重新设置的代码如下。
555e9364-eba2-492b-b4f1-f627cc0fbbd8-image.png
起因:楼主正在学小鱼教程里手搓python节点的练习,colcon和source都正常,也已经安装了numpy,但是ros2 run 的时候报错。报错内容如下。
ros2 run village_li li4_node
Traceback (most recent call last):
File "/root/town_ws/install/village_li/lib/village_li/li4_node", line 33, in <module>
sys.exit(load_entry_point('village_li==0.0.0', 'console_scripts', 'li4_node')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/town_ws/install/village_li/lib/python3.12/site-packages/village_li/li4.py", line 7, in main
li4_node = Node('li4') # 创建节点
^^^^^^^^^^^
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/node.py", line 240, in init
self._parameter_service = ParameterService(self)
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/parameter_service.py", line 35, in init
node.create_service(
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/node.py", line 1725, in create_service
check_is_valid_srv_type(srv_type)
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/type_support.py", line 51, in check_is_valid_srv_type
check_for_type_support(srv_type)
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/type_support.py", line 29, in check_for_type_support
msg_or_srv_type.class.import_type_support()
File "/opt/ros/jazzy/lib/python3.12/site-packages/rcl_interfaces/srv/_describe_parameters.py", line 527, in import_type_support
_describe_parameters.Metaclass_DescribeParameters_Event.import_type_support()
File "/opt/ros/jazzy/lib/python3.12/site-packages/rcl_interfaces/srv/_describe_parameters.py", line 341, in import_type_support
from service_msgs.msg import ServiceEventInfo
File "/opt/ros/jazzy/lib/python3.12/site-packages/service_msgs/msg/init.py", line 1, in <module>
from service_msgs.msg._service_event_info import ServiceEventInfo # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ros/jazzy/lib/python3.12/site-packages/service_msgs/msg/_service_event_info.py", line 18, in <module>
import numpy # noqa: E402, I100
^^^^^^^^^^^^
ModuleNotFoundError: No module named 'numpy'
[ros2run]: Process exited with failure 1
希望各位大神帮帮忙呀!小仙什么都会做的(跪