ros2+gazebo+urdf:ros2机器人使用gazebo的urdf文件中的<gazebo>部分官网资料

原文链接SDFormat extensions to URDF (the 'gazebo' tag) — Documentation

注意了ros2的gazebo部分已经跟ros1的gazebo部分不一样了:

Toggle navigation 

SDFormat

  • Specification
  • API
  • Documentation
  • Download

Back

Edit                  Version: 1.6           


Table of Contents
  • SDFormat extensions to URDF (the <gazebo> tag)
    • <gazebo> Elements For <robot>
    • <gazebo> Elements For Links
    • Special meaning for <visual>, <collision>, and <material>
      • <gazebo> Elements For Joints
      • Fixed joint lumping

SDFormat extensions to URDF (the <gazebo> tag)

When URDF files are loaded by Gazebo (both Gazebo-classic and the new Gazebo), the URDF content is first converted to SDFormat before being processed by Gazebo. Users who want to modify the resulting SDFormat output to include SDFormat specific elements may do so using the <gazebo> tag in the original URDF file. This is known as the Gazebo extension to the URDF specification (see urdf/XML/Gazebo - ROS Wiki)

The URDF to SDFormat conversion usually happens automatically without users observing the resulting SDFormat file. To diagnose any issues that might come up during the conversion, the tool

gz sdf -p <path to urdf file>

can be used to convert the URDF file to SDFormat that can be inspected by the user.

The following is the documentation of the various tags available under <gazebo> and their corresponding effect on the SDFormat output. While some of the content included here is also available in the "Using a URDF in Gazebo" tutorial of Gazebo-classic, this document should provide a more complete discussion of the extension, especially regarding fixed joint lumping.

<gazebo> Elements For <robot>

<gazebo> tag without a reference attribute applies to the SDFormat <model> that gets generated from the <robot> URDF tag. All elements in the <gazebo> tag are inserted into the SDF <model> tag for the generated SDF.

urdf文件内不带reference属性的<gazebo>转换为sdf文件内<model>标签

Example:

<?xml version='1.0' encoding='UTF-8'?>
<!--URDF-->
<robot name='no_ref_example'>
  <link name='world'/>
  <gazebo>
    <static>true</static>
    <plugin name='testPlugin' filename='testFileName'/>
  </gazebo>
</robot>

results in:

<!--SDFormat-->
<sdf version='1.9'>
  <model name='no_ref_example'>
    <static>true</static>
    <plugin name='testPlugin' filename='testFileName'/>
  </model>
</sdf>

When using the <gazebo> extension for links, the name of the link has to be specified in the reference attribute. (gazebo标签内的reference属性需要填写joint名称例如laser或camera或base等)There are a number of special tags that modify the values of elements or attributes in the generated SDFormat file. Any tag that is not listed in the table below will be directly inserted into the corresponding <link> element in the SDFormat output. This direct insertion is sometimes referred to as blob insertion.所有不在下表中列出的标签例如<plugin>标签,都会被直接插入sdf文件,原样插入。例如urdf内<plugin>,在sdf文件内还是<plugin>,不变。当然表格里面的需要改变

Table of elements with special meaning:

