Skip to content
This repository was archived by the owner on Aug 3, 2020. It is now read-only.

Conversation

@jspricke
Copy link
Member

urdfdom_headers uses C++ std::shared_ptr. As it exports it as custom
*SharedPtr type, we can use the to sty compatible.

@scpeters
Copy link
Contributor

I'm going to close and re-open to trigger the ROS build farm pull request testing.

@scpeters scpeters closed this Aug 24, 2016
@scpeters scpeters reopened this Aug 24, 2016
@scpeters
Copy link
Contributor

travis failed because it tests indigo and jade, but the ROS build farm is happy when testing with kinetic

@scpeters
Copy link
Contributor

Will this be a problem for debian jessie, which doesn't have urdfdom 0.4 (it has 0.3)?

@jspricke
Copy link
Member Author

It needs at least urdfdom 0.4.

@bmagyar
Copy link
Contributor

bmagyar commented Nov 1, 2016

Keep this one in mind too:
#153

urdfdom_headers uses C++ std::shared_ptr. As it exports it as a custom
*SharedPtr type, we can use them to stay compatible.
@jspricke jspricke force-pushed the urdfdom_headers_fix branch from 0d684c2 to b9e7729 Compare November 4, 2016 21:56
@jspricke
Copy link
Member Author

jspricke commented Nov 4, 2016

Rebased on current master. Note that Travis still fails due to urdfdom being too old. Also this needs #165 now as well.

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinetic is also supported on Wily and Jessie which do not yet ship with urdfdom 0.4. Use the compatibility header from urdf package.

USERDATA(double scale) : scale(scale) {
}
double scale;
#if __cplusplus <= 199711L
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The decision for boost::shared_ptr vs. std::shared_ptr shouldn't implicitly depend on the c++ version, but it should be an deliberative decision of the developer. You should declare a type VoidSharedPtr for this.

#include <boost/function.hpp>

#include <urdf_model/model.h>
#include <urdf_world/types.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This include doesn't exist in Kinect on Wily and Jessie. You should use the compatibility header of the urdfpackage instead to safely define ModelInterfaceSharedPtr.

}

_getUserData(pdomjoint)->p = pjoint;
#if __cplusplus <= 199711L
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above


