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

news2024/9/26 5:20:17

原文链接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

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

DRF之初识

目录 一、序列化和反序列化 【1】序列化 【2】反序列化 【3】小结 二、DRF的安装和快速使用 (1) 安装DRF&#xff1a; (2) 配置DRF&#xff1a; (3) 创建序列化器(Serializer)&#xff1a; (4) 创建视图(View)&#xff1a; (5) 配置URL路由&#xff1a; 【补充】下载…

使用Open3D实现3D激光雷达可视化:以自动驾驶的2DKITTI深度框架为例(下篇)

原创 | 文 BFT机器人 【原文链接】使用Open3D实现3D激光雷达可视化&#xff1a;以自动驾驶的2DKITTI深度框架为例&#xff08;上篇&#xff09; 05 Open3D可视化工具 多功能且高效的3D数据处理&#xff1a;Open3D是一个全面的开源库&#xff0c;为3D数据处理提供强大的解决方…

【LeetCode】链表精选12题

目录 快慢指针&#xff1a; 1. 相交链表&#xff08;简单&#xff09; 2. 环形链表&#xff08;简单&#xff09; 3. 快乐数&#xff08;简单&#xff09; 4. 环形链表 II&#xff08;中等&#xff09; 5. 删除链表的倒数第 N 个节点&#xff08;中等&#xff09; 递归迭…

WPF中数据绑定转换器Converter

使用场景&#xff1a;ViewModel中的数据如果跟View中的数据类型不匹配。 下面是以int类型调控是否可见为例子 步骤一&#xff1a;创建转换器类 在xaml中查看Converter的定义可以知道Converter是一个接口类型&#xff0c;因此转换器的类定义需要使用这个接口 internal class Vi…

【UML】第13篇 序列图(2/2)——建模的方法

目录 三、序列图建模 3.1 概述 3.2 建模的步骤 3.3 举例说明步骤 1.确定主要场景和流程 2.确定参与的对象 3.绘制序列图 4.注意事项 3.4 特殊的情况 序列图是我个人认为&#xff0c;UML中最重要的图之一。 而且序列图&#xff0c;对于业务建模&#xff0c;也有非常好…

echarts 柱状图

注意点 1.y轴显示的序号和名称需要在数据中拼接&#xff0c;而不是在y轴data中拼接&#xff0c; 数据过多会导致下拉的时候&#xff0c;触发y轴formatter&#xff0c;更新序号&#xff0c;序号会重新排列&#xff0c;不准确。 2.需用到堆叠效果&#xff0c;三个柱子。如果想…

PyTorch官网demo解读——第一个神经网络(3)

上一篇&#xff1a;PyTorch官网demo解读——第一个神经网络&#xff08;2&#xff09;-CSDN博客 上一篇文章我们讲解了第一个神经网络的模型&#xff0c;这一篇我们来聊聊梯度下降。 大佬说梯度下降是深度学习的灵魂&#xff1b;梯度是损失函数&#xff08;代价函数&#xff…

百度百科词条编辑需要提供参考资料,那么如何找参考资料呢。

百度百科相信大家都不陌生&#xff0c;在查询一个概念、新事物&#xff0c;或者我们想要了解的企业和人物时&#xff0c;我们一般都会求助百度百科&#xff0c;因为百度百科上面的信息相较于其他平台更值得我们相信。从词条所属主体来说&#xff0c;百度百科平台也是向其他用户…

20231224解决outcommit_id.xml1 parser error Document is empty的问题

20231224解决outcommit_id.xml1 parser error Document is empty的问题 2023/12/24 18:13 在开发RK3399的Android10的时候&#xff0c;出现&#xff1a;rootrootrootroot-X99-Turbo:~/3TB/Rockchip_Android10.0_SDK_Release$ make installclean PLATFORM_VERSION_CODENAMEREL…

Ubuntu18.04安装GTSAM库(亲测可用)

