Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Dec 10, 2023
1 parent 68d2cc6 commit 8538a38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ class HARDWARE_INTERFACE_PUBLIC ResourceManager

mutable std::recursive_mutex resource_interfaces_lock_;
mutable std::recursive_mutex claimed_command_interfaces_lock_;
mutable std::recursive_mutex resources_lock_;

std::unique_ptr<ResourceStorage> resource_storage_;

Expand Down
58 changes: 2 additions & 56 deletions hardware_interface/test/mock_components/test_generic_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,9 @@ const auto COMPARE_DELTA = 0.0001;
class TestGenericSystem : public ::testing::Test
{
public:
<<<<<<< HEAD
void test_generic_system_with_mimic_joint(const std::string & urdf);
void test_generic_system_with_mock_sensor_commands(const std::string & urdf);
void test_generic_system_with_mock_gpio_commands(const std::string & urdf);
=======
void test_generic_system_with_fake_sensor_commands(std::string & urdf);
void test_generic_system_with_mimic_joint(std::string & urdf);
>>>>>>> 88c74ae (Cleanup Resource Manager a bit to increase clarity. (#816))

protected:
void SetUp() override
Expand Down Expand Up @@ -616,7 +611,6 @@ class TestableResourceManager : public hardware_interface::ResourceManager
public:
friend TestGenericSystem;

FRIEND_TEST(TestGenericSystem, generic_fake_system_2dof_symetric_interfaces);
FRIEND_TEST(TestGenericSystem, generic_system_2dof_symetric_interfaces);
FRIEND_TEST(TestGenericSystem, generic_system_2dof_asymetric_interfaces);
FRIEND_TEST(TestGenericSystem, generic_system_2dof_other_interfaces);
Expand All @@ -637,38 +631,6 @@ class TestableResourceManager : public hardware_interface::ResourceManager
}
};

// Forward declaration
namespace hardware_interface
{
class ResourceStorage;
}

class TestableResourceManager : public hardware_interface::ResourceManager
{
public:
friend TestGenericSystem;

FRIEND_TEST(TestGenericSystem, generic_fake_system_2dof_symetric_interfaces);
FRIEND_TEST(TestGenericSystem, generic_system_2dof_symetric_interfaces);
FRIEND_TEST(TestGenericSystem, generic_system_2dof_asymetric_interfaces);
FRIEND_TEST(TestGenericSystem, generic_system_2dof_other_interfaces);
FRIEND_TEST(TestGenericSystem, generic_system_2dof_sensor);
FRIEND_TEST(TestGenericSystem, generic_system_2dof_sensor_fake_command);
FRIEND_TEST(TestGenericSystem, generic_system_2dof_sensor_fake_command_True);
FRIEND_TEST(TestGenericSystem, hardware_system_2dof_with_mimic_joint);
FRIEND_TEST(TestGenericSystem, valid_urdf_ros2_control_system_robot_with_gpio);
FRIEND_TEST(TestGenericSystem, valid_urdf_ros2_control_system_robot_with_gpio_fake_command);
FRIEND_TEST(TestGenericSystem, valid_urdf_ros2_control_system_robot_with_gpio_fake_command);

TestableResourceManager() : hardware_interface::ResourceManager() {}

TestableResourceManager(
const std::string & urdf, bool validate_interfaces = true, bool activate_all = false)
: hardware_interface::ResourceManager(urdf, validate_interfaces, activate_all)
{
}
};

void set_components_state(
TestableResourceManager & rm, const std::vector<std::string> & components, const uint8_t state_id,
const std::string & state_name)
Expand Down Expand Up @@ -1116,11 +1078,7 @@ TEST_F(TestGenericSystem, generic_system_2dof_sensor)
ASSERT_EQ(0.33, j2p_c.get_value());
}

<<<<<<< HEAD
void TestGenericSystem::test_generic_system_with_mock_sensor_commands(const std::string & urdf)
=======
void TestGenericSystem::test_generic_system_with_fake_sensor_commands(std::string & urdf)
>>>>>>> 88c74ae (Cleanup Resource Manager a bit to increase clarity. (#816))
{
TestableResourceManager rm(urdf);
// Activate components to get all interfaces available
Expand Down Expand Up @@ -1259,11 +1217,7 @@ TEST_F(TestGenericSystem, generic_system_2dof_sensor_mock_command_True)
test_generic_system_with_mock_sensor_commands(urdf);
}

<<<<<<< HEAD
void TestGenericSystem::test_generic_system_with_mimic_joint(const std::string & urdf)
=======
void TestGenericSystem::test_generic_system_with_mimic_joint(std::string & urdf)
>>>>>>> 88c74ae (Cleanup Resource Manager a bit to increase clarity. (#816))
{
TestableResourceManager rm(urdf);
// Activate components to get all interfaces available
Expand Down Expand Up @@ -1572,16 +1526,8 @@ TEST_F(TestGenericSystem, valid_urdf_ros2_control_system_robot_with_gpio)
generic_system_functional_test(urdf);
}

<<<<<<< HEAD
void TestGenericSystem::test_generic_system_with_mock_gpio_commands(const std::string & urdf)
{
=======
TEST_F(TestGenericSystem, valid_urdf_ros2_control_system_robot_with_gpio_fake_command)
{
auto urdf = ros2_control_test_assets::urdf_head +
valid_urdf_ros2_control_system_robot_with_gpio_fake_command_ +
ros2_control_test_assets::urdf_tail;
>>>>>>> 88c74ae (Cleanup Resource Manager a bit to increase clarity. (#816))
TestableResourceManager rm(urdf);

// check is hardware is started
Expand Down Expand Up @@ -1710,7 +1656,7 @@ TEST_F(TestGenericSystem, sensor_with_initial_value)
{
auto urdf = ros2_control_test_assets::urdf_head + sensor_with_initial_value_ +
ros2_control_test_assets::urdf_tail;
hardware_interface::ResourceManager rm(urdf);
TestableResourceManager rm(urdf);
// Activate components to get all interfaces available
activate_components(rm);

Expand Down Expand Up @@ -1738,7 +1684,7 @@ TEST_F(TestGenericSystem, gpio_with_initial_value)
{
auto urdf = ros2_control_test_assets::urdf_head + gpio_with_initial_value_ +
ros2_control_test_assets::urdf_tail;
hardware_interface::ResourceManager rm(urdf);
TestableResourceManager rm(urdf);
// Activate components to get all interfaces available
activate_components(rm);

Expand Down

0 comments on commit 8538a38

Please sign in to comment.