ROS探索总结(六)——使用smartcar进行仿真

  • 内容
  • 评论
  • 相关

        之前的博客中,我们使用rviz进行了TurtleBot的仿真,而且使用urdf文件建立了自己的机器人smartcar,本篇博客是将两者进行结合,使用smartcar机器人在rviz中进行仿真。

一、模型完善

        之前我们使用的都是urdf文件格式的模型,在很多情况下,ROS对urdf文件的支持并不是很好,使用宏定义的.xacro文件兼容性更好,扩展性也更好。所以我们把之前的urdf文件重新整理编写成.xacro文件。
        .xacro文件主要分为三部分:

1、机器人主体

  1. <?xml version="1.0"?>  
  2. <robot name="smartcar" xmlns:xacro="http://ros.org/wiki/xacro">  
  3.   <property name="M_PI" value="3.14159"/>  
  4.  
  5.   <!-- Macro for SmartCar body. Including Gazebo extensions, but does not include Kinect -->  
  6.   <include filename="$(find smartcar_description)/urdf/gazebo.urdf.xacro"/>  
  7.  
  8.   <property name="base_x" value="0.33" />  
  9.   <property name="base_y" value="0.33" />  
  10.  
  11.   <xacro:macro name="smartcar_body">  
  12.  
  13.  
  14.     <link name="base_link">  
  15.     <inertial>  
  16.       <origin xyz="0 0 0.055"/>  
  17.       <mass value="1.0" />  
  18.       <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
  19.     </inertial>  
  20.     <visual>  
  21.       <geometry>  
  22.         <box size="0.25 .16 .05"/>  
  23.       </geometry>  
  24.       <origin rpy="0 0 0" xyz="0 0 0.055"/>  
  25.       <material name="blue">  
  26.       <color rgba="0 0 .8 1"/>  
  27.       </material>  
  28.    </visual>  
  29.    <collision>  
  30.       <origin rpy="0 0 0" xyz="0 0 0.055"/>  
  31.       <geometry>  
  32.         <box size="0.25 .16 .05" />  
  33.       </geometry>  
  34.     </collision>  
  35.   </link>  
  36.  
  37.  
  38.  <link name="left_front_wheel">  
  39.     <inertial>  
  40.       <origin  xyz="0.08 0.08 0.025"/>  
  41.       <mass value="0.1" />  
  42.        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
  43.     </inertial>  
  44.     <visual>  
  45.       <geometry>  
  46.         <cylinder length=".02" radius="0.025"/>  
  47.       </geometry>  
  48.       <material name="black">  
  49.         <color rgba="0 0 0 1"/>  
  50.       </material>  
  51.     </visual>  
  52.     <collision>  
  53.       <origin rpy="0 1.57075 1.57075" xyz="0.08 0.08 0.025"/>  
  54.       <geometry>  
  55.          <cylinder length=".02" radius="0.025"/>  
  56.       </geometry>  
  57.     </collision>  
  58.   </link>  
  59.  
  60.   <joint name="left_front_wheel_joint" type="continuous">  
  61.     <axis xyz="0 0 1"/>  
  62.     <parent link="base_link"/>  
  63.     <child link="left_front_wheel"/>  
  64.     <origin rpy="0 1.57075 1.57075" xyz="0.08 0.08 0.025"/>  
  65.     <limit effort="100" velocity="100"/>  
  66.     <joint_properties damping="0.0" friction="0.0"/>  
  67.   </joint>  
  68.  
  69.   <link name="right_front_wheel">  
  70.     <inertial>  
  71.       <origin xyz="0.08 -0.08 0.025"/>  
  72.       <mass value="0.1" />  
  73.        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
  74.     </inertial>  
  75.     <visual>  
  76.       <geometry>  
  77.         <cylinder length=".02" radius="0.025"/>  
  78.       </geometry>  
  79.       <material name="black">  
  80.         <color rgba="0 0 0 1"/>  
  81.       </material>  
  82.     </visual>  
  83.     <collision>  
  84.       <origin rpy="0 1.57075 1.57075" xyz="0.08 -0.08 0.025"/>  
  85.       <geometry>  
  86.          <cylinder length=".02" radius="0.025"/>  
  87.       </geometry>  
  88.     </collision>  
  89.   </link>  
  90.  
  91.   <joint name="right_front_wheel_joint" type="continuous">  
  92.     <axis xyz="0 0 1"/>  
  93.     <parent link="base_link"/>  
  94.     <child link="right_front_wheel"/>  
  95.     <origin rpy="0 1.57075 1.57075" xyz="0.08 -0.08 0.025"/>  
  96.     <limit effort="100" velocity="100"/>  
  97.     <joint_properties damping="0.0" friction="0.0"/>  
  98.  </joint>  
  99.  
  100.  <link name="left_back_wheel">  
  101.     <inertial>  
  102.       <origin xyz="-0.08 0.08 0.025"/>  
  103.       <mass value="0.1" />  
  104.        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
  105.     </inertial>  
  106.     <visual>  
  107.       <geometry>  
  108.         <cylinder length=".02" radius="0.025"/>  
  109.       </geometry>  
  110.       <material name="black">  
  111.         <color rgba="0 0 0 1"/>  
  112.       </material>  
  113.    </visual>  
  114.    <collision>  
  115.        <origin rpy="0 1.57075 1.57075" xyz="-0.08 0.08 0.025"/>  
  116.       <geometry>  
  117.          <cylinder length=".02" radius="0.025"/>  
  118.       </geometry>  
  119.     </collision>  
  120.   </link>  
  121.  
  122.   <joint name="left_back_wheel_joint" type="continuous">  
  123.     <axis xyz="0 0 1"/>  
  124.     <parent link="base_link"/>  
  125.     <child link="left_back_wheel"/>  
  126.     <origin rpy="0 1.57075 1.57075" xyz="-0.08 0.08 0.025"/>  
  127.     <limit effort="100" velocity="100"/>  
  128.     <joint_properties damping="0.0" friction="0.0"/>  
  129.   </joint>  
  130.  
  131.   <link name="right_back_wheel">  
  132.     <inertial>  
  133.        <origin xyz="-0.08 -0.08 0.025"/>  
  134.        <mass value="0.1" />  
  135.        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
  136.     </inertial>  
  137.     <visual>  
  138.       <geometry>  
  139.         <cylinder length=".02" radius="0.025"/>  
  140.       </geometry>  
  141.       <material name="black">  
  142.         <color rgba="0 0 0 1"/>  
  143.       </material>  
  144.    </visual>  
  145.    <collision>  
  146.       <origin rpy="0 1.57075 1.57075" xyz="-0.08 -0.08 0.025"/>  
  147.       <geometry>  
  148.          <cylinder length=".02" radius="0.025"/>  
  149.       </geometry>  
  150.     </collision>  
  151.   </link>  
  152.  
  153.  
  154.   <joint name="right_back_wheel_joint" type="continuous">  
  155.     <axis xyz="0 0 1"/>  
  156.     <parent link="base_link"/>  
  157.     <child link="right_back_wheel"/>  
  158.     <origin rpy="0 1.57075 1.57075" xyz="-0.08 -0.08 0.025"/>  
  159.     <limit effort="100" velocity="100"/>  
  160.     <joint_properties damping="0.0" friction="0.0"/>  
  161.   </joint>  
  162.  
  163.   <link name="head">  
  164.     <inertial>  
  165.       <origin xyz="0.08 0 0.08"/>  
  166.       <mass value="0.1" />  
  167.       <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
  168.     </inertial>  
  169.     <visual>  
  170.       <geometry>  
  171.         <box size=".02 .03 .03"/>  
  172.       </geometry>  
  173.       <material name="white">  
  174.         <color rgba="1 1 1 1"/>  
  175.       </material>  
  176.      </visual>  
  177.      <collision>  
  178.       <origin xyz="0.08 0 0.08"/>  
  179.       <geometry>  
  180.          <cylinder length=".02" radius="0.025"/>  
  181.       </geometry>  
  182.     </collision>  
  183.   </link>  
  184.  
  185.   <joint name="tobox" type="fixed">  
  186.     <parent link="base_link"/>  
  187.     <child link="head"/>  
  188.     <origin xyz="0.08 0 0.08"/>  
  189.   </joint>  
  190.   </xacro:macro>  
  191.  
  192. </robot>

