-
Notifications
You must be signed in to change notification settings - Fork 310
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
Cleanup all the deprecations warning from the recent ros2_control variant changes #1882
Comments
I'd like to take this one. Quick couple of questions. For example in this situation:
The original code is: double get_state(const std::string & interface_name) const
{
return system_states_.at(interface_name)->get_value();
} Since the new API signature is Ignoring it would not be an option for me, so this leaves 3 possibilities:
Either 1 or 2 would be acceptable for me (leaning towards 2, but that is just personal preference). In any case, new unit tests will have to be added... I charge extra karma for that :P Also, I see a lot of -Wunused-result:
Should I deal with those too? Is it OK to remove the deprecated API as I refactor? or should I leave them for backwards compatibility? |
mmmm looking at the [[deprecated("Use bool get_value(double & value) instead to retrieve the value.")]]
double get_value() const
{
std::shared_lock<std::shared_mutex> lock(handle_mutex_, std::try_to_lock);
if (!lock.owns_lock())
{
return std::numeric_limits<double>::quiet_NaN();
}
// BEGIN (Handle export change): for backward compatibility
// TODO(Manuel) return value_ if old functionality is removed
THROW_ON_NULLPTR(value_ptr_);
return *value_ptr_;
// END
} |
Hello @MartinPeris! First of all, I want to apologize for not getting back to your earlier. For your question! I think we should also deprecate them that have void and instead they have to return bool the one from the handles. and so, we will have it similar to the Handles. Something like the following: ros2_control/hardware_interface/include/hardware_interface/handle.hpp Lines 175 to 188 in 038a05f
So, the user will be able to know if what he gets is valid or not. You can add the gcc ignore deprecated warnings to the deprecated methods, so we don't see them any more. What do you think of this approach? @MartinPeris @ros-controls/ros2-maintainers |
Recently after the new variants feature in Handles (#1688) We have a bunch of deprecation warnings that needs to be cleanup. This could be a nice first issue.
The text was updated successfully, but these errors were encountered: