From ce63d47825de666a8c89b057fe6cf1851d205c19 Mon Sep 17 00:00:00 2001 From: Victor Lamoine Date: Sat, 2 Feb 2019 22:33:27 +0100 Subject: [PATCH 1/5] Add quaternion in URDF attributes --- urdf_parser/src/pose.cpp | 19 +++++++++++++++---- xsd/urdf.xsd | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/urdf_parser/src/pose.cpp b/urdf_parser/src/pose.cpp index 56bedd48..00f904ca 100644 --- a/urdf_parser/src/pose.cpp +++ b/urdf_parser/src/pose.cpp @@ -1,13 +1,13 @@ /********************************************************************* * Software License Agreement (BSD License) -* +* * Copyright (c) 2008, Willow Garage, Inc. * All rights reserved. -* +* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: -* +* * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above @@ -17,7 +17,7 @@ * * Neither the name of the Willow Garage nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. -* +* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -115,6 +115,17 @@ bool parsePose(Pose &pose, TiXmlElement* xml) return false; } } + const char* quat_str = xml->Attribute("quat"); + if (quat_str != NULL) + { + try { + pose.rotation.initQuaternions(quat_str); + } + catch (ParseError &e) { + CONSOLE_BRIDGE_logError(e.what()); + return false; + } + } } return true; } diff --git a/xsd/urdf.xsd b/xsd/urdf.xsd index ccebfb26..918fa9ab 100644 --- a/xsd/urdf.xsd +++ b/xsd/urdf.xsd @@ -17,6 +17,7 @@ + From ee6bbbef34be2bbb3ad778f4191588bc0bfcb204 Mon Sep 17 00:00:00 2001 From: Victor Lamoine Date: Mon, 25 Feb 2019 15:38:27 +0100 Subject: [PATCH 2/5] Rename to initQuaternion (singular) --- urdf_parser/src/pose.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/urdf_parser/src/pose.cpp b/urdf_parser/src/pose.cpp index 00f904ca..ee07e38f 100644 --- a/urdf_parser/src/pose.cpp +++ b/urdf_parser/src/pose.cpp @@ -119,7 +119,7 @@ bool parsePose(Pose &pose, TiXmlElement* xml) if (quat_str != NULL) { try { - pose.rotation.initQuaternions(quat_str); + pose.rotation.initQuaternion(quat_str); } catch (ParseError &e) { CONSOLE_BRIDGE_logError(e.what()); From fb4d9d89554e6214ea40ca6532c5e643fdf00d59 Mon Sep 17 00:00:00 2001 From: Victor Lamoine Date: Wed, 27 Feb 2019 15:58:38 +0100 Subject: [PATCH 3/5] Make sure rpy and quat cannot be both specified --- urdf_parser/src/pose.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/urdf_parser/src/pose.cpp b/urdf_parser/src/pose.cpp index ee07e38f..2fffd0f0 100644 --- a/urdf_parser/src/pose.cpp +++ b/urdf_parser/src/pose.cpp @@ -105,6 +105,13 @@ bool parsePose(Pose &pose, TiXmlElement* xml) } const char* rpy_str = xml->Attribute("rpy"); + const char* quat_str = xml->Attribute("quat"); + if (rpy_str != NULL && quat_str != NULL) + { + CONSOLE_BRIDGE_logError("Both rpy and quat orientations are defined. Use either one or the other."); + return false; + } + if (rpy_str != NULL) { try { @@ -115,7 +122,7 @@ bool parsePose(Pose &pose, TiXmlElement* xml) return false; } } - const char* quat_str = xml->Attribute("quat"); + if (quat_str != NULL) { try { From 7a3fe31db24feb188b566094b6d1f2a9e58a9c50 Mon Sep 17 00:00:00 2001 From: Victor Lamoine Date: Mon, 11 Mar 2019 14:18:20 +0100 Subject: [PATCH 4/5] Explicit initialization order of quaternion: X Y Z W --- urdf_parser/src/pose.cpp | 4 ++-- xsd/urdf.xsd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/urdf_parser/src/pose.cpp b/urdf_parser/src/pose.cpp index 2fffd0f0..6d8bca74 100644 --- a/urdf_parser/src/pose.cpp +++ b/urdf_parser/src/pose.cpp @@ -105,10 +105,10 @@ bool parsePose(Pose &pose, TiXmlElement* xml) } const char* rpy_str = xml->Attribute("rpy"); - const char* quat_str = xml->Attribute("quat"); + const char* quat_str = xml->Attribute("quat_xyzw"); if (rpy_str != NULL && quat_str != NULL) { - CONSOLE_BRIDGE_logError("Both rpy and quat orientations are defined. Use either one or the other."); + CONSOLE_BRIDGE_logError("Both rpy and quat_xyzw orientations are defined. Use either one or the other."); return false; } diff --git a/xsd/urdf.xsd b/xsd/urdf.xsd index 918fa9ab..853fed5f 100644 --- a/xsd/urdf.xsd +++ b/xsd/urdf.xsd @@ -17,7 +17,7 @@ - + From b377abcf3258dedb66ea4786725017f269d386a7 Mon Sep 17 00:00:00 2001 From: Victor Lamoine Date: Mon, 18 Mar 2019 09:17:00 +0100 Subject: [PATCH 5/5] Update CMake project and URDF version to 1.1.0 --- CMakeLists.txt | 6 +++--- xsd/urdf.xsd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45477250..6c96f941 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required( VERSION 2.8 FATAL_ERROR ) project (urdfdom CXX C) set (URDF_MAJOR_VERSION 1) -set (URDF_MINOR_VERSION 0) -set (URDF_PATCH_VERSION 3) +set (URDF_MINOR_VERSION 1) +set (URDF_PATCH_VERSION 0) set (URDF_VERSION ${URDF_MAJOR_VERSION}.${URDF_MINOR_VERSION}.${URDF_PATCH_VERSION}) set (URDF_MAJOR_MINOR_VERSION ${URDF_MAJOR_VERSION}.${URDF_MINOR_VERSION}) @@ -45,7 +45,7 @@ find_package(console_bridge 0.3 REQUIRED) include_directories(SYSTEM ${console_bridge_INCLUDE_DIRS}) link_directories(${console_bridge_LIBRARY_DIRS}) -#In Visual Studio a special postfix for +#In Visual Studio a special postfix for #libraries compiled in debug is used if(MSVC) set(CMAKE_DEBUG_POSTFIX "d") diff --git a/xsd/urdf.xsd b/xsd/urdf.xsd index 853fed5f..1709823e 100644 --- a/xsd/urdf.xsd +++ b/xsd/urdf.xsd @@ -319,7 +319,7 @@ - +