Home | Tutorials | Wiki | Issues
Ask Your Question
1

Using SDF tags in URDF (gazebo extension) directly?

asked 2014-09-20 06:22:18 -0500

Felix gravatar image

This questions is related to the previous thread: urdf-to-sdf-conversion [1].

Now, I'm reporting my observations when trying to use SDF tags from sdf1.4 in the URDF directly.

As mentioned in [1], it should be possible to use SDF within the gazebo tags referencing a link or joint within the URDF directly.

SDF tags for links

For setting most of the SDF tags relevant for links, URDF does not need the gazebo extensions, i.e. pose, ├Čnertial, visual and collision related tags are correctly set up using urdf-xml-link.

  1. gravity and self_collide
    It's the same result as mentioned in this issue

  2. kinematic
    It is converted to sdf. But seems to have no effect according to this thread

  3. velocity_decay
    The following can be used to set velocity_decay of a link.
    With this, it's possible to set different values for linear and angular (in contrast to using the gazebo tag dampingFactor).

    <gazebo reference="${name}_base_link">
      <velocity_decay>
        <linear>0.2</linear>
        <angular>0.4</angular>
      </velocity_decay>
    </gazebo>
    

SDF tags for joints

Similar to the above mentioned, tags that can correctly be set up using urdf-xml-joint are not considered here.

  1. damping and friction (dynamics)
    damping of an axis can only be set using the URDF tag dynmaics -> damping.
    All the following variants are not converted into the SDF file:

    <gazebo reference="${name}_1_joint">
      <axis>
        <dynamics>
          <damping>0.7</damping>
          <friction>0.7</friction>
        </dynamics>
      </axis>
      <dynamics>
        <damping>0.6</damping>
        <friction>0.6</friction>
      </dynamics>
      <damping>0.5</damping>
      <friction>0.5</friction> 
    </gazebo>
    

    friction cannot be set from anywhere as it is currently (not yet) supported (see PullRequest)

  2. physics for ode (ode)
    Both following variants are not converted into the SDF file:

    <gazebo reference="${name}_1_joint">
    
      <provide_feedback>true</provide_feedback>
      <cfm_damping>true</cfm_damping>
      <fudge_factor>80</fudge_factor>
      <cfm>81</cfm>
      <erp>82</erp>
      <bounce>83</bounce>
      <max_force>84</max_force>
      <velocity>85</velocity>
      <limit>
        <cfm>86</cfm>
        <erp>87</erp>
      </limit>
      <suspension>
        <cfm>88</cfm>
        <erp>89</erp>
      </suspension>
    
      <physics>
        <ode>
          <provide_feedback>true</provide_feedback>
          <cfm_damping>true</cfm_damping>
          <fudge_factor>90</fudge_factor>
          <cfm>91</cfm>
          <erp>92</erp>
          <bounce>93</bounce>
          <max_force>94</max_force>
          <velocity>95</velocity>
          <limit>
            <cfm>96</cfm>
            <erp>97</erp>
          </limit>
          <suspension>
            <cfm>98</cfm>
            <erp>99</erp>
          </suspension>
        </ode>
      </physics>
    
    </gazebo>
    

Thus, it seems that using SDF tags directly within a URDF file is not supported - at least the way I tried to use them. In case I used them in the wrong way, please let me know! I'd be happy to test again then...

The only tags that are converted into the SDF file are gravity, self_collide (however, not considered due to issue), kinematic (however, see thread) and velocity_decay.

edit retag flag offensive close merge delete

Comments

For the friction and damping there is something in URDF, explained here http://wiki.ros.org/urdf/Tutorials/Adding%20Physical%20and%20Collision%20Properties%20to%20a%20URDF%20Model but it doesn't seem to affect my links as they keep sliding.

mehdi gravatar imagemehdi ( 2015-06-17 04:45:49 -0500 )edit

2 Answers

Sort by ┬╗ oldest newest most voted
1

answered 2016-09-22 05:43:30 -0500

Franzisdrak gravatar image

updated 2016-09-22 05:44:38 -0500

Hi there,

i know this feed is a little outdated but i currently have issues when trying to go from xacro->urdf->sdf into gazebo. I have a fairly complex setup and need to change friction of models in my simulation.

Currently in my xacro i set up a wheel like this:

>   <link name="wheel_f_l">
>     <collision name="collision">
>       <geometry>
>         <cylinder radius="${wheel_radius}"
>              length="${wheel_length}"/>
>       </geometry>
>     </collision>
>     <visual name="visual">
>       <geometry>
>         <cylinder radius="${wheel_radius}"
>           length="${wheel_length}"/>
>       </geometry>
>     </visual>
>     <xacro:solid_cylinder_inertial
>       radius="${wheel_radius}" height="${wheel_length}"
>       mass="${wheel_mass}" gcx="${0}" gcy="${0}" gcz="${0}"/>   
>     </link>

I then create a reference like this:

<gazebo reference="wheel_r_l">
        <mu1>100</mu1>
        <mu2>100</mu2>
        <maxContacts>1</maxContacts>
    </gazebo>

but for some reason my parameters dont survive the conversion to sdf via. gz sdf -p test.urdf > test.sdf.

I should mention i am using ODE and want to create a "realistic" wheel.

Help would very much be appreciated!

edit flag offensive delete link more
0

answered 2015-06-17 05:00:46 -0500

mehdi gravatar image

Considering the friction, this works for me :

  <gazebo reference="link2">
    <mu1>0.2</mu1>
    <mu2>0.2</mu2>
  </gazebo>

Some examples are explained here

edit flag offensive delete link more

Comments

Are you sure that these values are even set? Even with ROS kinetic and gazebo 7.8 there is now chance. Check it with `gz model -m <your model="" name=""> -i`!

tik0 gravatar imagetik0 ( 2017-06-20 20:59:56 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-09-20 06:22:18 -0500

Seen: 2,597 times

Last updated: Sep 22 '16