find_package(catkin REQUIRED)
find_package(urdfdom_headers REQUIRED)
find_package(urdfdom_headers 0.4 REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not feasible for Kinetic on Wily and Jessie.

#define URDF_PARSER_PLUGIN_H

#include <urdf_model/model.h>
#include <urdf_world/types.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

<buildtool_depend>catkin</buildtool_depend>
<build_depend>liburdfdom-headers-dev</build_depend>
<run_depend>liburdfdom-headers-dev</run_depend>
<build_depend version_gte="0.4">liburdfdom-headers-dev</build_depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinetic is also supported on Wily and Jessie which do not yet ship with urdfdom 0.4. Use the compatibility header from urdf package.

@rhaschke
Copy link
Contributor

rhaschke commented Nov 6, 2016

Note that Travis still fails due to urdfdom being too old. Also this needs #165 now as well.

You should update .travis.yml to build the Kinetic branch against a Kinetic ROS.

@jspricke
Copy link
Member Author

jspricke commented Nov 6, 2016

@rhaschke Thanks for the review, I've integrated your proposals.

@jspricke jspricke mentioned this pull request Nov 6, 2016
Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Thanks for taking the effort to replace all those type definitions. Please consider minor comments.

.travis.yml Outdated
matrix:
- CI_ROS_DISTRO="indigo"
- CI_ROS_DISTRO="jade"
- CI_ROS_DISTRO="kinetic"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Replacing Indigo and Jade with Kinetic wasn't a good advice. Travis is stuck to a Trusty system, which doesn't support Kinetic. Please revert this. Using the compatibility header, the Kinetic branch should compile in Indigo and Jade too now.

#define URDF_PARSER_PLUGIN_H

#include <urdf_model/model.h>
#include <urdf/urdfdom_compatibility.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires package urdf as a build dependency too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also means you need to have urdf as a run_depend. If we were using package xml version 2, it would be a build_export_depend. Basically, since there is no separate -dev package urdf needs to be installed at "run time" so other packages would be able to build against it. This is likely handled implicitly as a transitive dependency of one of the other run_depend's.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would result in a circular dependency, as we tried already ;).


URDF_TYPEDEF_CLASS_POINTER(ModelInterface);

typedef boost::shared_ptr<void> VoidSharedPtr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you define VoidSharedPtrhere? This is a compatibility header to declare types of urdfdom. However, VoidSharedPtris only used internally by ColladaParser. Hence, the declaration should go to collada_parser/src/collada_parser.cpp:179.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how to do it, as we would need @URDFDOM_DECLARE_TYPES@ in there to ifdef between the different urdfdom versions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..we cloud export a define in the urdf/urdfdom_compatibility.h.in, would that be ok?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see your issue. VoidSharedPtris a datatype declared and used internally in ColladaParseronly. It's not related to urdfdomor urdf package. You simply typedef boost::shared_ptr<void> VoidSharedPtr just before collada_parser/src/collada_parser.cpp:179.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we need to differentiate between boost::shared_ptr and std::shared_ptr depending on the urdfdom version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not at all. VoidSharedPtr doesn't depend on urdfdom. It's introduced only in ColladaParser. It's the free choice of the ColladaParserdeveloper when to switch to std::shared_ptr for this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it's used to point to either point to urdf::LinkSharedPtr or urdf::JointSharedPtr
So it depends on them.
(not commenting on the programming style)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Didn't look that deep into the code. Nevertheless, VoidSharedPtr is a type within ColladaParser and should be declared there and not in the urdf package. You can convert between std::sharedptr and boost::sharedptr like this:

http://stackoverflow.com/questions/12314967/cohabitation-of-boostshared-ptr-and-stdshared-ptr#comment28669000_12315035


<buildtool_depend>catkin</buildtool_depend>
<build_depend>liburdfdom-headers-dev</build_depend>
<build_depend>urdf</build_depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh! This defines now a circular dependency:

07:42:37 Error: Circular dependency in subset of packages: urdf, urdf_parser_plugin
07:42:37 Can not build workspace with circular dependency

You only need to have the urdf headers to be present. As it worked for you before (compatibility_header.h was found), it's probably safe to drop this dependency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw it as well, done :)

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than a small comment, the changes lgtm. Thanks for working on it guys.

@wjwwood
Copy link
Member

wjwwood commented Nov 7, 2016

@scpeters Do you have any feedback before this gets merged?

@wjwwood wjwwood merged commit 409c4b9 into ros:kinetic-devel Jan 5, 2017
@jspricke jspricke deleted the urdfdom_headers_fix branch January 5, 2017 15:47
v4hn pushed a commit to v4hn/robot_model that referenced this pull request Feb 1, 2017
* Use urdf::*SharedPtr instead of boost::shared_ptr

urdfdom_headers uses C++ std::shared_ptr. As it exports it as a custom
*SharedPtr type, we can use them to stay compatible.

* Add compatibility urdf::VoidSharedPtr

* Use urdfdom compatibility header

* Build kinetic for kinetic branch

* Add missing namespace and includes

* Revert "Build kinetic for kinetic branch"

This reverts commit f1c085c.

* Add build dependency

* Revert "Add build dependency"

This reverts commit 9417509.

* Export urdfdom version to header

* Add dummy version in case it's not set by urdfdom_headers

* Add missing header
clalancette pushed a commit that referenced this pull request Feb 14, 2017
* Use urdf::*SharedPtr instead of boost::shared_ptr

urdfdom_headers uses C++ std::shared_ptr. As it exports it as a custom
*SharedPtr type, we can use them to stay compatible.

* Add compatibility urdf::VoidSharedPtr

* Use urdfdom compatibility header

* Build kinetic for kinetic branch

* Add missing namespace and includes

* Revert "Build kinetic for kinetic branch"

This reverts commit f1c085c.

* Add build dependency

* Revert "Add build dependency"

This reverts commit 9417509.

* Export urdfdom version to header

* Add dummy version in case it's not set by urdfdom_headers

* Add missing header
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants