Skip to content

Commit

Permalink
start -> activate
Browse files Browse the repository at this point in the history
  • Loading branch information
VX792 committed Apr 2, 2023
1 parent c0c7dc5 commit 35e3249
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class AsyncComponentThread
}
}

void start() { write_and_read_ = std::thread(&AsyncComponentThread::write_and_read, this); }
void activate() { write_and_read_ = std::thread(&AsyncComponentThread::write_and_read, this); }

void write_and_read()
{
Expand Down
38 changes: 23 additions & 15 deletions hardware_interface/src/resource_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,29 @@ class ResourceStorage

if (result)
{
if constexpr (std::is_same_v<hardware_interface::Actuator, HardwareT>)
{
if (async_actuator_threads_.find(hardware.get_name()) != async_actuator_threads_.end())
{
async_actuator_threads_.at(hardware.get_name()).activate();
}
}

if constexpr (std::is_same_v<hardware_interface::System, HardwareT>)
{
if (async_system_threads_.find(hardware.get_name()) != async_system_threads_.end())
{
async_system_threads_.at(hardware.get_name()).activate();
}
}

if constexpr (std::is_same_v<hardware_interface::Sensor, HardwareT>)
{
if (async_sensor_threads_.find(hardware.get_name()) != async_sensor_threads_.end())
{
async_sensor_threads_.at(hardware.get_name()).activate();
}
}
// TODO(destogl): make all command interfaces available (currently are all available)
}

Expand Down Expand Up @@ -1304,21 +1327,6 @@ void ResourceManager::allocate_threads_for_async_components()
std::forward_as_tuple(component, cm_update_rate_, clock_interface_));
}
}

for (auto & thread : resource_storage_->async_actuator_threads_)
{
thread.second.start();
}

for (auto & thread : resource_storage_->async_system_threads_)
{
thread.second.start();
}

for (auto & thread : resource_storage_->async_sensor_threads_)
{
thread.second.start();
}
}

// BEGIN: private methods
Expand Down
1 change: 0 additions & 1 deletion joint_limits_interface/test/joint_limits_urdf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include <joint_limits_interface/joint_limits_urdf.hpp>


class JointLimitsUrdfTest : public ::testing::Test
{
public:
Expand Down

0 comments on commit 35e3249

Please sign in to comment.