-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single controller template #302
Closed
mikepurvis
wants to merge
11
commits into
ros-controls:melodic-devel
from
mikepurvis:single-controller-template
Closed
Single controller template #302
mikepurvis
wants to merge
11
commits into
ros-controls:melodic-devel
from
mikepurvis:single-controller-template
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c8fbd90
to
a2b3390
Compare
iwanders
reviewed
Aug 31, 2018
const std::string sdp = suffix+delimiter+prefix; | ||
std::stringstream ss; | ||
ss << prefix; | ||
std::copy(val.begin(), val.end(), std::ostream_iterator<class T::value_type>(ss, sdp.c_str())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-7 complains about class
here:
robothw_interfaces.h:60:68: error: typedef 'value_type' cannot be referenced with a class specifier
std::copy(val.begin(), val.end(), std::ostream_iterator<class T::value_type>(ss, sdp.c_str()));
^
using typename
works without problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also dies with Clang 6
What is the state of this? Is there something missing to merge?
…On Fri, 31 Aug 2018, 16:44 Ivor Wanders, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
controller_interface/include/controller_interface/internal/robothw_interfaces.h
<#302 (comment)>
:
> +namespace internal
+{
+
+template <class T>
+inline std::string enumerateElements(const T& val,
+ const std::string& delimiter,
+ const std::string& prefix,
+ const std::string& suffix)
+{
+ std::string ret;
+ if (val.empty()) {return ret;}
+
+ const std::string sdp = suffix+delimiter+prefix;
+ std::stringstream ss;
+ ss << prefix;
+ std::copy(val.begin(), val.end(), std::ostream_iterator<class T::value_type>(ss, sdp.c_str()));
Clang-7 complains about class here:
robothw_interfaces.h:60:68: error: typedef 'value_type' cannot be referenced with a class specifier
std::copy(val.begin(), val.end(), std::ostream_iterator<class T::value_type>(ss, sdp.c_str()));
^
using typename works without problems.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#302 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADXH4ZE9vhWknFYDhrxItUp0jCpLLWUPks5uWVnNgaJpZM4SAnXL>
.
|
Closed in favour of #387. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As hinted at in #299 (comment), with C++11 it's now possible to achieve all features of
MultiInterfaceController
with a singleController
template that doesn't break the existing API. You basically get aninit()
function which includes pointers to all the hardware interfaces you specify in the template instantiation, eg:With a single argument, this is the same as the legacy
Controller
usage. For compatibility with existingMultiInterfaceController
, a deprecated adapter header is supplied which populates a reducedRobotHW
as it worked before.I'd propose this as a change for ROS Melodic, and removing the now deprecated
multi_interface_controller.h
in ROS N.Note that the diff given here is pretty unhelpful. I'd suggest reviewing the new versions of the headers directly:
https://github.com/mikepurvis/ros_control/blob/single-controller-template/controller_interface/include/controller_interface/controller.h
https://github.com/mikepurvis/ros_control/blob/single-controller-template/controller_interface/include/controller_interface/multi_interface_controller.h
@adolfo-rt in particular I'm interested to hear from, as he was the original author of
MultiInterfaceController
, upon which this work builds heavily.