【问题标题】:could not find camera topic on rviz在 rviz 上找不到相机主题
【发布时间】:2021-09-30 07:20:50
【问题描述】:

我正在使用 demo.launch 在 ros 上启动 techman 机器人。第一次在rviz上启动它时,我可以按主题看到相机,并且可以看到视频输出。所以我编辑了 moveit 设置并为机器人添加了一些姿势。所以当我再次启动时。现在我找不到按主题的相机。我对 ros 很陌生。

以下是我的 demo.launch 文件

<launch>

  <!-- specify the planning pipeline -->
  <arg name="pipeline" default="ompl" />

  <!-- By default, we do not start a database (it can be large) -->
  <arg name="db" default="false" />
  <!-- Allow user to specify database location -->
  <arg name="db_path" default="$(find new_techman)/default_warehouse_mongo_db" />

  <!-- By default, we are not in debug mode -->
  <arg name="debug" default="false" />

  <!-- By default, we will load or override the robot_description -->
  <arg name="load_robot_description" default="true"/>

  <!-- Set execution mode for fake execution controllers -->
  <arg name="execution_type" default="interpolate" />

  <!--
  By default, hide joint_state_publisher's GUI

  MoveIt!'s "demo" mode replaces the real robot driver with the joint_state_publisher.
  The latter one maintains and publishes the current joint configuration of the simulated robot.
  It also provides a GUI to move the simulated robot around "manually".
  This corresponds to moving around the real robot without the use of MoveIt.
  -->
  <arg name="use_gui" default="false" />
  <arg name="use_rviz" default="true" />

  <!-- If needed, broadcast static tf for robot root -->


  <!-- We do not have a robot connected, so publish fake joint states -->
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" unless="$(arg use_gui)">
    <rosparam param="source_list">[move_group/fake_controller_joint_states]</rosparam>
  </node>
  <node name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" if="$(arg use_gui)">
    <rosparam param="source_list">[move_group/fake_controller_joint_states]</rosparam>
  </node>

  <!-- Given the published joint states, publish tf for the robot links -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen" />

  <!-- Run the main MoveIt! executable without trajectory execution (we do not have controllers configured by default) -->
  <include file="$(find new_techman)/launch/move_group.launch">
    <arg name="allow_trajectory_execution" value="true"/>
    <arg name="fake_execution" value="true"/>
    <arg name="execution_type" value="$(arg execution_type)"/>
    <arg name="info" value="true"/>
    <arg name="debug" value="$(arg debug)"/>
    <arg name="pipeline" value="$(arg pipeline)"/>
    <arg name="load_robot_description" value="$(arg load_robot_description)"/>
  </include>

  <!-- Run Rviz and load the default config to see the state of the move_group node -->
  <include file="$(find new_techman)/launch/moveit_rviz.launch" if="$(arg use_rviz)">
    <arg name="rviz_config" value="$(find new_techman)/launch/moveit.rviz"/>
    <arg name="debug" value="$(arg debug)"/>
  </include>

  <!-- If database loading was enabled, start mongodb as well -->
  <include file="$(find new_techman)/launch/default_warehouse_db.launch" if="$(arg db)">
    <arg name="moveit_warehouse_database_path" value="$(arg db_path)"/>
  </include>

</launch>

当我启动 moveit 设置助手创建的gazebo.launch 时,我可以看到相机从gazebo 平台进入rviz

【问题讨论】:

  • 使用“按显示类型”选项卡查找相机主题可能更容易,但似乎没有发布。你能分享你的启动文件吗?
  • 好的,我将编辑问题并在此处添加启动文件
  • 当你在上面时:你能不能也分享一下 -> 命令行输出,ROS 在启动文件执行时产生 -> rostopic list 的输出?
  • 我不确定我是否理解正确。当您启动gazebo.launch 时,您可以看到rviz 中的摄像头吗?那缺少什么? :D
  • 所以让我为您简要介绍一下。首先,我尝试在凉亭中创建一个世界,尝试将我的机器人添加到这个世界中。当我尝试机器人的某些部分没有正确导入时。所以我决定在rviz本身上创建一个世界并放置一些盒子。但是当我只启动两个 rviz 时。我看不到相机主题。一旦我在另一个终端上启动gazebo.launch。我可以看到相机上有一个主题正在发布。当我尝试将相机主题添加到 rviz 中时。我正在从凉亭世界获取相机输出。我无法从 rviz 平台中的机器人获取相机输出

标签: ros


【解决方案1】:

您是在启动demo.launch 之前还是之后启动了 Gazebo?换一种方式试试!

Gazebo 似乎提供了您的相机模拟。 Rviz 本身不会创建相机视图,它只是听一个主题,其中不同的引擎(通常是机器人,在您的情况下是 Gazebo 的机器人模拟)发布图像,然后向您显示这些图像。

Rviz 和 Gazebo 有时无法根据先启动的条件进行通信。

【讨论】:

  • 所以你的意思是我无法获得 rviz 平台的摄像头视图?只能查看凉亭的相机视图
  • 是的。 Rviz 是一种可视化工具,而不是模拟工具。凉亭是两者。 Rviz 可以向您展示机器人看到和知道的一切。在 Rviz 中构建一个世界有助于将机器人看到的一切与你对它所在世界的概念相匹配。由于你没有连接机器人,你需要一个模拟。 Gazebo 的行为就像您连接了一个机器人一样。将 Gazebo-World 想象成机器人所处的真实世界(并看到东西),将 Rviz-World 想象成你对那个世界的概念化。
  • 好吧,第一次谷歌点击告诉我我可能错了。我所描述的是默认配置,因为我认识的每个人都使用 Rviz(以及您可能如何配置 Rviz)。但实际上似乎有插件可以使 Rviz 成为模拟工具:roboticsknowledgebase.com/wiki/tools/stream-rviz
  • 这意味着我可以使用rviz平台进行仿真。但我的问题是为什么只有凉亭发布相机主题而 rviz 不发布相机主题
  • 是的。这是因为 Rviz 通常 可视化机器人(或类似凉亭的机器人模拟)产生的图像数据。显然,您可以让 Rviz 模拟相机,将该数据发布为 ROS 主题,然后再次读取和可视化该数据。但这需要一些额外的步骤。
猜你喜欢
  • 2021-10-01
  • 2014-06-11
  • 2020-07-08
  • 2018-03-03
  • 2021-04-21
  • 1970-01-01
  • 2022-07-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多