Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ void ControllerManager::configure_controller_service_cb(
RCLCPP_DEBUG(
get_logger(), "configuring service called for controller '%s' ", request->name.c_str());
std::lock_guard<std::mutex> guard(services_lock_);
RCLCPP_DEBUG(get_logger(), "loading service locked");
RCLCPP_DEBUG(get_logger(), "configuring service locked");

response->ok =
configure_controller(request->name) == controller_interface::return_type::OK;
Expand Down Expand Up @@ -1151,8 +1151,9 @@ ControllerManager::RTControllerListWrapper::update_and_get_used_by_rt_list()
std::vector<ControllerSpec> & ControllerManager::RTControllerListWrapper::get_unused_list(
const std::lock_guard<std::recursive_mutex> &)
{
assert(controllers_lock_.try_lock());
controllers_lock_.unlock();
{
std::lock_guard<std::recursive_mutex> guard(controllers_lock_);
}
// Get the index to the outdated controller list
int free_controllers_list = get_other_list(updated_controllers_index_);

Expand All @@ -1164,16 +1165,18 @@ std::vector<ControllerSpec> & ControllerManager::RTControllerListWrapper::get_un
const std::vector<ControllerSpec> & ControllerManager::RTControllerListWrapper::get_updated_list(
const std::lock_guard<std::recursive_mutex> &) const
{
assert(controllers_lock_.try_lock());
controllers_lock_.unlock();
{
std::lock_guard<std::recursive_mutex> guard(controllers_lock_);
}
return controllers_lists_[updated_controllers_index_];
}

void ControllerManager::RTControllerListWrapper::switch_updated_list(
const std::lock_guard<std::recursive_mutex> &)
{
assert(controllers_lock_.try_lock());
controllers_lock_.unlock();
{
std::lock_guard<std::recursive_mutex> guard(controllers_lock_);
}
int former_current_controllers_list_ = updated_controllers_index_;
updated_controllers_index_ = get_other_list(former_current_controllers_list_);
wait_until_rt_not_using(former_current_controllers_list_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class TestController : public controller_interface::ControllerInterface
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
on_cleanup(const rclcpp_lifecycle::State & previous_state) override;

CONTROLLER_MANAGER_PUBLIC
void set_command_interface_configuration(
const controller_interface::InterfaceConfiguration & cfg);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using hardware_interface::return_type;
namespace fake_components
{

class GenericSystem : public hardware_interface::BaseInterface<hardware_interface::SystemInterface>
class HARDWARE_INTERFACE_PUBLIC GenericSystem : public hardware_interface::BaseInterface<hardware_interface::SystemInterface>
{
public:
return_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SensorInterface;
class SystemInterface;
class ResourceStorage;

class ResourceManager
class HARDWARE_INTERFACE_PUBLIC ResourceManager
{
public:
/// Default constructor for the Resource Manager.
Expand Down