Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

Surface properties won't take effect in xacro

I have been using RotorS simulator to simulate drones. For our purpose we need to look into the collision behavior, and thus make changes to the surface properties. However, my change to surface properties won't take effect. The model will go back to its default value when simulation starts. For now I have been manually editing the surface properties within gazebo, but I would like to fix this.

  <xacro:macro name="multirotor_base_macro"
params="robot_namespace mass body_width body_height use_mesh_file mesh_file *inertia">
<link name="${robot_namespace}/base_link"></link>

<joint name="${robot_namespace}/base_joint" type="fixed">
  <origin xyz="0 0 0" rpy="0 0 0" />
  <parent link="${robot_namespace}/base_link" />
  <child link="${robot_namespace}/base_link_inertia" />

<link name="${robot_namespace}/base_link_inertia">
    <mass value="${mass}" />  <!-- [kg] -->
    <origin xyz="0 0 0" />
    <xacro:insert_block name="inertia" />

    <origin xyz="0 0 0" rpy="0 0 0" />
      <xacro:if value="${use_mesh_file}">
        <mesh filename="${mesh_file}" scale="1 1 1" />
      <xacro:unless value="${use_mesh_file}">
        <box size="${body_width} ${body_width} ${body_height}"/>

    <origin xyz="0 0 0" rpy="0 0 0" />
      <mesh filename="${collision_file}" scale="1 1 1" />
        <ode mu="0.4" mu2="0.4" />
      <bounce restitution_coefficient="0.7" threshold="0.1" />
        <ode max_vel="10.00"  />

  <plugin filename="librotors_gazebo_multirotor_base_plugin.so" name="multirotor_base_plugin">


I am unsure where I made mistakes. The drone is able to spawn correctly.