|
From: <rdi...@us...> - 2008-11-13 03:56:47
|
Revision: 6656
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=6656&view=rev
Author: rdiankov
Date: 2008-11-13 03:56:36 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
fixed some urdf2openrave bugs, gripper kinematics now perfect, changed dependencies around
Modified Paths:
--------------
pkg/trunk/robot_descriptions/gazebo_robot_description/manifest.xml
pkg/trunk/robot_descriptions/openrave_robot_description/CMakeLists.txt
pkg/trunk/robot_descriptions/openrave_robot_description/src/urdf2openrave.cpp
pkg/trunk/util/resource_locator/manifest.xml
pkg/trunk/util/resource_locator/src/reslocator.cpp
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/manifest.xml
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/manifest.xml 2008-11-13 03:03:24 UTC (rev 6655)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/manifest.xml 2008-11-13 03:56:36 UTC (rev 6656)
@@ -7,5 +7,5 @@
<depend package="wg_robot_description"/>
<depend package="wg_robot_description_parser"/>
<depend package="libTF"/>
-
+ <depend package="ogre_tools"/>
</package>
Modified: pkg/trunk/robot_descriptions/openrave_robot_description/CMakeLists.txt
===================================================================
--- pkg/trunk/robot_descriptions/openrave_robot_description/CMakeLists.txt 2008-11-13 03:03:24 UTC (rev 6655)
+++ pkg/trunk/robot_descriptions/openrave_robot_description/CMakeLists.txt 2008-11-13 03:56:36 UTC (rev 6656)
@@ -8,15 +8,6 @@
find_ros_package(openrave_robot_description)
get_target_property(urdf2openrave_exe urdf2openrave LOCATION)
-find_package( Boost COMPONENTS regex )
-if( NOT ${Boost_regex_FOUND} )
- message(SEND_ERROR "could not find boost-regex")
-endif()
-
-include_directories(${Boost_INCLUDE_DIRS})
-link_directories(${Boost_LIBRARY_DIRS})
-target_link_libraries(urdf2openrave ${Boost_LIBRARIES})
-
# process all urdf files
set(PR2_OUTPUT ${openrave_robot_description_PACKAGE_PATH}/robots/pr2.robot.xml)
set(PR2_INPUT ${wg_robot_description_PACKAGE_PATH}/pr2/pr2.xml)
Modified: pkg/trunk/robot_descriptions/openrave_robot_description/src/urdf2openrave.cpp
===================================================================
--- pkg/trunk/robot_descriptions/openrave_robot_description/src/urdf2openrave.cpp 2008-11-13 03:03:24 UTC (rev 6655)
+++ pkg/trunk/robot_descriptions/openrave_robot_description/src/urdf2openrave.cpp 2008-11-13 03:56:36 UTC (rev 6656)
@@ -64,11 +64,6 @@
return ss.str();
}
-double rad2deg(double v)
-{
- return v * 180.0 / M_PI;
-}
-
void setupTransform(libTF::Pose3D &transform, const double *xyz, const double *rpy)
{
transform.setFromEuler(xyz[0], xyz[1], xyz[2], rpy[2], rpy[1], rpy[0]);
@@ -259,6 +254,13 @@
joint->SetAttribute("type", jtype);
joint->SetAttribute("name", link->joint->name);
+ if( link->joint->pjointMimic != NULL ) {
+ stringstream ss;
+ ss << link->joint->pjointMimic->name << " " << link->joint->fMimicMult << " " << link->joint->fMimicOffset;
+ joint->SetAttribute("mimic",ss.str());
+ joint->SetAttribute("enable","false");
+ }
+
addKeyValue(joint, "body", link->name);
addKeyValue(joint, "body", link->parentName);
addKeyValue(joint, "offsetfrom", link->name);
@@ -272,18 +274,18 @@
addKeyValue(joint, "axis", values2str(3, link->joint->axis));
addKeyValue(joint, "anchor", values2str(3, link->joint->anchor));
- if (enforce_limits && link->joint->isSet["limit"]) {
+ if (link->joint->pjointMimic == NULL && enforce_limits && link->joint->isSet["limit"]) {
if (jtype == "slider") {
addKeyValue(joint, "lostop", values2str(1, link->joint->limit ));
addKeyValue(joint, "histop", values2str(1, link->joint->limit + 1 ));
}
else {
- addKeyValue(joint, "lostop", values2str(1, link->joint->limit , rad2deg));
- addKeyValue(joint, "histop", values2str(1, link->joint->limit + 1, rad2deg));
+ addKeyValue(joint, "lostop", values2str(1, link->joint->limit));
+ addKeyValue(joint, "histop", values2str(1, link->joint->limit + 1));
}
}
}
-
+
root->LinkEndChild(joint);
}
Modified: pkg/trunk/util/resource_locator/manifest.xml
===================================================================
--- pkg/trunk/util/resource_locator/manifest.xml 2008-11-13 03:03:24 UTC (rev 6655)
+++ pkg/trunk/util/resource_locator/manifest.xml 2008-11-13 03:56:36 UTC (rev 6656)
@@ -14,7 +14,7 @@
<cpp cflags="-I${prefix}/include" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib -lresource_locator"/>
</export>
- <sysdepend os="ubuntu" version="7.04-gutsy" package="libboost-regex-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libboost-regex-dev"/>
-
+ <sysdepend os="ubuntu" version="7.10-gutsy" package="libboost-regex-dev"/>
+ <sysdepend os="ubuntu" version="8.04-hardy" package="libboost-regex-dev"/>
+ <sysdepend os="ubuntu" version="8.10-intrepid" package="libboost-regex-dev"/>
</package>
Modified: pkg/trunk/util/resource_locator/src/reslocator.cpp
===================================================================
--- pkg/trunk/util/resource_locator/src/reslocator.cpp 2008-11-13 03:03:24 UTC (rev 6655)
+++ pkg/trunk/util/resource_locator/src/reslocator.cpp 2008-11-13 03:56:36 UTC (rev 6656)
@@ -46,35 +46,35 @@
boost::regex re("(ros-pkg|ros-param):\\/\\/((\\w+\\.)*(\\w*))\\/([\\w\\d]+\\/{0,1})+");
if (boost::regex_match(resource.c_str(), matches, re) && matches.size() >= 3){
- std::string protocol(matches[1].first, matches[1].second);
- std::string protocol_path(matches[2].first, matches[2].second);
- std::string relpath(matches[2].second,matches[matches.size()-1].second);
+ std::string protocol(matches[1].first, matches[1].second);
+ std::string protocol_path(matches[2].first, matches[2].second);
+ std::string relpath(matches[2].second,matches[matches.size()-1].second);
- if( protocol == std::string("ros-pkg") ) {
- // find the ROS package
- FILE* f = popen((std::string("rospack find ") + protocol_path).c_str(),"r");
- if( f == NULL )
- ROS_ERROR("%s\n", (std::string("failed to launch rospack find ") + protocol_path).c_str());
- else {
- char basepath[1024];
- fgets(basepath, sizeof(basepath), f);
- pclose(f);
+ if( protocol == std::string("ros-pkg") ) {
+ // find the ROS package
+ FILE* f = popen((std::string("rospack find ") + protocol_path).c_str(),"r");
+ if( f == NULL )
+ ROS_ERROR("%s\n", (std::string("failed to launch rospack find ") + protocol_path).c_str());
+ else {
+ char basepath[1024];
+ fgets(basepath, sizeof(basepath), f);
+ pclose(f);
- // strip out any new lines or spaces from the end
- int len = strlen(basepath);
- char* p = basepath+len-1;
- while(len-- > 0 && (*p == ' ' || *p == '\n' || *p == '\t' || *p == '\r'))
- *p-- = 0;
- return std::string(basepath) + relpath;
- }
- }
- else if( protocol == std::string("ros-param") )
- {
- return "";
- }
+ // strip out any new lines or spaces from the end
+ int len = strlen(basepath);
+ char* p = basepath+len-1;
+ while(len-- > 0 && (*p == ' ' || *p == '\n' || *p == '\t' || *p == '\r'))
+ *p-- = 0;
+ return std::string(basepath) + relpath;
+ }
+ }
+ else if( protocol == std::string("ros-param") )
+ {
+ return "";
+ }
}
else // not a url so copy directly
- return resource;
+ return resource;
return "";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|