[sdformat] 01/01: Imported Upstream version 4.2.0

Jose Luis Rivero jrivero-guest at moszumanska.debian.org
Tue Jan 17 16:52:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

jrivero-guest pushed a commit to annotated tag upstream/4.2.0
in repository sdformat.

commit 5508763c8690fd514358af653c1f0c05f37bd8ed
Author: Jose Luis Rivero <jrivero at osrfoundation.org>
Date:   Tue Jan 17 16:52:12 2017 +0000

    Imported Upstream version 4.2.0
---
 .hg_archival.txt                                   |  8 +--
 .hgtags                                            |  1 +
 CMakeLists.txt                                     |  4 +-
 Changelog.md                                       | 10 ++-
 include/sdf/SDFExtension.hh                        |  1 +
 sdf/1.6/imu.sdf                                    | 79 ++++++++++++++++++++++
 sdf/1.6/spherical_coordinates.sdf                  | 24 ++++++-
 src/SDFExtension.cc                                |  1 +
 src/parser_urdf.cc                                 |  9 +--
 test/integration/fixed_joint_reduction.cc          |  2 +
 ..._joint_reduction_collision_visual_extension.sdf |  1 -
 11 files changed, 126 insertions(+), 14 deletions(-)

diff --git a/.hg_archival.txt b/.hg_archival.txt
index c79e662..cd36ced 100644
--- a/.hg_archival.txt
+++ b/.hg_archival.txt
@@ -1,6 +1,6 @@
 repo: 17049bd77df5bd6cd56a76edba4a54afb5647740
-node: 10551a6e8a2c03e3a6e3e81883d3191d5be4a62c
+node: e5ac5aaa49f240725a0dd18bca2f5a7d16aaeeab
 branch: sdf4
-latesttag: sdformat4_4.1.0
-latesttagdistance: 19
-changessincelatesttag: 41
+latesttag: sdformat4_4.1.1
+latesttagdistance: 28
+changessincelatesttag: 28
diff --git a/.hgtags b/.hgtags
index 3a4eab8..6d96a9f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -114,3 +114,4 @@ bb3fff1c17397bada85e3aad11f508c23cead6fd sdformat4_4.0.0~pre2
 878cecf3869767f396e50ffb7cf6e6a780163894 sdformat4_4.1.0
 878cecf3869767f396e50ffb7cf6e6a780163894 sdformat4_4.1.0
 01885813c0b9d60ff568ceca9eb09ec836795757 sdformat4_4.1.0
+10551a6e8a2c03e3a6e3e81883d3191d5be4a62c sdformat4_4.1.1
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d9d3321..33c48f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,8 +28,8 @@ string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
 set (SDF_PROTOCOL_VERSION 1.6)
 
 set (SDF_MAJOR_VERSION 4)
-set (SDF_MINOR_VERSION 1)
-set (SDF_PATCH_VERSION 1)
+set (SDF_MINOR_VERSION 2)
+set (SDF_PATCH_VERSION 0)
 
 set (SDF_VERSION ${SDF_MAJOR_VERSION}.${SDF_MINOR_VERSION})
 set (SDF_VERSION_FULL ${SDF_MAJOR_VERSION}.${SDF_MINOR_VERSION}.${SDF_PATCH_VERSION})
diff --git a/Changelog.md b/Changelog.md
index cbde7af..3df908a 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,6 +1,14 @@
 ## SDFormat 4.0
 
