moved recent to collada changes robot_model_collada2010 branch

This commit is contained in:
rdiankov 2010-12-01 20:58:22 +00:00
parent 6ee8c4c17e
commit ae9109c75b
6 changed files with 7 additions and 2740 deletions

View File

@ -52,25 +52,3 @@ Index: dom/make/domTest.mk
ifeq ($(os),ps3) ifeq ($(os),ps3)
# PS3 doesn't support C++ locales, so tell boost not to use them # PS3 doesn't support C++ locales, so tell boost not to use them
ccFlags += -DBOOST_NO_STD_LOCALE ccFlags += -DBOOST_NO_STD_LOCALE
--- dom/src/dae/daeSIDResolver.cpp
+++ dom/src/dae/daeSIDResolver.cpp
@@ -152,6 +152,18 @@
list<string>& remainingPart) {
remainingPart.clear();
+ // custom change for following instance urls (Rosen Diankov)
+ if ( strncmp( container->getElementName(), "instance_", 9 ) == 0 ) {
+ daeURI *uri = (daeURI*)container->getAttributeValue("url");
+ if ( uri != NULL && uri->getElement() != NULL ) {
+ daeElement *e = findWithDots( uri->getElement(), s, profile, finder, remainingPart );
+ if ( e != NULL ) {
+ //found it
+ return e;
+ }
+ }
+ }
+
// First see if the whole thing resolves correctly
if (daeElement* result = finder(container, s, profile))
return result;

View File

@ -22,7 +22,7 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
rosbuild_gensrv() rosbuild_gensrv()
#common commands for building c++ executables and libraries #common commands for building c++ executables and libraries
rosbuild_add_library(${PROJECT_NAME} src/link.cpp src/joint.cpp src/model.cpp src/collada_model_reader.cpp) rosbuild_add_library(${PROJECT_NAME} src/link.cpp src/joint.cpp src/model.cpp)
#target_link_libraries(${PROJECT_NAME} another_library) #target_link_libraries(${PROJECT_NAME} another_library)
rosbuild_add_boost_directories() rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread) #rosbuild_link_boost(${PROJECT_NAME} thread)

View File

@ -46,6 +46,7 @@
namespace urdf{ namespace urdf{
class Model class Model
{ {
public: public:
@ -85,7 +86,7 @@ public:
/// \brief complete list of Materials /// \brief complete list of Materials
std::map<std::string, boost::shared_ptr<Material> > materials_; std::map<std::string, boost::shared_ptr<Material> > materials_;
protected: private:
void clear(); void clear();
std::string name_; std::string name_;
@ -104,14 +105,13 @@ protected:
/// it's time to find the root Link /// it's time to find the root Link
bool initRoot(std::map<std::string, std::string> &parent_link_tree); bool initRoot(std::map<std::string, std::string> &parent_link_tree);
private:
/// Model is restricted to a tree for now, which means there exists one root link /// Model is restricted to a tree for now, which means there exists one root link
/// typically, root link is the world(inertial). Where world is a special link /// typically, root link is the world(inertial). Where world is a special link
/// or is the root_link_ the link attached to the world by PLANAR/FLOATING joint? /// or is the root_link_ the link attached to the world by PLANAR/FLOATING joint?
/// hmm... /// hmm...
boost::shared_ptr<Link> root_link_; boost::shared_ptr<Link> root_link_;
friend class ColladaModelReader;
}; };
} }

View File

@ -12,7 +12,7 @@
<depend package="tinyxml" /> <depend package="tinyxml" />
<depend package="roscpp" /> <depend package="roscpp" />
<depend package="colladadom" />
<export> <export>
<cpp cflags="-I${prefix}/include -I${prefix}/msg/cpp -I${prefix}/srv/cpp" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib -lurdf"/> <cpp cflags="-I${prefix}/include -I${prefix}/msg/cpp -I${prefix}/srv/cpp" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib -lurdf"/>
</export> </export>

File diff suppressed because it is too large Load Diff

View File

@ -41,11 +41,6 @@
namespace urdf{ namespace urdf{
bool urdfFromColladaFile(std::string const& daefilename, Model& model);
bool urdfFromColladaData(std::string const& data, Model& model);
bool urdfFromTiXML(TiXmlElement *robot_xml, Model& model);
bool IsColladaFile(const std::string& filename);
bool IsColladaData(const std::string& data);
Model::Model() Model::Model()
{ {
@ -64,10 +59,6 @@ void Model::clear()
bool Model::initFile(const std::string& filename) bool Model::initFile(const std::string& filename)
{ {
// necessary for COLLADA compatibility
if( 0&&IsColladaFile(filename) ) {
return urdfFromColladaFile(filename,*this);
}
TiXmlDocument xml_doc; TiXmlDocument xml_doc;
xml_doc.LoadFile(filename); xml_doc.LoadFile(filename);
@ -98,11 +89,6 @@ bool Model::initParam(const std::string& param)
bool Model::initString(const std::string& xml_string) bool Model::initString(const std::string& xml_string)
{ {
// necessary for COLLADA compatibility
if( IsColladaData(xml_string) ) {
return urdfFromColladaData(xml_string,*this);
}
TiXmlDocument xml_doc; TiXmlDocument xml_doc;
xml_doc.Parse(xml_string.c_str()); xml_doc.Parse(xml_string.c_str());
@ -118,13 +104,6 @@ bool Model::initXml(TiXmlDocument *xml_doc)
return false; return false;
} }
// necessary for COLLADA compatibility
if( !!xml_doc->RootElement() ) {
if( std::string("COLLADA") == xml_doc->RootElement()->ValueStr() ) {
return urdfFromTiXML(xml_doc->RootElement(),*this);
}
}
TiXmlElement *robot_xml = xml_doc->FirstChildElement("robot"); TiXmlElement *robot_xml = xml_doc->FirstChildElement("robot");
if (!robot_xml) if (!robot_xml)
{ {
@ -141,11 +120,6 @@ bool Model::initXml(TiXmlElement *robot_xml)
ROS_DEBUG("Parsing robot xml"); ROS_DEBUG("Parsing robot xml");
if (!robot_xml) return false; if (!robot_xml) return false;
// necessary for COLLADA compatibility
if( std::string("COLLADA") == robot_xml->ValueStr() ) {
return urdfFromTiXML(robot_xml,*this);
}
// Get robot name // Get robot name
const char *name = robot_xml->Attribute("name"); const char *name = robot_xml->Attribute("name");
if (!name) if (!name)