RVIZ未发布相机主题 [英] rviz not publishing the camera topic

查看:8
本文介绍了RVIZ未发布相机主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望rviz上的机器人发布相机主题。而不是露台。因为我在Gazebo平台上生成机器人时遇到了一些错误。但我不知道为什么在RVIZ平台上启动机器人时没有发布相机主题。

<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>

这是我的rviz启动文件

推荐答案

但我不知道为什么在rviz平台上启动机器人没有发布相机主题。

这很简单:因为Rviz是一个可视化工具,最初不是为模拟虚拟环境而设计的。换句话说:它可以向你展示机器人看到了什么,但它不会假装机器人。发布相机主题基本上意味着Rviz中的可视化机器人假装自己看到了什么:Rviz世界。

因为我在Gazebo Platform中生成机器人时遇到错误。

除了Rviz,Gazebo是模拟机器人以及设计模拟机器人摄像头可以看到和发布的环境的非常好的选择。如果你在生产机器人时遇到困难,你可能应该寻找解决方法,而不是试图使用Rviz作为模拟工具。


但似乎确实有一种使用Rviz进行模拟的方法,如here所述:

rviz_camera_stream发布在rviz中渲染的图像。它是内置的 至少是翡翠,但很可能在水力发电和蓝宝石中工作,并遵循 向后分叉通向预絮接版本。

需要输入CAMERA_INFO来获取摄像头的内部特性和分辨率。 失真系数被忽略,但类似IMAGE_PROC的节点 实现http://code.opencv.org/issues/1387可以解决这个问题 在下游。(露台摄像头还支持失真吗? http://gazebosim.org/tutorials?tut=ca..。说5.0版可以)

在rviz中设置输入CAMERA_INFO主题和输出图像主题 插件图形用户界面。

旧建议:

一种老套的解决方案是运行屏幕抓取节点 http://wiki.ros.org/screengrab_ros并将rviz窗口定位为 因此,尽管它将非常脆弱,很难通过发射实现自动化 文件。

这篇关于RVIZ未发布相机主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