|
From: <hsu...@us...> - 2009-02-13 00:06:07
|
Revision: 11069
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=11069&view=rev
Author: hsujohnhsu
Date: 2009-02-13 00:06:04 +0000 (Fri, 13 Feb 2009)
Log Message:
-----------
correct cg location is relative to geom, not body, so subtrace collision origin from com-xyz.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/src/urdf2factory.cpp
pkg/trunk/robot_descriptions/gazebo_robot_description/src/urdf2gazebo.cpp
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/urdf2factory.cpp
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/urdf2factory.cpp 2009-02-12 23:58:06 UTC (rev 11068)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/urdf2factory.cpp 2009-02-13 00:06:04 UTC (rev 11069)
@@ -225,7 +225,11 @@
static const char tagList2[3][3] = {"cx", "cy", "cz"};
for (int j = 0 ; j < 3 ; ++j)
- addKeyValue(geom, tagList2[j], values2str(1, link->inertial->com + j));
+ {
+ // by doing this we support only 1 geom
+ double tmp_value = (link->inertial->com)[j] - (link->collision->xyz)[j];
+ addKeyValue(geom, tagList2[j], values2str(1, &tmp_value));
+ }
if (link->collision->geometry->type == robot_desc::URDF::Link::Geometry::MESH)
{
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/src/urdf2gazebo.cpp
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/src/urdf2gazebo.cpp 2009-02-12 23:58:06 UTC (rev 11068)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/src/urdf2gazebo.cpp 2009-02-13 00:06:04 UTC (rev 11069)
@@ -213,7 +213,11 @@
static const char tagList2[3][3] = {"cx", "cy", "cz"};
for (int j = 0 ; j < 3 ; ++j)
- addKeyValue(geom, tagList2[j], values2str(1, link->inertial->com + j));
+ {
+ // by doing this we support only 1 geom
+ double tmp_value = (link->inertial->com)[j] - (link->collision->xyz)[j];
+ addKeyValue(geom, tagList2[j], values2str(1, &tmp_value));
+ }
if (link->collision->geometry->type == robot_desc::URDF::Link::Geometry::MESH)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|