gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.17k stars 477 forks source link

Add optional `default_position` to `<joint>` element #477

Open osrf-migration opened 11 years ago

osrf-migration commented 11 years ago

Original report (archived issue) by John Hsu (Bitbucket: hsu, GitHub: hsu).


Proposing adding an optional default joint angle to <joint> elements:

<joint name="joint_12" type="revolute">
    <parent>link_1</parent>
    <child>link_2</child>
    <axis>
        <xyz>1.000000 0.000000 0.000000</xyz>
        <default_position>0.0</default_position>
    </axis>
</joint>

and the corresponding modification to joint.sdf:

diff -r 54e2d6ddbc75cc5b75f5b1fb83879df81715ac81 gazebo/sdf/1.3/joint.sdf
--- a/gazebo/sdf/1.3/joint.sdf  Fri Feb 01 10:39:15 2013 -0800
+++ b/gazebo/sdf/1.3/joint.sdf  Mon Feb 04 10:40:48 2013 -0800
@@ -31,6 +31,9 @@
     <element name="xyz" type="vector3" default="0 0 1" required="1">
       <description>Represents the x,y,z components of a vector. The vector should be normalized.</description>
     </element>
+    <element name="default_position" type="double" default="0" required="0">
+      <description>Default joint position for this joint axis.  Note the state of the joint specified by state.sdf::model::joint::angle or state.sdf::model::link::pose is used while loading a scene if one is specified instead of default_position.</description>
+    </element>
     <element name="dynamics" required="0">
       <description>An element specifying physical properties of the joint. These values are used to specify modeling properties of the joint, particularly useful for simulation.</description>
       <element name="damping" type="double" default="0" required="0">

This will be a fallback for joint angle at load time if joint angle in state.sdf has not been specified.

osrf-migration commented 11 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


What is case where the joint state is not set?

osrf-migration commented 11 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


Specifying a joint state doesn't currently change the pose of the parent or child links. In Model::SetState calls Model::SetJointPosition, but this only sets the desired positions for the JointController object.

osrf-migration commented 11 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


Until 2.0

osrf-migration commented 11 years ago

Original comment by Ian Chen (Bitbucket: Ian Chen, GitHub: iche033).


osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).