鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    9.5.5完成机器人导航并建图出现问题(使用串口进行连接,后面显示这个)

    已定时 已固定 已锁定 已移动
    VIP问答专区
    建图 建图失败 建图导航
    2
    9
    466
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 1
      1117 年度VIP
      最后由 编辑

      li@ubantu:~/chapt9/microros_ws$ ros2 launch bringup bringup.launch.py
      [INFO] [launch]: All log files can be found below /home/li/.ros/log/2025-04-15-01-28-25-394866-ubantu-4599
      [INFO] [launch]: Default logging verbosity is set to INFO
      [INFO] [joint_state_publisher-1]: process started with pid [4601]
      [INFO] [robot_state_publisher-2]: process started with pid [4603]
      [INFO] [odom2tf-3]: process started with pid [4605]
      [INFO] [micro_ros_agent-4]: process started with pid [4624]
      [robot_state_publisher-2] [INFO] [1744651705.590238505] [robot_state_publisher]: got segment base_footprint
      [robot_state_publisher-2] [INFO] [1744651705.590380034] [robot_state_publisher]: got segment base_link
      [robot_state_publisher-2] [INFO] [1744651705.590393148] [robot_state_publisher]: got segment laser_link
      [micro_ros_agent-4] [1744651706.006637] info | TermiosAgentLinux.cpp | init | running... | fd: 3
      [micro_ros_agent-4] [1744651706.007247] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 6
      [joint_state_publisher-1] [INFO] [1744651706.257693092] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic...
      [INFO] [ydlidar_node-5]: process started with pid [4652]
      [ydlidar_node-5] [INFO] [1744651711.305964413] [ydlidar_node]: [YDLIDAR INFO] Current ROS Driver Version: 1.0.1
      [ydlidar_node-5]
      [ydlidar_node-5] [2025-04-15 01:28:31][info] SDK initializing
      [ydlidar_node-5] [2025-04-15 01:28:31][info] SDK has been initialized
      [ydlidar_node-5] [2025-04-15 01:28:31][info] SDK Version: 1.2.9
      [ydlidar_node-5] [2025-04-15 01:28:31][info] Connect elapsed time 10 ms
      [ydlidar_node-5] [2025-04-15 01:28:31][info] Lidar successfully connected [/dev/ttyUSB1:115200]
      [ydlidar_node-5] [2025-04-15 01:28:31][info] Lidar running correctly! The health status good
      [ydlidar_node-5] [2025-04-15 01:28:31][info] Current Lidar Model Code 12
      [ydlidar_node-5] [2025-04-15 01:28:31][info] Check status, Elapsed time 0 ms
      [ydlidar_node-5] [2025-04-15 01:28:31][info] Lidar init success, Elapsed time [12]ms
      [ydlidar_node-5] [2025-04-15 01:28:31][info] Start to getting intensity flag
      [ydlidar_node-5] [2025-04-15 01:28:33][info] [YDLIDAR] End to getting intensity flag
      [ydlidar_node-5] [2025-04-15 01:28:33][info] [YDLIDAR] Create thread 0x41800640
      [ydlidar_node-5] [2025-04-15 01:28:33][info] Successed to start scan mode, Elapsed time 2537 ms
      [ydlidar_node-5] [2025-04-15 01:28:34][error] Timeout count: 1
      [ydlidar_node-5] [2025-04-15 01:28:35][error] Timeout count: 2
      [ydlidar_node-5] [2025-04-15 01:28:36][error] Timeout count: 3
      [ydlidar_node-5] [2025-04-15 01:28:38][error] Check Sum 0x202A != 0x6878
      [ydlidar_node-5] [2025-04-15 01:28:39][error] Timeout count: 1
      [ydlidar_node-5] [2025-04-15 01:28:40][error] Check Sum 0x6B1A != 0x7812
      [ydlidar_node-5] [2025-04-15 01:28:40][error] Timeout count: 2
      [ydlidar_node-5] [2025-04-15 01:28:41][error] Timeout count: 1
      [ydlidar_node-5] [2025-04-15 01:28:42][error] Check Sum 0x5D90 != 0x02CD
      [ydlidar_node-5] [2025-04-15 01:28:42][error] Timeout count: 2
      [ydlidar_node-5] [2025-04-15 01:28:43][error] Timeout count: 3
      [ydlidar_node-5] [2025-04-15 01:28:44][error] Failed to turn on the Lidar, because the lidar is [Device Failed].
      [ydlidar_node-5] [INFO] [1744651724.497044306] [ydlidar_node]: [YDLIDAR INFO] Now YDLIDAR is stopping .......
      [INFO] [ydlidar_node-5]: process has finished cleanly [pid 4652]
      [ydlidar_node-5]

      13316a64-d4fb-4b6a-baa7-1985c2d8a1dc-image.png
      我改完后的launch.py如下:
      import launch
      import launch_ros
      from ament_index_python.packages import get_package_share_directory
      from launch.launch_description_sources import PythonLaunchDescriptionSource

      def generate_launch_description():
      bringup_dir = get_package_share_directory(
      'bringup')
      ydlidar_ros2_dir = get_package_share_directory(
      'ydlidar')

      urdf2tf = launch.actions.IncludeLaunchDescription(
          PythonLaunchDescriptionSource(
              [bringup_dir, '/launch', '/urdf2tf.launch.py']),
      )
      
      odom2tf = launch_ros.actions.Node(
          package='bringup',
          executable='odom2tf',
          output='screen'
      )
      
      microros_agent = launch_ros.actions.Node(
          package='micro_ros_agent',
          executable='micro_ros_agent',
          arguments=[
              'serial',                 # 切换为串口模式
              '-b', '115200',           # 波特率参数(需字符串类型)
              '--dev', '/dev/ttyUSB1',  # 设备路径
              '-v6'                     # 日志详细级别
          ],
          output='screen'              # 保持终端输出可见
      )
      
      ydlidar = launch.actions.IncludeLaunchDescription(
          PythonLaunchDescriptionSource(
              [ydlidar_ros2_dir, '/launch', '/ydlidar_launch.py']),
      )
      
      # 使用 TimerAction 启动后 5 秒执行 ydlidar 节点
      ydlidar_delay = launch.actions.TimerAction(period=5.0, actions=[ydlidar])
      
      return launch.LaunchDescription([
          urdf2tf,
          odom2tf,
          microros_agent,
          ydlidar_delay
      ])
      

      不知道是什么原因,该怎么修改呢?
      后面单独运行这个ros2 launch ydlidar ydlidar_launch.py显示如下(上一章节显示点云成功了的)
      li@ubantu:~/chapt9/microros_ws$ ros2 launch ydlidar ydlidar_launch.py
      [INFO] [launch]: All log files can be found below /home/li/.ros/log/2025-04-15-01-32-03-185276-ubantu-4693
      [INFO] [launch]: Default logging verbosity is set to INFO
      [INFO] [ydlidar_node-1]: process started with pid [4704]
      [ydlidar_node-1] [INFO] [1744651923.991974545] [ydlidar_node]: [YDLIDAR INFO] Current ROS Driver Version: 1.0.1
      [ydlidar_node-1]
      [ydlidar_node-1] [2025-04-15 01:32:03][info] SDK initializing
      [ydlidar_node-1] [2025-04-15 01:32:03][info] SDK has been initialized
      [ydlidar_node-1] [2025-04-15 01:32:03][info] SDK Version: 1.2.9
      [ydlidar_node-1] [2025-04-15 01:32:03][info] Connect elapsed time 6 ms
      [ydlidar_node-1] [2025-04-15 01:32:03][info] Lidar successfully connected [/dev/ttyUSB1:115200]
      [ydlidar_node-1] [2025-04-15 01:32:03][info] Lidar running correctly! The health status good
      [ydlidar_node-1] [2025-04-15 01:32:03][info] Current Lidar Model Code 12
      [ydlidar_node-1] [2025-04-15 01:32:03][info] Check status, Elapsed time 1 ms
      [ydlidar_node-1] [2025-04-15 01:32:04][info] Lidar init success, Elapsed time [8]ms
      [ydlidar_node-1] [2025-04-15 01:32:04][info] Start to getting intensity flag
      [ydlidar_node-1] [2025-04-15 01:32:05][info] [YDLIDAR] End to getting intensity flag
      [ydlidar_node-1] [2025-04-15 01:32:05][info] [YDLIDAR] Create thread 0xB9400640
      [ydlidar_node-1] [2025-04-15 01:32:05][error] Check Sum 0xFA01 != 0x0520
      [ydlidar_node-1] [2025-04-15 01:32:06][info] Successed to start scan mode, Elapsed time 2073 ms
      [ydlidar_node-1] [2025-04-15 01:32:06][error] Timeout count: 1
      [ydlidar_node-1] [2025-04-15 01:32:07][error] Timeout count: 2
      [ydlidar_node-1] [2025-04-15 01:32:08][error] Timeout count: 3
      [ydlidar_node-1] [2025-04-15 01:32:11][error] Timeout count: 1
      [ydlidar_node-1] [2025-04-15 01:32:12][error] Timeout count: 2
      [ydlidar_node-1] [2025-04-15 01:32:13][error] Timeout count: 3
      [ydlidar_node-1] [2025-04-15 01:32:15][error] Timeout count: 1
      [ydlidar_node-1] [2025-04-15 01:32:16][error] Failed to turn on the Lidar, because the lidar is [Device Failed].
      [ydlidar_node-1] [INFO] [1744651936.529456617] [ydlidar_node]: [YDLIDAR INFO] Now YDLIDAR is stopping .......
      [INFO] [ydlidar_node-1]: process has finished cleanly [pid 4704]
      [ydlidar_node-1]

      1 小鱼小 2 条回复 最后回复 回复 引用 0
      • 1
        1117 年度VIP @1117
        最后由 编辑

        @1117 为啥不成功建图··呢?然后有时候显示这个508272ef-fb9b-4af2-ab1f-edf5a7500a0f-image.png

        小鱼小 1 条回复 最后回复 回复 引用 0
        • 小鱼小
          小鱼 技术大佬 @1117
          最后由 编辑

          @1117 在 9.5.5完成机器人导航并建图出现问题(使用串口进行连接,后面显示这个) 中说:

          [ydlidar_node-5] [2025-04-15 01:28:36][error] Timeout count: 3
          [ydlidar_node-5] [2025-04-15 01:28:38][error] Check Sum 0x202A != 0x6878
          [ydlidar_node-5] [2025-04-15 01:28:39][error] Timeout count: 1
          [ydlidar_node-5] [2025-04-15 01:28:40][error] Check Sum 0x6B1A != 0x7812
          [ydlidar_node-5] [2025-04-15 01:28:40][error] Timeout count: 2
          [ydlidar_node-5] [2025-04-15 01:28:41][error] Timeout count: 1
          [ydlidar_node-5] [2025-04-15 01:28:42][error] Check Sum 0x5D90 != 0x02CD
          [ydlidar_node-5] [2025-04-15 01:28:42][error] Timeout count: 2
          [ydlidar_node-5] [2025-04-15 01:28:43][error] Timeout count: 3
          [ydlidar_node-5] [2025-04-15 01:28:44][error] Failed to turn on the Lidar, because the lidar is [Device Failed].
          [ydlidar_node-5] [INFO] [1744651724.497044306] [ydlidar_node]: [YDLIDAR INFO] Now YDLIDAR is stopping .......
          [INFO] [ydlidar_node-5]: process has finished cleanly [pid 4652]

          像是雷达部分没有正常输出 /scan 话题

          新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

          1 1 条回复 最后回复 回复 引用 0
          • 小鱼小
            小鱼 技术大佬 @1117
            最后由 编辑

            @1117 检查下网络连接,网络结构

            新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

            1 1 条回复 最后回复 回复 引用 0
            • 1
              1117 年度VIP @小鱼
              最后由 编辑

              @小鱼 有/scan话题,鱼哥

              1 条回复 最后回复 回复 引用 0
              • 1
                1117 年度VIP @小鱼
                最后由 编辑

                @小鱼 那我晚点儿再试试换一下网络,但是我是用树莓派4b通过串口和雷达转接板和esp控制板。鱼哥,应该怎么样才是正确的呢?我有点儿疑惑,比如说哪些要改,我这个改了babac1e9-9f25-4d0b-a63e-dc08483e8ca9-image.png ,然后雷达参数那边也是改了,然后有雷达话题,雷达数据可以可视化,但是我运行建图的时候找不到图,就像鱼哥你第九章倒数第二节的那个,就是没有,不知道什么原因唉,有点儿发愁

                小鱼小 1 条回复 最后回复 回复 引用 0
                • 小鱼小
                  小鱼 技术大佬 @1117
                  最后由 编辑

                  @1117 用树meipai就走串口模式驱动雷达吧

                  新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

                  1 1 条回复 最后回复 回复 引用 0
                  • 1
                    1117 年度VIP @小鱼
                    最后由 编辑

                    @小鱼 鱼哥·,我就是串口驱动雷达的,我wifi不行,但是无法建图就不知道是什么原因了,我是有点云数据的,可以在rviz2里面显示出来

                    小鱼小 1 条回复 最后回复 回复 引用 0
                    • 小鱼小
                      小鱼 技术大佬 @1117
                      最后由 编辑

                      @1117 主控板走串口模式需要提高波特率,115200 卡数据

                      新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

                      1 条回复 最后回复 回复 引用 0
                      • 第一个帖子
                        最后一个帖子
                      皖ICP备16016415号-7
                      Powered by NodeBB | 鱼香ROS