2、gazebo属性部分

  1. <?xml version="1.0"?>  
  2.  
  3. <robot xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"   
  4.     xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"   
  5.     xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"   
  6.     xmlns:xacro="http://ros.org/wiki/xacro"   
  7.     name="smartcar_gazebo">  
  8.  
  9. <!-- ASUS Xtion PRO camera for simulation -->  
  10. <!-- gazebo_ros_wge100 plugin is in kt2_gazebo_plugins package -->  
  11. <xacro:macro name="smartcar_sim">  
  12.     <gazebo reference="base_link">  
  13.         <material>Gazebo/Blue</material>  
  14.     </gazebo>  
  15.  
  16.     <gazebo reference="right_front_wheel">  
  17.         <material>Gazebo/FlatBlack</material>  
  18.     </gazebo>  
  19.  
  20.     <gazebo reference="right_back_wheel">  
  21.         <material>Gazebo/FlatBlack</material>  
  22.     </gazebo>  
  23.  
  24.     <gazebo reference="left_front_wheel">  
  25.         <material>Gazebo/FlatBlack</material>  
  26.     </gazebo>  
  27.  
  28.     <gazebo reference="left_back_wheel">  
  29.         <material>Gazebo/FlatBlack</material>  
  30.     </gazebo>  
  31.  
  32.     <gazebo reference="head">  
  33.         <material>Gazebo/White</material>  
  34.     </gazebo>  
  35.  
  36. </xacro:macro>  
  37.  
  38. </robot>