在SLAM&#xff08;Simultaneous Localization and Mapping&#xff09;和SFM&#xff08;Structure from Motion&#xff09;这些复杂的估计问题中&#xff0c;因子图算法以其高效和灵活性而脱颖而出&#xff0c;成为图模型领域的核心技术。GTSAM&#xff08;Georgia Tech Smo…

不用再找了,这就是 NLP 方向最全面试题库

大家好&#xff0c;本篇文章总结了自然语言处理(NLP)面试需要准备的学习笔记与资料&#xff0c;该资料目前包含自然语言处理各领域的面试题积累。 热门面试题&#xff08;校招、社招&#xff09;、公司级专项真题、大厂常考题等&#xff0c;在我们社群具有总结&#xff0c;喜欢…

DevC++ easyx实现视口编辑,在超过屏幕大小的地图上画点,与解决刮刮乐bug效果中理解C语言指针的意义

继上篇文案&#xff0c; DevC easyx实现地图拖动&#xff0c;超过屏幕大小的巨大地图的局部显示在屏幕的方法——用悬浮窗的原理来的实现一个视口-CSDN博客 实现了大地图拖动&#xff0c;但是当时野心不止&#xff0c;就想着一气能搓啥就继续搓啥&#xff0c;看着地图移动都搓…

转录组无参比对教程

写在前面 2023年将结束&#xff0c;小杜的生信笔记分享个人学习笔记也有2年的时间。在这2年的时间中&#xff0c;分享算是成为工作、学习和生活中的一部分。自己为了运行和维护社群也算花费大量的时间和精力&#xff0c;自己认为还算满意吧。对于个人来说&#xff0c;自己一直…

Docker介绍、常用命令与操作

Docker介绍、常用命令与操作 学习前言为什么要学习DockerDocker里的必要基础概念常用命令与操作1、基础操作a、查看docker相关信息b、启动或者关闭docker 2、容器操作a、启动一个镜像i、后台运行ii、前台运行 b、容器运行情况查看c、日志查看d、容器删除 3、镜像操作a、镜像拉取…

使用 Docker 部署企业培训系统 PlayEdu

1&#xff09;PlayEdu 介绍 官网&#xff1a;https://www.playedu.xyz/ GitHub&#xff1a;https://github.com/PlayEdu/PlayEdu PlayEdu 是一款适用于搭建内部培训平台的开源系统&#xff0c;旨在为企业/机构打造自己品牌的内部培训平台。PlayEdu 基于 Java MySQL 开发&…

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

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

Golang实现JAVA虚拟机-运行时数据区

一、运行时数据区概述 JVM学习&#xff1a; JVM-运行时数据区 运行时数据区可以分为两类&#xff1a;一类是多线程共享的&#xff0c;另一类则是线程私有的。 多线程共享的运行时数据区需要在Java虚拟机启动时创建好&#xff0c;在Java虚拟机退出时销毁。对象实例存储在堆区类信…

2023.12.22 关于 Redis 数据类型 String 常用命令

目录 引言 String 类型基本概念 SET & GET SET 命令 GET 命令 MSET & MGET MSET 命令 MGET 命令 SETNX & SETEX & PSETEX SETNX 命令 SETEX 命令 PSETEX 命令 计数命令 INCR 命令 INCRBY 命令 DECR 命令 DECRBY 命令 INCRBYFLOAT 命令 总结…

【GoLang】Go语言几种标准库介绍(一)

你见过哪些令你膛目结舌的代码技巧&#xff1f; 文章目录 你见过哪些令你膛目结舌的代码技巧&#xff1f;前言几种库bufio&#xff08;带缓冲的 I/O 操作&#xff09;特性示例 bytes (实现字节操作)特性示例 总结专栏集锦写在最后 前言 随着计算机科学的迅猛发展&#xff0c;编…

复试情报准备

英语自我介绍&#xff0c;介绍完老师会根据你的回答用英语问你问题&#xff0c;比如介绍一下你的本科学校&#xff0c;或者家乡什么的。计网过一遍&#xff0c;会问两道题。接下来是重点&#xff0c;我当时是根据我成绩单&#xff0c;问了我本科学过的科目&#xff0c;比如pyth…