NameTypeDescriptionCorresponding SDFormat element
turnGravityOffboolA value of "true" turns gravity off. Alternatively, gravity (with opposite boolean value) can be used via blob insertiongravity
dampingFactordoubleExponential velocity decay of the link velocity - takes the value and multiplies the previous link velocity by (1-dampingFactor).velocity_decay/linear and velocity_decay/angular
maxVeldoubleMaximum contact correction velocity truncation term. (See the Gazebo-classic tutorial on Constraints Parameters for more detail)collision/surface/contact/ode/max_vel
minDepthdoubleMinimum allowable depth before contact correction impulse is applied. (See the Gazebo-classic tutorial on Constraints Parameters for more detail)collision/surface/contact/ode/min_depth
mu1doubleFriction coefficients μ for the principal contact directions along the contact surface as defined by the Open Dynamics Engine (ODE) (see parameter descriptions in ODE's user guide and the Gazebo-classic tutorial on Friction Parameters for more detail)collision/surface/friction/ode/mu
mu2collision/surface/friction/ode/mu2
fdir1vector3-tuple specifying direction of mu1 in the collision local reference frame. (See the Gazebo-classic tutorial on Friction Parameters for more detail)collision/surface/friction/ode/fdir1
kpdoubleContact stiffness k_p and damping k_d for rigid body contacts as defined by ODE (ODE uses erp and cfm but there is a mapping between erp/cfm and stiffness/damping. Also see See the Gazebo-classic tutorial on Contact Parameters for more detail)collision/surface/contact/ode/kp
kdcollision/surface/contact/ode/kd
selfCollideboolIf true, the link can collide with other links in the model.self_collide
maxContactsintMaximum number of contacts allowed between two entities. This value overrides the max_contacts element defined in physics.(See the Gazebo-classic tutorial on Contact Parameters for more detail)collision/max_contacts
laserRetrodoubleIntensity value returned by laser sensor.collision/laser_retro
visualelementThe content of the element will be inserted into each visual of the SDFormat linkvisual
materialelementThe content of the element will be inserted into each material of the SDFormat linkvisual/material
collisionelementThe content of the element will be inserted into each collision of the SDFormat linkcollision

Note: The XPath used in the "Corresponding SDFormat element" column is relative to the link element.

Example:

The following shows how to set the first coefficient of friction for all <collision> elements in a link

<?xml version='1.0' encoding='UTF-8'?>
<!--URDF-->
<robot name='friction_example'>
  <link name='base_link'>
    <inertial>
      <mass value='0.12' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <collision>
      <geometry>
        <sphere radius="2"/>
      </geometry>
    </collision>
    <collision>
      <geometry>
        <cylinder radius="1" length="2"/>
      </geometry>
    </collision>
  </link>
  <gazebo reference='base_link'>
    <mu1>0.25</mu1>
  </gazebo>
</robot>

This creates the element //surface/friction/ode/mu in the collision element of the referenced link.

<!--SDFormat-->
<sdf version='1.9'>
  <model name='friction_example'>
    <link name='base_link'>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.12</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
      <collision name='base_link_collision'>
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>2</radius>
          </sphere>
        </geometry>
        <surface>
          <contact>
            <ode/>
          </contact>
          <friction>
            <ode>
              <mu>0.25</mu>
            </ode>
          </friction>
        </surface>
      </collision>
      <collision name='base_link_collision_1'>
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <cylinder>
            <length>2</length>
            <radius>1</radius>
          </cylinder>
        </geometry>
        <surface>
          <contact>
            <ode/>
          </contact>
          <friction>
            <ode>
              <mu>0.25</mu>
            </ode>
          </friction>
        </surface>
      </collision>
    </link>
  </model>
</sdf>

Special meaning for <visual><collision>, and <material>

The <visual> and <collision> are meant to update existing visuals and collisions in the URDF as they get converted to SDFormat. At the time of writing, these tags do not insert new visuals or collision elements into the referenced link. Note also that these tags affect all visuals and collisions, respectively, found in the referenced link.

Example:

Given the following URDF file with two visuals, the <gazebo> extension applies the element <transparency> to each visual in base_link.

<?xml version='1.0' encoding='UTF-8'?>
<!--URDF-->
<robot name='visual_example'>
  <link name='base_link'>
    <inertial>
      <mass value='0.12' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <visual>
      <geometry>
        <sphere radius="2"/>
      </geometry>
    </visual>
    <visual>
      <origin xyz="2 0 0" rpy="0 0 0"/>
      <geometry>
        <cylinder length="1" radius="2"/>
      </geometry>
    </visual>
  </link>
  <gazebo reference='base_link'>
    <visual>
      <transparency>0.25</transparency>
    </visual>
  </gazebo>
</robot>

Converts to the following SDFormat

<!--SDFormat-->
<sdf version='1.9'>
  <model name='visual_example'>
    <link name='base_link'>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.12</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
      <visual name='base_link_visual'>
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>2</radius>
          </sphere>
        </geometry>
        <transparency>0.25</transparency>
      </visual>
      <visual name='base_link_visual_1'>
        <pose>2 0 0 0 0 0</pose>
        <geometry>
          <cylinder>
            <length>1</length>
            <radius>2</radius>
          </cylinder>
        </geometry>
        <transparency>0.25</transparency>
      </visual>
    </link>
  </model>
</sdf>

The <material> tag, when used directly under the <gazebo> tag, i.e //gazebo/material, accepts a string value of the name of a material defined in a Gazebo-classic's material script. Examples include colors like Gazebo/SkyBlue as well as textures such as Gazebo/WoodFloor. The <material> tag affects all visuals found in the referenced link, similar to the behavior of <visual> and <collision>

Example:

<?xml version='1.0' encoding='UTF-8'?>
<!--URDF-->
<robot name='material_example'>
  <link name='base_link'>
    <inertial>
      <mass value='0.1' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <visual>
      <geometry>
        <sphere radius="2"/>
      </geometry>
    </visual>
  </link>
  <gazebo reference='base_link'>
    <material>Gazebo/Orange</material>
  </gazebo>
</robot>

results in:

<!--SDFormat-->
<sdf version='1.9'>
  <model name='material_example'>
    <link name='base_link'>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.10000000000000001</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
      <visual name='base_link_visual'>
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>2</radius>
          </sphere>
        </geometry>
        <material>
          <script>
            <name>Gazebo/Orange</name>
            <uri>file://media/materials/scripts/gazebo.material</uri>
          </script>
        </material>
      </visual>
    </link>
  </model>
</sdf>

This tag is only relevant when using Gazebo-classic as the new version of Gazebo does not use material scripts. However, it is still possible to change the appearance of visuals that is compatible with the new Gazebo and this is by using the //gazebo/visual/material tag. Note the difference from the previous tag as the <material> tag is not directly under <gazebo>, but under <visual>. This <material> tag contains child elements as defined in the material specification.

Example:

<?xml version='1.0' encoding='UTF-8'?>
<!--URDF-->
<robot name='material_example'>
  <link name='base_link'>
    <inertial>
      <mass value='0.12' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <visual>
      <geometry>
        <sphere radius="2"/>
      </geometry>
    </visual>
  </link>
  <gazebo reference='base_link'>
    <visual>
      <material>
        <diffuse>0 0 1 1 </diffuse>
      </material>
    </visual>
  </gazebo>
</robot>

results in:

<!--SDFormat-->
<sdf version='1.9'>
  <model name='material_example'>
    <link name='base_link'>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.12</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
      <visual name='base_link_visual'>
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>2</radius>
          </sphere>
        </geometry>
        <material>
          <diffuse>0 0 1 1</diffuse>
        </material>
      </visual>
    </link>
  </model>
</sdf>

where the <diffuse> tag has been added to the visual of base_link.

Warning: At the time of writing, there is a bug in the URDF to SDFormat converter that behaves incorrectly when <visual> and <collision> tags in the URDF file have names.

<gazebo> Elements For Joints

When using the <gazebo> extension for joints, the name of the joint has to be specified in the reference attribute. There are a number of special tags that modify the values of elements or attributes in the generated SDFormat file. Any tag that is not listed in the table below will be directly inserted into the corresponding <joint> element in the SDFormat output.

Table of elements with special meaning:

NameTypeDescriptionCorresponding SDFormat element
stopCfmdoubleJoint stop constraint force mixing (cfm) and error reduction parameter (erp) used by ODEphysics/ode/limit/cfm
stopErpphysics/ode/limit/erp
provideFeedbackboolAllows joints to publish their wrench data (force-torque) via a Gazebo pluginphysics/provide_feedback and physics/ode/provide_feedback
implicitSpringDamperboolIf this flag is set to true, ODE will use ERP and CFM to simulate damping. This is a more stable numerical method for damping than the default damping tag. The cfmDamping element is deprecated and should be changed to implicitSpringDamper.physics/ode/implicit_spring_damper
springStiffnessdoubleSpring stiffness in N/m.axis/dynamics/spring_stiffness
springReferencedoubleEquilibrium position for the spring.axis/dynamics/spring_reference
fudgeFactordoubleScale the excess for in a joint motor at joint limits. Should be between zero and one.physics/ode/fudge_factor
preserveFixedJointboolBy default, fixed joints in the URDF are "lumped", meaning that the contents of the child link are merged with the parent link with appropriate pose offsets and the joint is discarded. Setting this to true preserves the fixed joint and effectively disables fixed joint lumping.
disableFixedJointLumpingboolBy default, fixed joints in the URDF are "lumped", meaning that the contents of the child link are merged with the parent link with appropriate pose offsets and the joint is discarded. Setting this to true disables fixed joint lumping. This has a similar effect as preserveFixedJoint but, for backward compatibility reasons, replaces the fixed joint with a revolute joint with position limits set to 0. Users are encouraged to use preserveFixedJoint instead.

Note: The XPath used in the "Corresponding SDFormat element" column is relative to the joint element.

Example: The spring reference and stiffness of a joint can be set using <springReference> and <springStiffness> respectively.

<?xml version='1.0' encoding='UTF-8'?>
<!--URDF-->
<robot name='joint_example'>
  <link name='base_link'>
    <inertial>
      <mass value='0.12' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
  </link>
  <joint name='j1' type='continuous'>
    <parent link='base_link'/>
    <child link='end_effector'/>
    <origin xyz='0 0 1' rpy='0 0 0'/>
  </joint>
  <link name='end_effector'>
    <inertial>
      <mass value='0.12' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
  </link>
  <gazebo reference='j1'>
    <springReference>0.5</springReference>
    <springStiffness>0.25</springStiffness>
  </gazebo>
</robot>

This creates the elements //axis/dynamics/spring_reference and //axis/dynamics//spring_stiffness in the referenced joint of the SDFormat output.

<!--SDFormat-->
<sdf version='1.9'>
  <model name='joint_example'>
    <link name='base_link'>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.12</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
    </link>
    <joint name='j1' type='revolute'>
      <pose relative_to='base_link'>0 0 1 0 0 0</pose>
      <parent>base_link</parent>
      <child>end_effector</child>
      <axis>
        <xyz>1 0 0</xyz>
        <limit>
          <lower>-10000000000000000</lower>
          <upper>10000000000000000</upper>
        </limit>
        <dynamics>
          <spring_reference>0.5</spring_reference>
          <spring_stiffness>0.25</spring_stiffness>
        </dynamics>
      </axis>
      <physics>
        <ode>
          <limit>
            <cfm>0</cfm>
            <erp>0.20000000000000001</erp>
          </limit>
        </ode>
      </physics>
    </joint>
    <link name='end_effector'>
      <pose relative_to='j1'>0 0 0 0 0 0</pose>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.12</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
    </link>
  </model>
</sdf>

Fixed joint lumping

Fixed joint lumping (aka joint reduction), in the URDF to SDFormat conversion is the process of taking the child link of a fixed joint and merging all of its contents into the parent link. It is an optimization that benefits maximal coordinate physics engines by reducing the number of constraints needed to simulate the model. The process preserves the total mass of the two links and computes the center of mass and moment of inertia of the resultant link. All visual and collision elements present in the child link are moved to the parent link with appropriate pose offsets. The fixed joint itself is discarded and does not appear in the SDFormat output. As of libsdformat 9.9.0 frame elements that represent the discarded joint and child link are generated to preserve their pose information.

Fixed joint lumping is enabled by default, but can be disabled by setting preserveFixedJoint or disableFixedJointLumping to true. The two parameters behave similarly, but the preserveFixedJoint=true configuration results in a joint with a fixed type whereas the disableFixedJointLumping=true configuration results in a revolute joint with position limits set to 0. Note that when both preserveFixedJoint=true and disableFixedJointLumping=true are set on a joint, the preserveFixedJoint setting will take precedence and the resulting joint will have a fixed type. Fixed joint lumping can also be disabled for all joints if ParserConfig::URDFPreserveFixedJoint is true.

Warning: Disabling joint lumping should only be done when both parent and child links have positive mass and corresponding <inertial> elements.

Example: The following URDF demonstrates fixed joint lumping where the resulting SDFormat output only has one link

<?xml version='1.0' encoding='UTF-8'?>
<!--URDF-->
<robot name='fixed_joint_lumping_example'>
  <link name='base_link'>
    <inertial>
      <mass value='0.25' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <sphere radius="2"/>
      </geometry>
    </collision>
  </link>
  <joint name='j1' type='fixed'>
    <parent link='base_link'/>
    <child link='end_effector'/>
    <origin xyz='0 0 1' rpy='0 0 0'/>
  </joint>
  <link name='end_effector'>
    <inertial>
      <mass value='0.25' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <visual>
      <origin xyz="2 0 0" rpy="0 0 0"/>
      <geometry>
        <cylinder length="1" radius="2"/>
      </geometry>
    </visual>
  </link>
</robot>

results in:

<!--SDFormat-->
<sdf version='1.9'>
  <model name='fixed_joint_lumping_example'>
    <link name='base_link'>
      <inertial>
        <pose>0 0 0.5 0 0 0</pose>
        <mass>0.5</mass>
        <inertia>
          <ixx>0.14499999999999999</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.14499999999999999</iyy>
          <iyz>0</iyz>
          <izz>0.02</izz>
        </inertia>
      </inertial>
      <collision name='base_link_collision'>
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>2</radius>
          </sphere>
        </geometry>
      </collision>
      <visual name='base_link_fixed_joint_lump__end_effector_visual'>
        <pose>2 0 1 0 0 0</pose>
        <geometry>
          <cylinder>
            <length>1</length>
            <radius>2</radius>
          </cylinder>
        </geometry>
      </visual>
    </link>
    <frame name='j1' attached_to='base_link'>
      <pose>0 0 1 0 -0 0</pose>
    </frame>
    <frame name='end_effector' attached_to='j1'/>
  </model>
</sdf>

Note that the mass of base_link is the sum of the masses of the original base_link and end_effector links. The visual element of end_effector has been merged into base_link with a pose value that takes into account the pose of the original end_effector link and joint j1 as well as the pose of the original visual.

Example: The same example above is repeated, but fixed joints preserved (preserveFixedJoint=true).

<?xml version='1.0' encoding='UTF-8'?>
<!--URDF-->
<robot name='preserve_fixed_joint_lumping_example'>
  <link name='base_link'>
    <inertial>
      <mass value='0.25' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <sphere radius="2"/>
      </geometry>
    </collision>
  </link>
  <joint name='j1' type='fixed'>
    <parent link='base_link'/>
    <child link='end_effector'/>
    <origin xyz='0 0 1' rpy='0 0 0'/>
  </joint>
  <link name='end_effector'>
    <inertial>
      <mass value='0.25' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <visual>
      <origin xyz="2 0 0" rpy="0 0 0"/>
      <geometry>
        <cylinder length="1" radius="2"/>
      </geometry>
    </visual>
  </link>
  <gazebo reference='j1'>
    <preserveFixedJoint>true</preserveFixedJoint>
  </gazebo>
</robot>

results in:

<!--SDFormat-->
<sdf version='1.9'>
  <model name='preserve_fixed_joint_lumping_example'>
    <link name='base_link'>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.25</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
      <collision name='base_link_collision'>
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>2</radius>
          </sphere>
        </geometry>
      </collision>
    </link>
    <joint name='j1' type='fixed'>
      <pose relative_to='base_link'>0 0 1 0 0 0</pose>
      <parent>base_link</parent>
      <child>end_effector</child>
      <axis>
        <dynamics>
          <spring_reference>0</spring_reference>
          <spring_stiffness>0</spring_stiffness>
        </dynamics>
        <xyz>0 0 1</xyz>
        <limit>
          <lower>-10000000000000000</lower>
          <upper>10000000000000000</upper>
        </limit>
      </axis>
      <physics>
        <ode>
          <limit>
            <cfm>0</cfm>
            <erp>0.20000000000000001</erp>
          </limit>
        </ode>
      </physics>
    </joint>
    <link name='end_effector'>
      <pose relative_to='j1'>0 0 0 0 0 0</pose>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.25</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
      <visual name='end_effector_visual'>
        <pose>2 0 0 0 0 0</pose>
        <geometry>
          <cylinder>
            <length>1</length>
            <radius>2</radius>
          </cylinder>
        </geometry>
      </visual>
    </link>
  </model>
</sdf>

Here, the link end_effector is still present in the SDFormat output with mass and inertia equal to the URDF end_effector link. The visual of end_effector is also still present in the end_effector link of the SDFormat output. The joint j1 is also still present and its type is fixed.

Example: The same example above is repeated, but with fixed joint lumping disabled (disableFixedJointLumping=true).

<?xml version='1.0' encoding='UTF-8'?>
<!--URDF-->
<robot name='disable_fixed_joint_lumping_example'>
  <link name='base_link'>
    <inertial>
      <mass value='0.25' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <sphere radius="2"/>
      </geometry>
    </collision>
  </link>
  <joint name='j1' type='fixed'>
    <parent link='base_link'/>
    <child link='end_effector'/>
    <origin xyz='0 0 1' rpy='0 0 0'/>
  </joint>
  <link name='end_effector'>
    <inertial>
      <mass value='0.25' />
      <inertia ixx='0.01' ixy='0' ixz='0' iyy='0.01' iyz='0' izz='0.01' />
    </inertial>
    <visual>
      <origin xyz="2 0 0" rpy="0 0 0"/>
      <geometry>
        <cylinder length="1" radius="2"/>
      </geometry>
    </visual>
  </link>
  <gazebo reference='j1'>
    <disableFixedJointLumping>true</disableFixedJointLumping>
  </gazebo>
</robot>

results in:

<!--SDFormat-->
<sdf version='1.9'>
  <model name='disable_fixed_joint_lumping_example'>
    <link name='base_link'>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.25</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
      <collision name='base_link_collision'>
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>2</radius>
          </sphere>
        </geometry>
      </collision>
    </link>
    <joint name='j1' type='revolute'>
      <pose relative_to='base_link'>0 0 1 0 0 0</pose>
      <parent>base_link</parent>
      <child>end_effector</child>
      <axis>
        <limit>
          <lower>0</lower>
          <upper>0</upper>
        </limit>
        <dynamics>
          <damping>0</damping>
          <friction>0</friction>
          <spring_reference>0</spring_reference>
          <spring_stiffness>0</spring_stiffness>
        </dynamics>
        <xyz>0 0 1</xyz>
      </axis>
      <physics>
        <ode>
          <limit>
            <cfm>0</cfm>
            <erp>0.20000000000000001</erp>
          </limit>
        </ode>
      </physics>
    </joint>
    <link name='end_effector'>
      <pose relative_to='j1'>0 0 0 0 0 0</pose>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.25</mass>
        <inertia>
          <ixx>0.01</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.01</iyy>
          <iyz>0</iyz>
          <izz>0.01</izz>
        </inertia>
      </inertial>
      <visual name='end_effector_visual'>
        <pose>2 0 0 0 0 0</pose>
        <geometry>
          <cylinder>
            <length>1</length>
            <radius>2</radius>
          </cylinder>
        </geometry>
      </visual>
    </link>
  </model>
</sdf>

The output is the same as preserveFixedJoint=true example, execept that joint j1 has a revolute type.

©2020 Open Source Robotics Foundation

SDFormat is open-source licensed under 

Apache 2.0

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/268821.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

我在代码随想录|写代码Day-Day之总结篇

我是用笔手写的我觉得这样可以对个人记忆会更好,而且理解更深解释也更清楚 下面是手写笔记 总结部分----- 第一章 二分 二分模版 图片可能反了下不过没有关系 图形打印模版题 第二章 链表 链表基本操作和疑问 链表代码操作和解析----5大操作 删除部分 对结点的操作 反了反了…

关于个人Git学习记录及相关

前言 可以看一下猴子都能懂的git入门&#xff0c;图文并茂不枯燥 猴子都能懂的git入门 学习东西还是建议尽可能的去看官方文档 权威且详细 官方文档 强烈建议看一下GitHub漫游指南及开源指北&#xff0c;可以对开源深入了解一下&#xff0c;打开新世界的大门&#xff01; …

若依SQL Server开发使用教程

1. sys_menu表中的将菜单ID修改为自动ID,解决不能增加菜单的问题&#xff0c;操作流程如下&#xff1a; 解决方案如下 菜单栏->工具->选项 点击设计器&#xff0c;去掉阻止保存要求更新创建表的更改选项&#xff0c;点确认既可以保存了 2 自动生成代码找不表的解决方案…

C语言--直接插入排序【排序算法|图文详解】

一.直接插入排序介绍&#x1f357; 直接插入排序又叫简单插入排序&#xff0c;是一种简单直观的排序算法&#xff0c;它通过构建有序序列&#xff0c;对于未排序的数据&#xff0c;在已排序序列中从后向前扫描&#xff0c;找到相应位置并插入。 算法描述&#xff1a; 假设要排序…

idea 找不到 Free MyBatis plugin

idea 找不到 free mybatis plugin 可以使用mybatisX替换&#xff1a; 插件安装成功后&#xff0c;重启idea。

【English】水果单词小小汇总~~

废物研究生&#xff0c;只要不搞科研干啥都是开心的&#xff0c;啊啊啊啊啊科研要命。作为一个水果怪&#xff08;每天不吃水果就要命的那种哈哈哈哈&#xff09;突然发现竟然就知道什么apple、banana、orange&#xff01;惭愧惭愧&#xff0c;正好兴致正浓&#xff0c;来整理一…

Java HashMap在遍历时删除元素

文章目录 1. HashMap数据结构1.1 数组单向链表红黑树1.2 指定初始容量&#xff0c;省去多次扩容步骤1.3 获取map内容&#xff1a;Map.Entry 2. 遍历集合时删除元素3. computeIfAbsent()方法 1. HashMap数据结构 jdk是1.8版本 HashMap 线程不安全 ConcurrentHashMap 线程安全 1.…

jvm_下篇_补充_MAT从入门到精通

MAT从入门到精通 概述安装mac安装指定jdk配置内存 使用配置获取dump文件Overview下功能解释HistogramDominator TreeLeak SuspectsOverview功能说明结尾Thread_Overview OQLHeap Dump OverviewFind Object by address 概述 尽管JVM提供了自动内存管理的机制&#xff0c;试图降…

golang的jwt学习笔记

文章目录 初始化项目加密一步一步编写程序另一个参数--加密方式关于StandardClaims 解密解析出来的怎么用关于`MapClaims`上面使用结构体的全代码实战项目关于验证这个项目的前端初始化项目 自然第一步是暗转jwt-go的依赖啦 #go get github.com/golang-jwt/jwt/v5 go get githu…

小狐狸ChatGPT系统 H5前端底部菜单导航文字修改方法

小狐狸ChatGPT系统后端都前端都是编译过的&#xff0c;需要改动点什么非常难处理&#xff0c;开源版修改后也需要编译后才能使用&#xff0c;大部分会员也不会使用&#xff0c;像简单的修改下底部菜单文字、图标什么的可以对照处理。这里以小狐狸ChatGPT系统1.9.2版本H5端为例&…

Unity向量按照某一点进行旋转

Unity向量按照某一点进行旋转 一、unity的旋转二、向量按照原点进行旋转注意案例 三、向量按照指定位置进行旋转案例 一、unity的旋转 首先要知道一点就是在Unity的旋转中使用过四元数进行旋转的&#xff0c;如果对一个物体的rotation直接赋值你会发现结果不是你最终想要的结果…

Kubectl 部署有状态应用(上)

前面介绍了Deployment以及如何部署无状态应用。 Kubectl 部署无状态应用Deployment Controller详解&#xff08;上&#xff09;Deployment Controller详解&#xff08;下&#xff09; 本文将继续介绍如何在k8s上部署有状态应用。 有状态和无状态服务的区别 无状态&#xff…

数组元素反序

和前面的字符串逆向输出有异曲同工之妙 第一位和最后一位交换位置&#xff0c;然后用比大小循环 那么接下来修改一下这个程序&#xff0c;我们接下来解释一下p的概念 画图解释&#xff1a; 在最前面的 定义的时候&#xff0c;我们将p&#xff08;0&#xff09;定义在了1上&…

四、Spring IoC实践和应用(基于配置类方式管理 Bean)

本章概要 基于配置类方式管理 Bean 完全注解开发理解实验一&#xff1a;配置类和扫描注解实验二&#xff1a;Bean定义组件实验三&#xff1a;高级特性&#xff1a;Bean注解细节实验四&#xff1a;高级特性&#xff1a;Import扩展实验五&#xff1a;基于注解配置类方式整合三层…

抓包工具Fiddler的常用操作

文章目录 Fiddler概述Fiddler页面介绍常用功能介绍端口号的修改设置抓HTTPS数据Fillder过滤请求数据 接口相关Fiddler中查看请求信息Fiddler中查看响应信息 Fiddler模拟弱网测试Fiddler模拟mock数据Fillder篡改数据 Fiddler概述 fiddler是一款http协议调试代理工具&#xff0c;…

redis的那些事(二)——布隆过滤器

什么是布隆过滤器&#xff1f; 布隆过滤器&#xff08;Bloom Filter&#xff09;是1970年由布隆提出的。它实际上是一个很长的二进制向量和一系列随机映射函数。布隆过滤器可以用于检索一个元素是否在一个集合中。 布隆过滤器实现原理 布隆过滤器是一个bit向量或者说是一个b…

【linux提权】利用setuid进行简单提权

首先先来了解一下setuid漏洞&#xff1a; SUID (Set UID)是Linux中的一种特殊权限,其功能为用户运行某个程序时&#xff0c;如果该程序有SUID权限&#xff0c;那么程序运行为进程时&#xff0c;进程的属主不是发起者&#xff0c;而是程序文件所属的属主。但是SUID权限的设置只…

构建深度学习模型:原理与实践

构建深度学习模型&#xff1a;原理与实践 引言 随着人工智能技术的飞速发展&#xff0c;深度学习已经成为当今最为炙手可热的研究领域之一。深度学习通过模拟人脑神经网络的工作原理&#xff0c;使得计算机能够具备更强大的学习和识别能力。本文将深入探讨深度学习的基本原理…

【模式识别】探秘分类奥秘:K-近邻算法解密与实战

​&#x1f308;个人主页&#xff1a;Sarapines Programmer&#x1f525; 系列专栏&#xff1a;《模式之谜 | 数据奇迹解码》⏰诗赋清音&#xff1a;云生高巅梦远游&#xff0c; 星光点缀碧海愁。 山川深邃情难晤&#xff0c; 剑气凌云志自修。 目录 &#x1f30c;1 初识模式识…

Unity网格篇Mesh(二)

Unity网格篇Mesh&#xff08;二&#xff09; 介绍4.生成额外的顶点数据未计算法线计算法线没有法线vs有法线错误的UV坐标Clamping vs warpping正确的UV纹理&#xff0c;平铺&#xff08;1,1&#xff09; vs 平铺&#xff08;2,1&#xff09;凹凸不平的表面&#xff0c;产生了金…