首页 > 其他 > 详细

Melodic 使用URDF创建简单的机器人模型

时间:2020-02-28 14:56:23      阅读:303      评论:0      收藏:0      [点我收藏+]

本人Linux版本:Ubuntu 18.04LTS

ROS版本:Melodic

URDF代码

<?xml version="1.0" ?>
<robot name="mbot">
    <link name="base_link">
        <visual>
            <origin xyz=" 0 0 0" rpy="0 0 0" />     
            <geometry>
                <cylinder length="0.16" radius="0.20"/>  
            </geometry>
            <material name="yellow">
                <color rgba="1 0.4 0 1"/>      <!--A代表透明度-->           
            </material>
        </visual>
    </link>
</robot>

launch文件

<launch>
    <param name="robot_description" textfile="$(find mbot_description)/urdf/mbot_base.urdf" />

    <!-- 设置GUI参数,显示关节控制插件 -->
    <param name="use_gui" value="true"/>
    
    <!-- 运行joint_state_publisher节点,发布机器人的关节状态  -->
    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
    
    <!-- 运行robot_state_publisher节点,发布tf  -->
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
    
    <!-- 运行rviz可视化界面 -->
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find mbot_description)/config/mbot_urdf.rviz" required="true" />
</launch>

 

会有以下报错

[WARN] [1582867522.390661]: The use_gui parameter was specified, which is deprecated.  Well attempt to find and run the GUI, but if this fails you should install the joint_state_publisher_gui package instead and run that.  This backwards compatibility option will be removed in Noetic.
[ERROR] [1582867522.392212]: Could not find the GUI, install the joint_state_publisher_gui package
[joint_state_publisher-2] process has died [pid 9056, exit code 1, cmd /opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/vtas/.ros/log/b6cbe59e-59ea-11ea-b2f1-84ef181f5770/joint_state_publisher-2.log].
log file: /home/vtas/.ros/log/b6cbe59e-59ea-11ea-b2f1-84ef181f5770/joint_state_publisher-2*.log

 

主要解决办法如下:

 

1、joint_state_publisher_gui是刚更新出来的包,需要把之前的joint_state_publisher换成joint_state_publisher_gui

         sudo apt-get install ros-melodic-joint-state-publisher-gui   

         如果是kinetic版本的

  sudo apt-get install ros-kinetic-joint-state-publisher-gui

2、URDF文件中不能有中文注释,删除掉中文注释;

 

然后再运行就可以成功打开了。

但是还是存在一个warning

[WARN] [1582868994.395547]: The use_gui parameter was specified, which is deprecated.  Well attempt to find and run the GUI, but if this fails you should install the joint_state_publisher_gui package instead and run that.  This backwards compatibility option will be removed in Noetic.

希望看到的人提供一个解决思路,不胜感激。

Melodic 使用URDF创建简单的机器人模型

原文:https://www.cnblogs.com/vtas-Yao/p/12376939.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!