Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ros/collada_urdf/, dev-ros/collada_urdf/files/
Date: Tue, 26 Jul 2016 09:25:21
Message-Id: 1469524710.083207741bc59c0dc3e4c15a982225c94e3ee8af.aballier@gentoo
1 commit: 083207741bc59c0dc3e4c15a982225c94e3ee8af
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 26 08:04:33 2016 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 26 09:18:30 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08320774
7
8 dev-ros/collada_urdf: fix build with urdfdom1
9
10 Package-Manager: portage-2.3.0
11
12 ...1.12.3.ebuild => collada_urdf-1.12.3-r1.ebuild} | 10 +-
13 dev-ros/collada_urdf/files/urdfdom1.patch | 185 +++++++++++++++++++++
14 2 files changed, 193 insertions(+), 2 deletions(-)
15
16 diff --git a/dev-ros/collada_urdf/collada_urdf-1.12.3.ebuild b/dev-ros/collada_urdf/collada_urdf-1.12.3-r1.ebuild
17 similarity index 76%
18 rename from dev-ros/collada_urdf/collada_urdf-1.12.3.ebuild
19 rename to dev-ros/collada_urdf/collada_urdf-1.12.3-r1.ebuild
20 index bea7a16..ef087a9 100644
21 --- a/dev-ros/collada_urdf/collada_urdf-1.12.3.ebuild
22 +++ b/dev-ros/collada_urdf/collada_urdf-1.12.3-r1.ebuild
23 @@ -7,7 +7,7 @@ ROS_REPO_URI="https://github.com/ros/robot_model"
24 KEYWORDS="~amd64 ~arm"
25 ROS_SUBDIR=${PN}
26
27 -inherit ros-catkin
28 +inherit ros-catkin flag-o-matic
29
30 DESCRIPTION="Tool to convert Unified Robot Description Format (URDF) documents into COLLADA documents"
31 LICENSE="BSD"
32 @@ -19,7 +19,7 @@ RDEPEND="
33 dev-ros/angles
34 dev-ros/collada_parser
35 dev-ros/resource_retriever
36 - dev-ros/urdf
37 + >=dev-ros/urdf-1.12.3-r1
38 dev-ros/geometric_shapes
39 dev-ros/tf
40 media-libs/assimp
41 @@ -27,3 +27,9 @@ RDEPEND="
42 dev-libs/collada-dom
43 "
44 DEPEND="${RDEPEND}"
45 +PATCHES=( "${FILESDIR}/urdfdom1.patch" )
46 +
47 +src_configure() {
48 + append-cxxflags -std=gnu++11
49 + ros-catkin_src_configure
50 +}
51
52 diff --git a/dev-ros/collada_urdf/files/urdfdom1.patch b/dev-ros/collada_urdf/files/urdfdom1.patch
53 new file mode 100644
54 index 0000000..dd47d87
55 --- /dev/null
56 +++ b/dev-ros/collada_urdf/files/urdfdom1.patch
57 @@ -0,0 +1,185 @@
58 +Index: collada_urdf/src/collada_urdf.cpp
59 +===================================================================
60 +--- collada_urdf.orig/src/collada_urdf.cpp
61 ++++ collada_urdf/src/collada_urdf.cpp
62 +@@ -538,7 +538,7 @@ private:
63 + domInstance_with_extraRef piscene;
64 + };
65 +
66 +- typedef std::map< boost::shared_ptr<const urdf::Link>, urdf::Pose > MAPLINKPOSES;
67 ++ typedef std::map< std::shared_ptr<const urdf::Link>, urdf::Pose > MAPLINKPOSES;
68 + struct LINKOUTPUT
69 + {
70 + list<pair<int,string> > listusedlinks;
71 +@@ -562,7 +562,7 @@ private:
72 + axis_output() : iaxis(0) {
73 + }
74 + string sid, nodesid;
75 +- boost::shared_ptr<const urdf::Joint> pjoint;
76 ++ std::shared_ptr<const urdf::Joint> pjoint;
77 + int iaxis;
78 + string jointnodesid;
79 + };
80 +@@ -788,7 +788,7 @@ protected:
81 +
82 + for(size_t idof = 0; idof < _ikmout->vaxissids.size(); ++idof) {
83 + string axis_infosid = _ComputeId(str(boost::format("axis_info_inst%d")%idof));
84 +- boost::shared_ptr<const urdf::Joint> pjoint = _ikmout->kmout->vaxissids.at(idof).pjoint;
85 ++ std::shared_ptr<const urdf::Joint> pjoint = _ikmout->kmout->vaxissids.at(idof).pjoint;
86 + BOOST_ASSERT(_mapjointindices[pjoint] == (int)idof);
87 + //int iaxis = _ikmout->kmout->vaxissids.at(idof).iaxis;
88 +
89 +@@ -966,7 +966,7 @@ protected:
90 + kmout->vlinksids.resize(_robot.links_.size());
91 +
92 + FOREACHC(itjoint, _robot.joints_) {
93 +- boost::shared_ptr<urdf::Joint> pjoint = itjoint->second;
94 ++ std::shared_ptr<urdf::Joint> pjoint = itjoint->second;
95 + int index = _mapjointindices[itjoint->second];
96 + domJointRef pdomjoint = daeSafeCast<domJoint>(ktec->add(COLLADA_ELEMENT_JOINT));
97 + string jointid = _ComputeId(pjoint->name); //str(boost::format("joint%d")%index);
98 +@@ -1039,7 +1039,7 @@ protected:
99 + // create the formulas for all mimic joints
100 + FOREACHC(itjoint, _robot.joints_) {
101 + string jointsid = _ComputeId(itjoint->second->name);
102 +- boost::shared_ptr<urdf::Joint> pjoint = itjoint->second;
103 ++ std::shared_ptr<urdf::Joint> pjoint = itjoint->second;
104 + if( !pjoint->mimic ) {
105 + continue;
106 + }
107 +@@ -1125,7 +1125,7 @@ protected:
108 + /// \param pkinparent Kinbody parent
109 + /// \param pnodeparent Node parent
110 + /// \param strModelUri
111 +- virtual LINKOUTPUT _WriteLink(boost::shared_ptr<const urdf::Link> plink, daeElementRef pkinparent, domNodeRef pnodeparent, const string& strModelUri)
112 ++ virtual LINKOUTPUT _WriteLink(std::shared_ptr<const urdf::Link> plink, daeElementRef pkinparent, domNodeRef pnodeparent, const string& strModelUri)
113 + {
114 + LINKOUTPUT out;
115 + int linkindex = _maplinkindices[plink];
116 +@@ -1141,8 +1141,8 @@ protected:
117 + pnode->setSid(nodesid.c_str());
118 + pnode->setName(plink->name.c_str());
119 +
120 +- boost::shared_ptr<urdf::Geometry> geometry;
121 +- boost::shared_ptr<urdf::Material> material;
122 ++ std::shared_ptr<urdf::Geometry> geometry;
123 ++ std::shared_ptr<urdf::Material> material;
124 + urdf::Pose geometry_origin;
125 + if( !!plink->visual ) {
126 + geometry = plink->visual->geometry;
127 +@@ -1161,7 +1161,7 @@ protected:
128 + if ( !!plink->visual ) {
129 + if (plink->visual_array.size() > 1) {
130 + int igeom = 0;
131 +- for (std::vector<boost::shared_ptr<urdf::Visual > >::const_iterator it = plink->visual_array.begin();
132 ++ for (std::vector<std::shared_ptr<urdf::Visual > >::const_iterator it = plink->visual_array.begin();
133 + it != plink->visual_array.end(); it++) {
134 + // geom
135 + string geomid = _ComputeId(str(boost::format("g%s_%s_geom%d")%strModelUri%linksid%igeom));
136 +@@ -1208,7 +1208,7 @@ protected:
137 +
138 + // process all children
139 + FOREACHC(itjoint, plink->child_joints) {
140 +- boost::shared_ptr<urdf::Joint> pjoint = *itjoint;
141 ++ std::shared_ptr<urdf::Joint> pjoint = *itjoint;
142 + int index = _mapjointindices[pjoint];
143 +
144 + // <attachment_full joint="k1/joint0">
145 +@@ -1269,7 +1269,7 @@ protected:
146 + return out;
147 + }
148 +
149 +- domGeometryRef _WriteGeometry(boost::shared_ptr<urdf::Geometry> geometry, const std::string& geometry_id, urdf::Pose *org_trans = NULL)
150 ++ domGeometryRef _WriteGeometry(std::shared_ptr<urdf::Geometry> geometry, const std::string& geometry_id, urdf::Pose *org_trans = NULL)
151 + {
152 + domGeometryRef cgeometry = daeSafeCast<domGeometry>(_geometriesLib->add(COLLADA_ELEMENT_GEOMETRY));
153 + cgeometry->setId(geometry_id.c_str());
154 +@@ -1308,7 +1308,7 @@ protected:
155 + return cgeometry;
156 + }
157 +
158 +- void _WriteMaterial(const string& geometry_id, boost::shared_ptr<urdf::Material> material)
159 ++ void _WriteMaterial(const string& geometry_id, std::shared_ptr<urdf::Material> material)
160 + {
161 + string effid = geometry_id+string("_eff");
162 + string matid = geometry_id+string("_mat");
163 +@@ -1386,7 +1386,7 @@ protected:
164 + rigid_body->setSid(rigidsid.c_str());
165 + rigid_body->setName(itlink->second->name.c_str());
166 + domRigid_body::domTechnique_commonRef ptec = daeSafeCast<domRigid_body::domTechnique_common>(rigid_body->add(COLLADA_ELEMENT_TECHNIQUE_COMMON));
167 +- boost::shared_ptr<urdf::Inertial> inertial = itlink->second->inertial;
168 ++ std::shared_ptr<urdf::Inertial> inertial = itlink->second->inertial;
169 + if( !!inertial ) {
170 + daeSafeCast<domRigid_body::domTechnique_common::domDynamic>(ptec->add(COLLADA_ELEMENT_DYNAMIC))->setValue(xsBoolean(true)); //!!inertial));
171 + domTargetable_floatRef mass = daeSafeCast<domTargetable_float>(ptec->add(COLLADA_ELEMENT_MASS));
172 +@@ -1916,9 +1916,9 @@ private:
173 +
174 + boost::shared_ptr<instance_kinematics_model_output> _ikmout;
175 + boost::shared_ptr<instance_articulated_system_output> _iasout;
176 +- std::map< boost::shared_ptr<const urdf::Joint>, int > _mapjointindices;
177 +- std::map< boost::shared_ptr<const urdf::Link>, int > _maplinkindices;
178 +- std::map< boost::shared_ptr<const urdf::Material>, int > _mapmaterialindices;
179 ++ std::map< std::shared_ptr<const urdf::Joint>, int > _mapjointindices;
180 ++ std::map< std::shared_ptr<const urdf::Link>, int > _maplinkindices;
181 ++ std::map< std::shared_ptr<const urdf::Material>, int > _mapmaterialindices;
182 + Assimp::Importer _importer;
183 + };
184 +
185 +Index: collada_urdf/src/collada_to_urdf.cpp
186 +===================================================================
187 +--- collada_urdf.orig/src/collada_to_urdf.cpp
188 ++++ collada_urdf/src/collada_to_urdf.cpp
189 +@@ -188,7 +188,7 @@ void assimp_calc_bbox(string fname, floa
190 + }
191 + }
192 +
193 +-void addChildLinkNamesXML(boost::shared_ptr<const Link> link, ofstream& os)
194 ++void addChildLinkNamesXML(std::shared_ptr<const Link> link, ofstream& os)
195 + {
196 + os << " <link name=\"" << link->name << "\">" << endl;
197 + if ( !!link->visual ) {
198 +@@ -405,14 +405,14 @@ void addChildLinkNamesXML(boost::shared_
199 + }
200 + #endif
201 +
202 +- for (std::vector<boost::shared_ptr<Link> >::const_iterator child = link->child_links.begin(); child != link->child_links.end(); child++)
203 ++ for (std::vector<std::shared_ptr<Link> >::const_iterator child = link->child_links.begin(); child != link->child_links.end(); child++)
204 + addChildLinkNamesXML(*child, os);
205 + }
206 +
207 +-void addChildJointNamesXML(boost::shared_ptr<const Link> link, ofstream& os)
208 ++void addChildJointNamesXML(std::shared_ptr<const Link> link, ofstream& os)
209 + {
210 + double r, p, y;
211 +- for (std::vector<boost::shared_ptr<Link> >::const_iterator child = link->child_links.begin(); child != link->child_links.end(); child++){
212 ++ for (std::vector<std::shared_ptr<Link> >::const_iterator child = link->child_links.begin(); child != link->child_links.end(); child++){
213 + (*child)->parent_joint->parent_to_joint_origin_transform.rotation.getRPY(r,p,y);
214 + std::string jtype;
215 + if ( (*child)->parent_joint->type == urdf::Joint::UNKNOWN ) {
216 +@@ -443,7 +443,7 @@ void addChildJointNamesXML(boost::shared
217 + os << " <axis xyz=\"" << (*child)->parent_joint->axis.x << " ";
218 + os << (*child)->parent_joint->axis.y << " " << (*child)->parent_joint->axis.z << "\"/>" << endl;
219 + {
220 +- boost::shared_ptr<urdf::Joint> jt((*child)->parent_joint);
221 ++ std::shared_ptr<urdf::Joint> jt((*child)->parent_joint);
222 +
223 + if ( !!jt->limits ) {
224 + os << " <limit ";
225 +@@ -501,7 +501,7 @@ void addChildJointNamesXML(boost::shared
226 + }
227 + }
228 +
229 +-void printTreeXML(boost::shared_ptr<const Link> link, string name, string file)
230 ++void printTreeXML(std::shared_ptr<const Link> link, string name, string file)
231 + {
232 + std::ofstream os;
233 + os.open(file.c_str());
234 +@@ -667,7 +667,7 @@ int main(int argc, char** argv)
235 + }
236 + xml_file.close();
237 +
238 +- boost::shared_ptr<ModelInterface> robot;
239 ++ std::shared_ptr<ModelInterface> robot;
240 + if( xml_string.find("<COLLADA") != std::string::npos )
241 + {
242 + ROS_DEBUG("Parsing robot collada xml string");