ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

A couple of quick things I noticed:

You should not have inertial components on your base link. Instead make a dummy base link and a static joint. Replace your base_link definition with this:

<!-- Required Base Link -->
<link name="base_link"/>

<!-- Body link -->
<link name="body_link">
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <box size="${base_length} ${base_width} ${base_height}"/>
    </geometry>
    <material name="green" />
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <box size="${base_length} ${base_width} ${base_height}"/>
    </geometry>
  </collision>
  <xacro:solid_cuboid_inertial 
      rpy="0 0 0" xyz="0 0 0"
      mass="${base_mass}"
      x="${base_length}" y="${base_width}" z="${base_height}" />
</link>

<!-- A joint to connect the body to the base_link -->
<joint name="body_joint" type="fixed">
  <origin xyz="0 0 0" rpy="0 0 0" />
  <parent link="base_link"/>
  <child link="body_link"/>
</joint>

You won't be able to pass just the xacro to rosparam using rosparam load <myxacro.urdf.xacro> robot_description because a xacro file is not a valid robot description. It needs to be processed into a urdf (which is what your launchfile is doing with <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>

Speaking of that command, you can remove the --inorder flag as that has been the default for a couple distributions now.

Your materials.xacro is missing an end tag for </robot> (at least in this posting, maybe not in your actual code)

In RVIZ, your robot description topic is no longer just robot_description because you are grouping into a namespace in your launchfile. Try replacing that with the full param path /bicycle_bot/robot_description

If you are still running into errors, please run a rosrun xacro xacro path/to/bicycle_bot.urdf.xacro and make sure the robot description is generated without errors (it will print the resulting urdf to screen).

Hope this helps!

EDIT: After playing a bit with the git repo, I am pretty sure you just need to change the Robot Description topic source in rviz. Solution to this is bolded in answer below.

A couple of quick things I noticed:

You should not have inertial components on your base link. Instead make a dummy base link and a static joint. Replace your base_link definition with this:

<!-- Required Base Link -->
<link name="base_link"/>

<!-- Body link -->
<link name="body_link">
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <box size="${base_length} ${base_width} ${base_height}"/>
    </geometry>
    <material name="green" />
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <box size="${base_length} ${base_width} ${base_height}"/>
    </geometry>
  </collision>
  <xacro:solid_cuboid_inertial 
      rpy="0 0 0" xyz="0 0 0"
      mass="${base_mass}"
      x="${base_length}" y="${base_width}" z="${base_height}" />
</link>

<!-- A joint to connect the body to the base_link -->
<joint name="body_joint" type="fixed">
  <origin xyz="0 0 0" rpy="0 0 0" />
  <parent link="base_link"/>
  <child link="body_link"/>
</joint>

You won't be able to pass just the xacro to rosparam using rosparam load <myxacro.urdf.xacro> robot_description because a xacro file is not a valid robot description. It needs to be processed into a urdf (which is what your launchfile is doing with <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>

Speaking of that command, you can remove the --inorder flag as that has been the default for a couple distributions now.

Your materials.xacro is missing an end tag for </robot> (at least in this posting, maybe not in your actual code)

In RVIZ, your robot description topic is no longer just robot_description because you are grouping into a namespace in your launchfile. Try replacing that with the full param path /bicycle_bot/robot_description

If you are still running into errors, please run a rosrun xacro xacro path/to/bicycle_bot.urdf.xacro and make sure the robot description is generated without errors (it will print the resulting urdf to screen).

Hope this helps!