Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
davetcoleman committed Apr 8, 2014
2 parents 78cf799 + 892ab9b commit bfe2da9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 47 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required( VERSION 2.8 FATAL_ERROR )
project (urdfdom CXX C)

set (URDF_MAJOR_VERSION 0)
set (URDF_MINOR_VERSION 2)
set (URDF_PATCH_VERSION 10)
set (URDF_MINOR_VERSION 3)
set (URDF_PATCH_VERSION 0)

set (URDF_VERSION ${URDF_MAJOR_VERSION}.${URDF_MINOR_VERSION}.${URDF_PATCH_VERSION})

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ wget https://raw.github.com/ros-gbp/urdfdom-release/debian/hydro/precise/urdfdom

### Installing from Source with ROS Debians

**Warning: this will break ABI compatibility with future /opt/ros updates through the debian package manager. This is a hack, use at your own risk.**

If you want to install urdfdom from source, but not install all of ROS from source, you can follow these loose guidelines.
This is not best practice for installing, but works.
This version is for ROS Hydro but should be easily customized for future version of ROS:

```
sudo mv /opt/ros/hydro/include/urdf_parser/exportdecl.h /opt/ros/hydro/include/urdf_parser/_exportdecl.h
sudo mv /opt/ros/hydro/include/urdf_parser/urdf_parser.h /opt/ros/hydro/include/urdf_parser/_urdf_parser.h
sudo mv /opt/ros/hydro/include/urdf_parser/ /opt/ros/hydro/include/_urdf_parser/
sudo mv /opt/ros/hydro/lib/liburdfdom_model.so /opt/ros/hydro/lib/_liburdfdom_model.so
sudo mv /opt/ros/hydro/lib/liburdfdom_model_state.so /opt/ros/hydro/lib/_liburdfdom_model_state.so
sudo mv /opt/ros/hydro/lib/liburdfdom_sensor.so /opt/ros/hydro/lib/_liburdfdom_sensor.so
Expand Down
4 changes: 2 additions & 2 deletions cmake/urdfdom-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ if (@PKG_NAME@_CONFIG_INCLUDED)
endif()
set(@PKG_NAME@_CONFIG_INCLUDED TRUE)

set(@PKG_NAME@_INCLUDE_DIRS @CMAKE_INSTALL_PREFIX@/include)
set(@PKG_NAME@_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include")

foreach(lib @PKG_LIBRARIES@)
set(onelib "${lib}-NOTFOUND")
find_library(onelib ${lib}
PATHS @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
PATHS "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@"
NO_DEFAULT_PATH
)
if(NOT onelib)
Expand Down
8 changes: 4 additions & 4 deletions urdf_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ include_directories(include)

add_library(urdfdom_world SHARED src/pose.cpp src/model.cpp src/link.cpp src/joint.cpp src/world.cpp)
target_link_libraries(urdfdom_world ${tinyxml_libraries} ${console_bridge_LIBRARIES} ${Boost_LIBRARIES})
#set_target_properties(urdfdom_world PROPERTIES SOVERSION 0.2)
set_target_properties(urdfdom_world PROPERTIES SOVERSION 0.3)

add_library(urdfdom_model SHARED src/pose.cpp src/model.cpp src/link.cpp src/joint.cpp)
target_link_libraries(urdfdom_model ${tinyxml_libraries} ${console_bridge_LIBRARIES} ${Boost_LIBRARIES})
#set_target_properties(urdfdom_model PROPERTIES SOVERSION 0.2)
set_target_properties(urdfdom_model PROPERTIES SOVERSION 0.3)

add_library(urdfdom_sensor SHARED src/urdf_sensor.cpp)
target_link_libraries(urdfdom_sensor urdfdom_model ${tinyxml_libraries} ${console_bridge_LIBRARIES} ${Boost_LIBRARIES})
#set_target_properties(urdfdom_sensor PROPERTIES SOVERSION 0.2)
set_target_properties(urdfdom_sensor PROPERTIES SOVERSION 0.3)

add_library(urdfdom_model_state SHARED src/urdf_model_state.cpp src/twist.cpp)
target_link_libraries(urdfdom_model_state ${tinyxml_libraries} ${console_bridge_LIBRARIES} ${Boost_LIBRARIES})
#set_target_properties(urdfdom_model_state PROPERTIES SOVERSION 0.2)
set_target_properties(urdfdom_model_state PROPERTIES SOVERSION 0.3)

# --------------------------------

Expand Down
44 changes: 7 additions & 37 deletions urdf_parser/src/link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@ bool parseVisual(Visual &vis, TiXmlElement *config)
if (!vis.geometry)
return false;

const char *name_char = config->Attribute("name");
if (name_char)
vis.name = name_char;

// Material
TiXmlElement *mat = config->FirstChildElement("material");
if (mat) {
Expand All @@ -380,11 +384,6 @@ bool parseVisual(Visual &vis, TiXmlElement *config)
}
}

vis.group_name = std::string("default");
const char *group_name_char = config->Attribute("group");
if (group_name_char)
logWarn("The notion of a group name for visual tags is not supported by URDF.");

return true;
}

Expand All @@ -405,10 +404,9 @@ bool parseCollision(Collision &col, TiXmlElement* config)
if (!col.geometry)
return false;

col.group_name = std::string("default");
const char *group_name_char = config->Attribute("group");
if (group_name_char)
logWarn("The notion of a group name for collision tags is not supported by URDF.");
const char *name_char = config->Attribute("name");
if (name_char)
col.name = name_char;

return true;
}
Expand Down Expand Up @@ -439,27 +437,13 @@ bool parseLink(Link &link, TiXmlElement* config)
}

// Multiple Visuals (optional)
// For backward compatibility, we fill the map from group_name to visual tag (for ROS Groovy);
// Please use the visual_array instead
for (TiXmlElement* vis_xml = config->FirstChildElement("visual"); vis_xml; vis_xml = vis_xml->NextSiblingElement("visual"))
{

boost::shared_ptr<Visual> vis;
vis.reset(new Visual());
if (parseVisual(*vis, vis_xml))
{
boost::shared_ptr<std::vector<boost::shared_ptr<Visual > > > viss = link.getVisuals(vis->group_name);
if (!viss)
{
// group does not exist, create one and add to map
viss.reset(new std::vector<boost::shared_ptr<Visual > >);
// new group name, create vector, add vector to map and add Visual to the vector
link.visual_groups.insert(make_pair(vis->group_name,viss));
}

// group exists, add Visual to the vector in the map
viss->push_back(vis);

link.visual_array.push_back(vis);
}
else
Expand All @@ -476,26 +460,12 @@ bool parseLink(Link &link, TiXmlElement* config)
link.visual = link.visual_array[0];

// Multiple Collisions (optional)
// For backward compatibility, we fill the map from group_name to collision tag (for ROS Groovy);
// Please use the collision_array instead
for (TiXmlElement* col_xml = config->FirstChildElement("collision"); col_xml; col_xml = col_xml->NextSiblingElement("collision"))
{
boost::shared_ptr<Collision> col;
col.reset(new Collision());
if (parseCollision(*col, col_xml))
{
boost::shared_ptr<std::vector<boost::shared_ptr<Collision > > > cols = link.getCollisions(col->group_name);

if (!cols)
{
// group does not exist, create one and add to map
cols.reset(new std::vector<boost::shared_ptr<Collision > >);
// new group name, create vector, add vector to map and add Collision to the vector
link.collision_groups.insert(make_pair(col->group_name,cols));
}

// group exists, add Collision to the vector in the map
cols->push_back(col);
link.collision_array.push_back(col);
}
else
Expand Down

0 comments on commit bfe2da9

Please sign in to comment.