3、主文件

  1. <xml version="1.0"?>  
  2.  
  3. <robot name="smartcar"    
  4.     xmlns:xi="http://www.w3.org/2001/XInclude"  
  5.     xmlns:gazebo="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz"  
  6.     xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"  
  7.     xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"  
  8.     xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body"  
  9.     xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom"  
  10.     xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint"  
  11.     xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"  
  12.     xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"  
  13.     xmlns:rendering="http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering"  
  14.     xmlns:renderable="http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable"  
  15.     xmlns:physics="http://playerstage.sourceforge.net/gazebo/xmlschema/#physics"  
  16.     xmlns:xacro="http://ros.org/wiki/xacro">  
  17.  
  18.   <include filename="$(find smartcar_description)/urdf/smartcar_body.urdf.xacro" />  
  19.  
  20.   <!-- Body of SmartCar, with plates, standoffs and Create (including sim sensors) -->  
  21.   <smartcar_body/>  
  22.  
  23.   <smartcar_sim/>  
  24.  
  25. </robot>

二、lanuch文件

        在launch文件中要启动节点和模拟器。
  1. <launch>  
  2.     <param name="/use_sim_time" value="false" />  
  3.  
  4.     <!-- Load the URDF/Xacro model of our robot -->  
  5.     <arg name="urdf_file" default="$(find xacro)/xacro.py '$(find smartcar_description)/urdf/smartcar.urdf.xacro'" />  
  6.     <arg name="gui" default="false" />  
  7.  
  8.     <param name="robot_description" command="$(arg urdf_file)" />  
  9.     <param name="use_gui" value="$(arg gui)"/>  
  10.  
  11.     <node name="arbotix" pkg="arbotix_python" type="driver.py" output="screen">  
  12.         <rosparam file="$(find smartcar_description)/config/smartcar_arbotix.yaml" command="load" />  
  13.         <param name="sim" value="true"/>  
  14.     </node>  
  15.  
  16.     <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" >  
  17.     </node>  
  18.  
  19.     <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher">  
  20.         <param name="publish_frequency" type="double" value="20.0" />  
  21.     </node>  
  22.  
  23.      <!-- We need a static transforms for the wheels -->  
  24.     <node pkg="tf" type="static_transform_publisher" name="odom_left_wheel_broadcaster" args="0 0 0 0 0 0 /base_link /left_front_link 100" />  
  25.     <node pkg="tf" type="static_transform_publisher" name="odom_right_wheel_broadcaster" args="0 0 0 0 0 0 /base_link /right_front_link 100" />  
  26.  
  27.     <node name="rviz" pkg="rviz" type="rviz" args="-d $(find smartcar_description)/urdf.vcg" />  
  28. </launch>

三、仿真测试

        首先运行lanuch,既可以看到rviz中的机器人:

roslaunch smartcar_description smartcar_display.rviz.launch
 
         发布一条动作的消息。
rostopic pub -r 10 /cmd_vel geometry_msgs/Twist '{linear: {x: 0.5, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0.5}}'

 

四、节点关系


----------------------------------------------------------------


原创文章,转载请注明: 转载自古月居

本文链接地址: ROS探索总结(六)——使用smartcar进行仿真

微信 OR 支付宝 扫描二维码
为本文作者 打个赏
pay_weixinpay_weixin

评论

49条评论
  1. Gravatar 头像

    勤奋 回复

    这里面的effor什么意思呀

    • 古月

      古月 回复

      @勤奋 力,参考:http://wiki.ros.org/pr2_controller_manager/safety_limits

  2. Gravatar 头像

    颜正杰 回复

    你好,古月大神,我在输入roslaunch smartcar_description smartcar_display.rviz.launch时候,出现了错误:
    Traceback (most recent call last):
    File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/__init__.py", line 225, in main
    args = rlutil.resolve_launch_arguments(args)
    File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/rlutil.py", line 92, in resolve_launch_arguments
    resolved = roslib.packages.find_resource(args[0], args[1])
    File "/opt/ros/indigo/lib/python2.7/dist-packages/roslib/packages.py", line 495, in find_resource
    pkg_path = rospack.get_path(pkg)
    File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 201, in get_path
    self._update_location_cache()
    File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 184, in _update_location_cache
    list_by_path(self._manifest_name, path, cache)
    File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 67, in list_by_path
    root = ElementTree(None, os.path.join(d, PACKAGE_FILE))
    File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 611, in __init__
    self.parse(file)
    File "", line 38, in parse
    ParseError: not well-formed (invalid token): line 11, column 16

  3. Gravatar 头像

    颜正杰 回复

    你好,我输入roslaunch smartcar_description smartcar_display.rviz.launch时候,rviz里面出现Global Status:Error。机器人只有一个长方体外壳。
    终端出现错误:
    ERROR: cannot launch node of type [arbotix_python/arbotix_driver]: arbotix_python
    ROS path [0]=/opt/ros/indigo/share/ros
    ROS path [1]=/home/yan/catkin_ws/src
    ROS path [2]=/opt/ros/indigo/share
    ROS path [3]=/opt/ros/indigo/stacks

    • 古月

      古月 回复

      @颜正杰 arbotix使用apt-get安装,下新版的代码,参考:http://download.csdn.net/detail/darkmoonkiller/9662483

      • Gravatar 头像

        颜正杰 回复

        @古月 你好,古月大神,我是新手,我想问问你当时遇到编译错误时候,百度都百度不出来的时候,一般是通过什么途径解决问题的呀?

          • Gravatar 头像

            小杰 回复

            @古月 古月大哥,你是用什么翻墙软件的呀?

              • Gravatar 头像

                小杰 回复

                @古月 古月大哥,你是在ubuntu下装对的Lantern翻墙软件,还是在windows下装的呀,有没有安装教程呀?

                • 古月

                  古月 回复

                  @小杰 windows里装的,也可以在ubuntu下用,安装不麻烦,网上找一下吧

  4. Gravatar 头像

    天空 回复

    你好,我运行一下出现这样的错误,我也没找到问题所在,能给我指导一下么?
    $ roslaunch smartcar_description smartcar_display.rviz.launch
    ... logging to /home/hello/.ros/log/6624798c-1f4e-11e7-a491-142d2744960f/roslaunch-hello-7860.log
    Checking log directory for disk usage. This may take awhile.
    Press Ctrl-C to interrupt
    Done checking log file disk usage. Usage is <1GB.

    DEPRECATED IN HYDRO:
    The tag should be prepended with 'xacro' if that is the intended use
    of it, such as . Use the following script to fix incorrect
    xacro includes:
    sed -i 's/<include/<xacro:include/g' `find . -iname *.xacro`
    DEPRECATED IN HYDRO:
    The tag should be prepended with 'xacro' if that is the intended use
    of it, such as . Use the following script to fix incorrect
    xacro includes:
    sed -i 's/<include/<xacro:include/g' `find . -iname *.xacro`
    error loading tag:
    file does not exist [/home/hello/catkin_ws/src/smartcar_description/config/smartcar_arbotix.yaml]
    XML is
    The traceback for the exception was written to the log file

    • 古月

      古月 回复

      @天空 你好,这篇博客是是在ROS fuerte版本上实现的,现在的ROS版本标签和命名有一些变化。另外smartcar_arbotix.yaml这个文件有么

      • Gravatar 头像

        天空 回复

        @古月 你好,我现在也遇到这个问题了,怎么解决呢,从哪里能下载到这个文件呢?

        • 古月

          古月 回复

          @天空 参考:http://download.csdn.net/detail/darkmoonkiller/9662483

      • Gravatar 头像

        落叶 回复

        @古月 你好,我现在也遇到这个问题了,怎么解决呢,从哪里能下载到这个文件呢?

        • 古月

          古月 回复

          @落叶 参考:http://download.csdn.net/detail/darkmoonkiller/9662483

  5. Gravatar 头像

    ROS 新手 回复

    你好,我在启动launch是出现错误,不知道怎么解决,能帮忙看一下么?
    hello@h:~/catkin_ws/src$ roslaunch smartcar_description smartcar.urdf.xacro
    ... logging to /home/hello/.ros/log/2651efac-1ead-11e7-822b-142d2744960f/roslaunch-h-3781.log
    Checking log directory for disk usage. This may take awhile.
    Press Ctrl-C to interrupt
    Done checking log file disk usage. Usage is <1GB.

    xacro: Traditional processing is deprecated. Switch to --inorder processing!
    To check for compatibility of your document, use option --check-order.
    For more infos, see http://wiki.ros.org/xacro#Processing_Order
    No such file or directory: /home/hello/catkin_ws/src/smartcar_description/urdf/smartcar.urdf.xacro
    XacroException('No such file or directory: /home/hello/catkin_ws/src/smartcar_description/urdf/smartcar.urdf.xacro',)
    Invalid tag: Cannot load command parameter [robot_description]: command [/opt/ros/jade/share/xacro/xacro.py '/home/hello/catkin_ws/src/smartcar_description/urdf/smartcar.urdf.xacro'] returned with code [2].

    Param xml is
    The traceback for the exception was written to the log file

  6. Gravatar 头像

    ROS新手 回复

    博主,您好!请问smartcar是如何订阅/cmd_vel话题并实现移动控制的?在仿真环境下,如何让自己搭建的机器人订阅指定的话题?谢谢!

      • Gravatar 头像

        ROS新手 回复

        @古月 理解了 😎 ,多谢博主!

    • Gravatar 头像

      肖朋振 回复

      @ROS新手 博主好,运行roslaunch smartcar_description base.urdf.rviz.launch gui:=true后我遇到了如下问题:[display.rviz.launch] is neither a launch file in package [smartcar_description] nor is [smartcar_description] a launch file name
      The traceback for the exception was written to the log file
      我的是indigo版本。下载了http://download.csdn.net/detail/darkmoonkiller/9662483的之后该怎么用呢?

  7. Gravatar 头像

    仿真 回复

    你好,我使用indigo,一直提示Could not find the 'robot' element in the xml file,请问是什么原因

  8. Gravatar 头像

    ___上官___ 回复

    DEPRECATED IN HYDRO:
    The tag should be prepended with 'xacro' if that is the intended use
    of it, such as . Use the following script to fix incorrect
    xacro includes:
    sed -i 's/<include/<xacro:include/g' `find . -iname *.xacro`
    DEPRECATED IN HYDRO:
    The tag should be prepended with 'xacro' if that is the intended use
    of it, such as . Use the following script to fix incorrect
    xacro includes:
    sed -i 's/<include/<xacro:include/g' `find . -iname *.xacro`
    error loading tag:
    file does not exist [/home/exbot/che/src/smartcar_description/config/smartcar_arbotix.yaml]
    XML is
    The traceback for the exception was written to the log file
    这是怎么个情况啊 😥 😥 😥

    • 古月

      古月 回复

      @___上官___ ROS版本的问题,把“include”那个地方改成“xacro:include”试一下

  9. Gravatar 头像

    owlboy 回复

    你好,我用的indigo,根据你的文章稍作了些修改,rviz正确显示了小车,但最后发布topic时候,小车不动,请问是什么原因啊?谢谢!

    • Gravatar 头像

      owlboy 回复

      @owlboy 启动后的打印信息如下:
      exbot@ubuntu:~/catkin_ws/src/smartcar_description$ roslaunch smartcar_description smartcar_display.rviz.launch
      ... logging to /home/exbot/.ros/log/51912d8a-44e8-11e6-8d54-000c29a778a5/roslaunch-ubuntu-8041.log
      Checking log directory for disk usage. This may take awhile.
      Press Ctrl-C to interrupt
      Done checking log file disk usage. Usage is <1GB.

      started roslaunch server http://ubuntu:54813/

      SUMMARY
      ========

      CLEAR PARAMETERS
      * /arbotix/

      PARAMETERS
      * /arbotix/baud: 115200
      * /arbotix/controllers/base_controller/Kd: 12
      * /arbotix/controllers/base_controller/Ki: 0
      * /arbotix/controllers/base_controller/Ko: 50
      * /arbotix/controllers/base_controller/Kp: 12
      * /arbotix/controllers/base_controller/accel_limit: 1.0
      * /arbotix/controllers/base_controller/base_frame_id: base_footprint
      * /arbotix/controllers/base_controller/base_width: 0.26
      * /arbotix/controllers/base_controller/ticks_meter: 4100
      * /arbotix/controllers/base_controller/type: diff_controller
      * /arbotix/port: /dev/ttyUSB0
      * /arbotix/rate: 20
      * /arbotix/read_rate: 20
      * /arbotix/sim: True
      * /arbotix/sync_read: True
      * /arbotix/sync_write: True
      * /arbotix/write_rate: 20
      * /robot_description: <?xml version="1....
      * /robot_state_publisher/publish_frequency: 20.0
      * /rosdistro: indigo
      * /rosversion: 1.11.20
      * /use_gui: False
      * /use_sim_time: False

      NODES
      /
      arbotix (arbotix_python/arbotix_driver)
      joint_state_publisher (joint_state_publisher/joint_state_publisher)
      odom_left_wheel_broadcaster (tf/static_transform_publisher)
      odom_right_wheel_broadcaster (tf/static_transform_publisher)
      robot_state_publisher (robot_state_publisher/state_publisher)
      rviz (rviz/rviz)

      auto-starting new master
      process[master]: started with pid [8056]
      ROS_MASTER_URI=http://localhost:11311

      setting /run_id to 51912d8a-44e8-11e6-8d54-000c29a778a5
      process[rosout-1]: started with pid [8069]
      started core service [/rosout]
      process[arbotix-2]: started with pid [8081]
      process[joint_state_publisher-3]: started with pid [8089]
      process[robot_state_publisher-4]: started with pid [8090]
      process[odom_left_wheel_broadcaster-5]: started with pid [8091]
      process[odom_right_wheel_broadcaster-6]: started with pid [8110]
      process[rviz-7]: started with pid [8129]
      [INFO] [WallTime: 1467967528.741809] ArbotiX being simulated.
      [INFO] [WallTime: 1467967528.847522] Started DiffController (base_controller). Geometry: 0.26m wide, 4100.0 ticks/m.

    • Gravatar 头像

      owlboy 回复

      @owlboy 搞了半天没搞定,网上查了一下,又加了个odometry_publisher看看能不能解决,结果在没有发布topic时候,小车就在转。。。

      • 古月

        古月 回复

        @owlboy 启动信息没有问题,看一下节点关系图,是不是有哪个地方没连接对

      • Gravatar 头像

        宅先生 回复

        @owlboy 你好,我也是能显示小车,但是rostopic小车不动,怎么解决的?谢谢

    • Gravatar 头像

      youandmefree 回复

      @owlboy 你好,你是怎么修改代码的的,我修改代码,rviz一直显示不了小车,网上找了很多资料说是bug,我的版本也是indigo,如果有可能,可以把你的那个功能包或者那个urdf和launch文件发给我一份吗?我的邮箱是youandmefree@163.com

      • Gravatar 头像

        DingXu 回复

        @youandmefree 你好,我也是同样的问题,请问可以分享一下代码吗?谢谢!2550087706@qq.com

  10. Gravatar 头像

    刹那清英 回复

    您好,古月。我是ROS 初学者,在写urdf文件和xacro文件里的代码时,所有代码都是敲进去的(去除复制粘贴的),这样效率真的很低。我想问一下有没有辅助写代码的工具,就像VS里写C代码时,写了几个关键字母,会提示剩余部分,这样方便编写。

    • 古月

      古月 回复

      @刹那清英 你好,我一般用vim,可以根据之前的关键字自动匹配提示,装一个插件就可以,可能其他的IDE也有这个功能。

    • Gravatar 头像

      刹那清英 回复

      @刹那清英 非常感谢,没想到还有插件可以用。我想问一下,您知不知道有关ROS 探讨交流的QQ群呢。

  11. Gravatar 头像

    天羽军 回复

    您好,我是一个新手,正在学习您的教程,想请教一下本章中“urdf文件重新整理编写成.xacro文件”,,这是怎么实现的。

    • 古月

      古月 回复

      @天羽军 你好,xacro也是一种urdf模型的文件,支持的功能更多。你可以参考链接:http://wiki.ros.org/urdf/Tutorials/Using%20Xacro%20to%20Clean%20Up%20a%20URDF%20File

  12. Gravatar 头像

    木木 回复

    您好,我正在学习您的教程,收货颇丰,非常感谢!但是有个问题想请教您,您在launch文件中启动了joint_state_publisher节点,不启动此节点,urdf模型无法在Rviz中显示,但是在《ROS BY Example 1》书当中并没有启动那个节点,但是模型依旧能够在Rviz中显示,这是为什么?谢谢

    • 古月

      古月 回复

      @木木 没有joint_state_publisher应该也是可以显示的,这个例程比较久了,有时间我需要运行一下看看。

发表评论

电子邮件地址不会被公开。 必填项已用*标注