Skip to content
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

resource loaning #224

Merged
merged 19 commits into from
Nov 11, 2020
Merged

resource loaning #224

merged 19 commits into from
Nov 11, 2020

Conversation

Karsten1987
Copy link
Contributor

@Karsten1987 Karsten1987 commented Nov 4, 2020

Part four of #164

currently sits on top of #207

Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
@Karsten1987 Karsten1987 marked this pull request as draft November 4, 2020 03:31
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
@Karsten1987 Karsten1987 marked this pull request as ready for review November 4, 2020 20:36
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
@Karsten1987
Copy link
Contributor Author

I've added a set of function overloads in 7ac53d5 which lets the user add hardware components which are not declared in the URDF.
This is mainly with respect to the gazebo_ros2_control packages, which I believe create a hardware components dynamically based on the original URDF (not the ros2_control tags). There's no straightforward way for me to figure out how a gazebo plugin can be loaded twice, once as a hardware component as well as a gazebo plugin to use gazebo API.

Base automatically changed from allocate_components to master November 5, 2020 17:33
controller_manager/src/resource_manager.cpp Show resolved Hide resolved
controller_manager/src/resource_manager.cpp Show resolved Hide resolved
controller_manager/src/resource_manager.cpp Outdated Show resolved Hide resolved
controller_manager/src/resource_manager.cpp Show resolved Hide resolved
controller_manager/src/resource_manager.hpp Outdated Show resolved Hide resolved
controller_manager/test/test_resource_manager.cpp Outdated Show resolved Hide resolved
* move resource manager to hardware interface

Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>

* include functional for std::function

Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
@Karsten1987
Copy link
Contributor Author

I hope to have addressed all review comments @bmagyar

@bmagyar bmagyar requested a review from destogl November 10, 2020 07:02
@Karsten1987 Karsten1987 merged commit 993db54 into master Nov 11, 2020
@Karsten1987 Karsten1987 deleted the resource_loaning branch November 11, 2020 05:08
@Karsten1987
Copy link
Contributor Author

@destogl please go ahead and open follow-up tickets or continue to comment on this PR in case you have outstanding comments.

@destogl
Copy link
Member

destogl commented Nov 13, 2020

I don't have major comments, just need a few clarifications. For example, I am missing unclaiming of the command_interfaces.

@Karsten1987
Copy link
Contributor Author

The "unclaiming" happens implicit in the destructor of the LoanedCommandInterface, here:

void ResourceManager::release_command_interface(const std::string & key)
{
std::lock_guard<decltype(resource_lock_)> lg(resource_lock_);
claimed_command_interface_map_[key] = false;
}

The destructor has a support for a custom callback upon destruction, which is set here:

return LoanedCommandInterface(
resource_storage_->command_interface_map_.at(key),
std::bind(&ResourceManager::release_command_interface, this, key));

destogl pushed a commit to StoglRobotics-forks/ros2_control that referenced this pull request Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants