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

    自定义主题发布Path消息不可在rviz显示,运行ros2 topic echo报warning

    已定时 已固定 已锁定 已移动 未解决
    ROS 2相关问题
    ros2 nav2 rviz2不显示
    1
    1
    324
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 10520957131
      Spike
      最后由 编辑

      求助大佬们:
      主题发布如下

      self.path_pub = self.create_publisher(Path,"/path_my_A_star", 10 )
      
          
      
          def publisher_path(self):
              print('Start Publishing the msg!!!')
              time = 1
              y1 = []
              y2 = []
              for i in range(self.path_map.shape[1]):
                  current_time = self.get_clock().now().to_msg()
                  current_pose = PoseStamped()
                  current_pose.pose.position.x, current_pose.pose.position.y= self.mapToWorld(self.path_map[0][i], self.path_map[0][i])
                  y1.append(self.mapToWorld(self.path_map[0][i], self.path_map[0][i])[0])
                  y2.append(self.mapToWorld(self.path_map[0][i], self.path_map[0][i])[1])
                  current_pose.pose.position.z = 0.0
                  current_pose.pose.orientation.x = 0.0
                  current_pose.pose.orientation.y = 0.0
                  current_pose.pose.orientation.z = 0.0
                  current_pose.pose.orientation.w = 1.0
                  time += 1
                  self.current_path.header.stamp = current_time
                  self.current_path.header.frame_id = "odom"
                  self.current_path.poses.append(current_pose)
                  self.path_pub.publish(self.current_path)
                  self.last_time = current_time
              
              print('Finish Publishing the msg!')
      
      
      

      rviz并不显示path
      eaa6a295-47ab-4c58-a26d-6cd2f5ec12a2-1678103451849.png
      由于rviz无法显示path轨迹,利用topic echo检看msg但是结果如下

      peter@ubuntu:~$ ros2 topic echo /path_my_A_starh
      WARNING: topic [/path_my_A_starh] does not appear to be published yet
      Could not determine the type for the passed topic
      
      1 条回复 最后回复 回复 引用 0
      • 10520957131 1052095713 将这个主题转为问答主题,在
      • 第一个帖子
        最后一个帖子
      皖ICP备16016415号-7
      Powered by NodeBB | 鱼香ROS