-### SDFormat 4.2.0 (2016-08-19)
+### SDFormat 4.2.0 (2016-10-10)
+
+1. Fix URDF to SDF `self_collide` bug.
+    * [Pull request 287](https://bitbucket.org/osrf/sdformat/pull-request/287)
+
+1. Added IMU orientation specification to SDF.
+    * [Pull request 284](https://bitbucket.org/osrf/sdformat/pull-request/284)
+
+### SDFormat 4.1.1 (2016-07-08)
 
 1. Added documentation and animation to `<actor>` element.
     * [Pull request 280](https://bitbucket.org/osrf/sdformat/pull-request/280)
diff --git a/include/sdf/SDFExtension.hh b/include/sdf/SDFExtension.hh
index 96b39b6..3ae467b 100644
--- a/include/sdf/SDFExtension.hh
+++ b/include/sdf/SDFExtension.hh
@@ -98,6 +98,7 @@ namespace sdf
     public: double maxVel;
     public: bool isMinDepth;
     public: double minDepth;
+    public: bool isSelfCollide;
     public: bool selfCollide;
 
     // geom, contact dynamics
diff --git a/sdf/1.6/imu.sdf b/sdf/1.6/imu.sdf
index f9a3067..d812b0f 100644
--- a/sdf/1.6/imu.sdf
+++ b/sdf/1.6/imu.sdf
@@ -1,6 +1,85 @@
 <element name="imu" required="0">
   <description>These elements are specific to the IMU sensor.</description>
 
+  <element name="orientation_reference_frame" required="0">
+    <!-- move this under custom_rpy? -->
+    <element name="localization" type="string" default="CUSTOM" required="1">
+      <description>
+        This string represents special hardcoded use cases that are commonly seen with typical robot IMU's:
+          - CUSTOM: use Euler angle custom_rpy orientation specification.
+                 The orientation of the IMU's reference frame is defined by adding the custom_rpy rotation
+                 to the parent_frame.
+          - NED: The IMU XYZ aligns with NED, where NED orientation relative to Gazebo world
+                 is defined by the SphericalCoordinates class.
+          - ENU: The IMU XYZ aligns with ENU, where ENU orientation relative to Gazebo world
+                 is defined by the SphericalCoordinates class.
+          - NWU: The IMU XYZ aligns with NWU, where NWU orientation relative to Gazebo world
+                 is defined by the SphericalCoordinates class.
+          - GRAV_UP: where direction of gravity maps to IMU reference frame Z-axis with Z-axis pointing in
+                     the opposite direction of gravity. IMU reference frame X-axis direction is defined by grav_dir_x.
+                     Note if grav_dir_x is parallel to gravity direction, this configuration fails.
+                     Otherwise, IMU reference frame X-axis is defined by projection of grav_dir_x onto a plane
+                     normal to the gravity vector. IMU reference frame Y-axis is a vector orthogonal to both
+                     X and Z axis following the right hand rule.
+          - GRAV_DOWN: where direction of gravity maps to IMU reference frame Z-axis with Z-axis pointing in
+                       the direction of gravity. IMU reference frame X-axis direction is defined by grav_dir_x.
+                       Note if grav_dir_x is parallel to gravity direction, this configuration fails.
+                       Otherwise, IMU reference frame X-axis is defined by projection of grav_dir_x onto a plane
+                       normal to the gravity vector. IMU reference frame Y-axis is a vector orthogonal to both
+                       X and Z axis following the right hand rule.
+      </description>
+    </element>
+    <element name="custom_rpy" type="vector3" default="0 0 0" required="0">
+      <description>
+        This field and parent_frame are used when localization is set to CUSTOM.
+        Orientation (fixed axis roll, pitch yaw) transform from parent_frame to this IMU's reference frame.
+        Some common examples are:
+          - IMU reports in its local frame on boot. IMU sensor frame is the reference frame.
+             Example: parent_frame="", custom_rpy="0 0 0"
+          - IMU reports in Gazebo world frame.
+             Example sdf: parent_frame="world", custom_rpy="0 0 0"
+          - IMU reports in NWU frame.
+             Uses SphericalCoordinates class to determine world frame in relation to magnetic north and gravity;
+             i.e. rotation between North-West-Up and world (+X,+Y,+Z) frame is defined by SphericalCoordinates class.
+             Example sdf given world is NWU: parent_frame="world", custom_rpy="0 0 0"
+          - IMU reports in NED frame.
+             Uses SphericalCoordinates class to determine world frame in relation to magnetic north and gravity;
+             i.e. rotation between North-East-Down and world (+X,+Y,+Z) frame is defined by SphericalCoordinates class.
+             Example sdf given world is NWU: parent_frame="world", custom_rpy="M_PI 0 0"
+          - IMU reports in ENU frame.
+             Uses SphericalCoordinates class to determine world frame in relation to magnetic north and gravity;
+             i.e. rotation between East-North-Up and world (+X,+Y,+Z) frame is defined by SphericalCoordinates class.
+             Example sdf given world is NWU: parent_frame="world", custom_rpy="0 0 -0.5*M_PI"
+          - IMU reports in ROS optical frame as described in http://www.ros.org/reps/rep-0103.html#suffix-frames, which is
+             (z-forward, x-left to right when facing +z, y-top to bottom when facing +z).
+             (default gazebo camera is +x:view direction, +y:left, +z:up).
+             Example sdf: parent_frame="local", custom_rpy="-0.5*M_PI 0 -0.5*M_PI"
+      </description>
+      <element name="parent_frame" type="string" default="" required="0">
+        <description>
+          Name of parent frame which the custom_rpy transform is defined relative to.
+          It can be any valid fully scoped Gazebo Link name or the special reserved "world" frame.
+          If left empty, use the sensor's own local frame.
+        </description>
+      </element>
+    </element>
+    <element name="grav_dir_x" type="vector3" default="1 0 0" required="0">
+      <description>
+        Used when localization is set to GRAV_UP or GRAV_DOWN, a projection of this vector 
+        into a plane that is orthogonal to the gravity vector
+        defines the direction of the IMU reference frame's X-axis.
+        grav_dir_x is  defined in the coordinate frame as defined by the parent_frame element.
+      </description>
+      <element name="parent_frame" type="string" default="" required="0">
+        <description>
+          Name of parent frame in which the grav_dir_x vector is defined.
+          It can be any valid fully scoped Gazebo Link name or the special reserved "world" frame.
+          If left empty, use the sensor's own local frame.
+        </description>
+      </element>
+    </element>
+  </element>
+
   <element name="topic" type="string" default="__default_topic__" required="0">
     <description>Topic on which data is published.</description>
   </element>
diff --git a/sdf/1.6/spherical_coordinates.sdf b/sdf/1.6/spherical_coordinates.sdf
index e6c8c96..a0aa103 100644
--- a/sdf/1.6/spherical_coordinates.sdf
+++ b/sdf/1.6/spherical_coordinates.sdf
@@ -8,6 +8,21 @@
     </description>
   </element>
 
+  <element name="world_frame_orientation" type="string" default="ENU" required="0">
+    <description>
+      This field identifies how Gazebo world frame is aligned in Geographical
+      sense.  The final Gazebo world frame orientation is obtained by rotating
+      a frame aligned with following notation by the field heading_deg (Note
+      that heading_deg corresponds to positive yaw rotation in the NED frame,
+      so it's inverse specifies positive Z-rotation in ENU or NWU).
+      Options are:
+        - ENU (East-North-Up)
+        - NED (North-East-Down)
+        - NWU (North-West-Up)
+      For example, world frame specified by setting world_orientation="ENU"
+      and heading_deg=-90° is effectively equivalent to NWU with heading of 0°.
+    </description>
+  </element>
   <element name="latitude_deg" type="double" default="0.0" required="1">
     <description>
       Geodetic latitude at origin of gazebo reference frame, specified
@@ -31,8 +46,13 @@
   <element name="heading_deg" type="double" default="0.0" required="1">
     <description>
       Heading offset of gazebo reference frame, measured as angle between
-      East and gazebo x axis, or equivalently, the angle between North and
-      gazebo y axis. The angle is specified in degrees.
+      Gazebo world frame and the world_frame_orientation type (ENU/NED/NWU).
+      Rotations about the downward-vector (e.g. North to East) are positive.
+      The direction of rotation is chosen to be consistent with compass
+      heading convention (e.g. 0 degrees points North and 90 degrees
+      points East, positive rotation indicates counterclockwise rotation
+      when viewed from top-down direction).
+      The angle is specified in degrees.
     </description>
   </element>
 
diff --git a/src/SDFExtension.cc b/src/SDFExtension.cc
index 1312609..e5420c4 100644
--- a/src/SDFExtension.cc
+++ b/src/SDFExtension.cc
@@ -36,6 +36,7 @@ SDFExtension::SDFExtension()
   this->isMu2 = false;
   this->isKp = false;
   this->isKd = false;
+  this->isSelfCollide = false;
   this->selfCollide = false;
   this->isLaserRetro = false;
   this->isSpringReference = false;
diff --git a/src/parser_urdf.cc b/src/parser_urdf.cc
index 3740bda..f8fb1ba 100644
--- a/src/parser_urdf.cc
+++ b/src/parser_urdf.cc
@@ -1476,6 +1476,7 @@ void URDF2SDF::ParseSDFExtension(TiXmlDocument &_urdfXml)
       }
       else if (childElem->ValueStr() == "selfCollide")
       {
+        sdf->isSelfCollide = true;
         std::string valueStr = GetKeyValueAsString(childElem);
 
         // default of selfCollide is false
@@ -2148,10 +2149,10 @@ void InsertSDFExtensionLink(TiXmlElement *_elem, const std::string &_linkName)
         }
         _elem->LinkEndChild(velocityDecay);
         // selfCollide tag
-        if ((*ge)->selfCollide)
-          AddKeyValue(_elem, "self_collide", "true");
-        else
-          AddKeyValue(_elem, "self_collide", "false");
+        if ((*ge)->isSelfCollide)
+        {
+          AddKeyValue(_elem, "self_collide", (*ge)->selfCollide ? "1" : "0");
+        }
         // insert blobs into body
         for (std::vector<TiXmlElementPtr>::iterator
             blobIt = (*ge)->blobs.begin();
diff --git a/test/integration/fixed_joint_reduction.cc b/test/integration/fixed_joint_reduction.cc
index 4492083..76ba51f 100644
--- a/test/integration/fixed_joint_reduction.cc
+++ b/test/integration/fixed_joint_reduction.cc
@@ -135,6 +135,7 @@ void FixedJointReductionCollisionVisualExtension(
   for (sdf::ElementPtr link = urdfModel->GetElement("link"); link;
        link = link->GetNextElement("link"))
   {
+    EXPECT_FALSE(link->HasElement("self_collide"));
     for (sdf::ElementPtr col = link->GetElement("collision"); col;
          col = col->GetNextElement("collision"))
     {
@@ -184,6 +185,7 @@ void FixedJointReductionCollisionVisualExtension(
   for (sdf::ElementPtr link = sdfModel->GetElement("link"); link;
        link = link->GetNextElement("link"))
   {
+    EXPECT_FALSE(link->HasElement("self_collide"));
     for (sdf::ElementPtr col = link->GetElement("collision"); col;
          col = col->GetNextElement("collision"))
     {
diff --git a/test/integration/fixed_joint_reduction_collision_visual_extension.sdf b/test/integration/fixed_joint_reduction_collision_visual_extension.sdf
index 02172fb..37d798b 100644
--- a/test/integration/fixed_joint_reduction_collision_visual_extension.sdf
+++ b/test/integration/fixed_joint_reduction_collision_visual_extension.sdf
@@ -138,7 +138,6 @@
       <velocity_decay/>
       <gravity>1</gravity>
       <velocity_decay/>
-      <self_collide>0</self_collide>
     </link>
   </model>
 </sdf>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sdformat.git



More information about the debian-science-commits mailing list