From 6369746caf4699d7fd8c8af6f05d8a160f01e590 Mon Sep 17 00:00:00 2001 From: hsu Date: Tue, 9 Mar 2010 22:24:25 +0000 Subject: [PATCH] use angles::to_degrees() to make the angles conversion from radians to degrees --- collada_urdf/manifest.xml | 1 + collada_urdf/src/urdf_to_collada.cpp | 8 +++++--- stack.xml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/collada_urdf/manifest.xml b/collada_urdf/manifest.xml index 50b67c6..b315558 100644 --- a/collada_urdf/manifest.xml +++ b/collada_urdf/manifest.xml @@ -11,4 +11,5 @@ + diff --git a/collada_urdf/src/urdf_to_collada.cpp b/collada_urdf/src/urdf_to_collada.cpp index cc4633f..1ce34c7 100644 --- a/collada_urdf/src/urdf_to_collada.cpp +++ b/collada_urdf/src/urdf_to_collada.cpp @@ -56,6 +56,8 @@ #include #include +#include + #include "STLLoader.h" using namespace std; @@ -533,8 +535,8 @@ public: // domJoint_limitsRef limits = daeSafeCast(revolute->createAndPlace(COLLADA_TYPE_LIMITS)); { - daeSafeCast(limits->createAndPlace(COLLADA_ELEMENT_MIN))->getValue() = urdf_joint->limits->lower * (180.0 / M_PI); - daeSafeCast(limits->createAndPlace(COLLADA_ELEMENT_MAX))->getValue() = urdf_joint->limits->upper * (180.0 / M_PI); + daeSafeCast(limits->createAndPlace(COLLADA_ELEMENT_MIN))->getValue() = angles::to_degrees(urdf_joint->limits->lower); + daeSafeCast(limits->createAndPlace(COLLADA_ELEMENT_MAX))->getValue() = angles::to_degrees(urdf_joint->limits->upper); } // } @@ -916,7 +918,7 @@ public: rot->getValue()[0] = ax; rot->getValue()[1] = ay; rot->getValue()[2] = az; - rot->getValue()[3] = aa * (180.0 / M_PI); + rot->getValue()[3] = angles::to_degrees(aa); return rot; } }; diff --git a/stack.xml b/stack.xml index e907ec8..ea2973b 100644 --- a/stack.xml +++ b/stack.xml @@ -12,7 +12,7 @@ http://ros.org/wiki/robot_model - +