Skip to content

Commit 3e5f9be

Browse files
committed
rename the package to interfaces state broadcaster
1 parent 63f9159 commit 3e5f9be

12 files changed

+100
-94
lines changed

generic_state_broadcaster/generic_state_broadcaster_plugin.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

generic_state_broadcaster/test/test_generic_state_broadcaster_params.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.16)
2-
project(generic_state_broadcaster)
2+
project(interfaces_state_broadcaster)
33

44
find_package(ros2_control_cmake REQUIRED)
55
set_compiler_options()
@@ -21,28 +21,28 @@ foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
2121
find_package(${Dependency} REQUIRED)
2222
endforeach()
2323

24-
generate_parameter_library(generic_state_broadcaster_parameters
25-
src/generic_state_broadcaster_parameters.yaml
24+
generate_parameter_library(interfaces_state_broadcaster_parameters
25+
src/interfaces_state_broadcaster_parameters.yaml
2626
)
2727

28-
add_library(generic_state_broadcaster SHARED
29-
src/generic_state_broadcaster.cpp
28+
add_library(interfaces_state_broadcaster SHARED
29+
src/interfaces_state_broadcaster.cpp
3030
)
31-
target_compile_features(generic_state_broadcaster PUBLIC cxx_std_17)
32-
target_include_directories(generic_state_broadcaster PUBLIC
31+
target_compile_features(interfaces_state_broadcaster PUBLIC cxx_std_17)
32+
target_include_directories(interfaces_state_broadcaster PUBLIC
3333
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
34-
$<INSTALL_INTERFACE:include/generic_state_broadcaster>
34+
$<INSTALL_INTERFACE:include/interfaces_state_broadcaster>
3535
)
36-
target_link_libraries(generic_state_broadcaster PUBLIC
37-
generic_state_broadcaster_parameters
36+
target_link_libraries(interfaces_state_broadcaster PUBLIC
37+
interfaces_state_broadcaster_parameters
3838
controller_interface::controller_interface
3939
pluginlib::pluginlib
4040
rclcpp::rclcpp
4141
rclcpp_lifecycle::rclcpp_lifecycle
4242
realtime_tools::realtime_tools
4343
${control_msgs_TARGETS}
4444
${builtin_interfaces_TARGETS})
45-
pluginlib_export_plugin_description_file(controller_interface generic_state_broadcaster_plugin.xml)
45+
pluginlib_export_plugin_description_file(controller_interface interfaces_state_broadcaster_plugin.xml)
4646

4747
if(BUILD_TESTING)
4848
find_package(ament_cmake_gmock REQUIRED)
@@ -51,41 +51,41 @@ if(BUILD_TESTING)
5151
find_package(rclcpp REQUIRED)
5252
find_package(ros2_control_test_assets REQUIRED)
5353

54-
ament_add_gmock(test_load_generic_state_broadcaster
55-
test/test_load_generic_state_broadcaster.cpp
54+
ament_add_gmock(test_load_interfaces_state_broadcaster
55+
test/test_load_interfaces_state_broadcaster.cpp
5656
)
57-
target_link_libraries(test_load_generic_state_broadcaster
58-
generic_state_broadcaster
57+
target_link_libraries(test_load_interfaces_state_broadcaster
58+
interfaces_state_broadcaster
5959
controller_manager::controller_manager
6060
hardware_interface::hardware_interface
6161
rclcpp::rclcpp
6262
ros2_control_test_assets::ros2_control_test_assets)
6363
target_compile_definitions(
64-
test_load_generic_state_broadcaster
65-
PRIVATE PARAMETERS_FILE_PATH="${CMAKE_CURRENT_LIST_DIR}/test/test_generic_state_broadcaster_params.yaml")
64+
test_load_interfaces_state_broadcaster
65+
PRIVATE PARAMETERS_FILE_PATH="${CMAKE_CURRENT_LIST_DIR}/test/test_interfaces_state_broadcaster_params.yaml")
6666

67-
ament_add_gmock(test_generic_state_broadcaster
68-
test/test_generic_state_broadcaster.cpp
67+
ament_add_gmock(test_interfaces_state_broadcaster
68+
test/test_interfaces_state_broadcaster.cpp
6969
)
70-
target_link_libraries(test_generic_state_broadcaster
71-
generic_state_broadcaster
70+
target_link_libraries(test_interfaces_state_broadcaster
71+
interfaces_state_broadcaster
7272
ros2_control_test_assets::ros2_control_test_assets)
7373
endif()
7474

7575
install(
7676
DIRECTORY include/
77-
DESTINATION include/generic_state_broadcaster
77+
DESTINATION include/interfaces_state_broadcaster
7878
)
7979
install(
8080
TARGETS
81-
generic_state_broadcaster
82-
generic_state_broadcaster_parameters
83-
EXPORT export_generic_state_broadcaster
81+
interfaces_state_broadcaster
82+
interfaces_state_broadcaster_parameters
83+
EXPORT export_interfaces_state_broadcaster
8484
RUNTIME DESTINATION bin
8585
ARCHIVE DESTINATION lib
8686
LIBRARY DESTINATION lib
8787
)
8888

89-
ament_export_targets(export_generic_state_broadcaster HAS_LIBRARY_TARGET)
89+
ament_export_targets(export_interfaces_state_broadcaster HAS_LIBRARY_TARGET)
9090
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
9191
ament_package()

generic_state_broadcaster/include/generic_state_broadcaster/generic_state_broadcaster.hpp renamed to interfaces_state_broadcaster/include/interfaces_state_broadcaster/interfaces_state_broadcaster.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef GENERIC_STATE_BROADCASTER__GENERIC_STATE_BROADCASTER_HPP_
16-
#define GENERIC_STATE_BROADCASTER__GENERIC_STATE_BROADCASTER_HPP_
15+
#ifndef INTERFACES_STATE_BROADCASTER__INTERFACES_STATE_BROADCASTER_HPP_
16+
#define INTERFACES_STATE_BROADCASTER__INTERFACES_STATE_BROADCASTER_HPP_
1717

1818
#include <memory>
1919
#include <string>
@@ -27,29 +27,29 @@
2727
#include "realtime_tools/realtime_publisher.hpp"
2828

2929
// auto-generated by generate_parameter_library
30-
#include "generic_state_broadcaster/generic_state_broadcaster_parameters.hpp"
30+
#include "interfaces_state_broadcaster/interfaces_state_broadcaster_parameters.hpp"
3131

32-
namespace generic_state_broadcaster
32+
namespace interfaces_state_broadcaster
3333
{
3434
/**
35-
* \brief Generic State Broadcaster for selected state interfaces in a ros2_control system.
35+
* \brief Interfaces State Broadcaster for selected state interfaces in a ros2_control system.
3636
*
37-
* GenericStateBroadcaster publishes the selected state interfaces from ros2_control as ROS
37+
* InterfacesStateBroadcaster publishes the selected state interfaces from ros2_control as ROS
3838
* messages.
3939
*
4040
* Publishes to:
4141
* - \b ~/names (control_msgs::msg::StringArray): The list of the interface names that are selected
42-
* to be published by the generic state broadcaster. This is published with transient local
42+
* to be published by the interfaces state broadcaster. This is published with transient local
4343
* durability.
4444
* - \b ~/values (control_msgs::msg::ValuesArray): The list of the values corresponding to the
45-
* interface names that are selected to be published by the generic state broadcaster.
45+
* interface names that are selected to be published by the interfaces state broadcaster.
4646
*
4747
* \note The values are published at the same rate as the controller update rate.
4848
*/
49-
class GenericStateBroadcaster : public controller_interface::ControllerInterface
49+
class InterfacesStateBroadcaster : public controller_interface::ControllerInterface
5050
{
5151
public:
52-
GenericStateBroadcaster();
52+
InterfacesStateBroadcaster();
5353

5454
controller_interface::InterfaceConfiguration command_interface_configuration() const override;
5555

@@ -80,6 +80,6 @@ class GenericStateBroadcaster : public controller_interface::ControllerInterface
8080
control_msgs::msg::InterfacesNames names_msg_;
8181
};
8282

83-
} // namespace generic_state_broadcaster
83+
} // namespace interfaces_state_broadcaster
8484

85-
#endif // GENERIC_STATE_BROADCASTER__GENERIC_STATE_BROADCASTER_HPP_
85+
#endif // INTERFACES_STATE_BROADCASTER__INTERFACES_STATE_BROADCASTER_HPP_
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<library path="interfaces_state_broadcaster">
2+
<class name="interfaces_state_broadcaster/InterfacesStateBroadcaster" type="interfaces_state_broadcaster::InterfacesStateBroadcaster" base_class_type="controller_interface::ControllerInterface">
3+
<description>
4+
The interfaces state broadcaster publishes the values of the requested interfaces from ros2_control system.
5+
</description>
6+
</class>
7+
</library>

generic_state_broadcaster/package.xml renamed to interfaces_state_broadcaster/package.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0"?>
22
<package format="3">
3-
<name>generic_state_broadcaster</name>
3+
<name>interfaces_state_broadcaster</name>
44
<version>5.8.0</version>
5-
<description>Broadcaster to publish desired hardware interface states</description>
5+
<description>Broadcaster to publish desired hardware interface states that are castable to double</description>
66

77
<maintainer email="bence.magyar.robotics@gmail.com">Bence Magyar</maintainer>
88
<maintainer email="denis@stoglrobotics.de">Denis Štogl</maintainer>

generic_state_broadcaster/src/generic_state_broadcaster.cpp renamed to interfaces_state_broadcaster/src/interfaces_state_broadcaster.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "generic_state_broadcaster/generic_state_broadcaster.hpp"
15+
#include "interfaces_state_broadcaster/interfaces_state_broadcaster.hpp"
1616

1717
#include <cstddef>
1818
#include <limits>
@@ -25,12 +25,12 @@
2525
#include "rclcpp/qos.hpp"
2626
#include "rclcpp/time.hpp"
2727

28-
namespace generic_state_broadcaster
28+
namespace interfaces_state_broadcaster
2929
{
3030

31-
GenericStateBroadcaster::GenericStateBroadcaster() {}
31+
InterfacesStateBroadcaster::InterfacesStateBroadcaster() {}
3232

33-
controller_interface::CallbackReturn GenericStateBroadcaster::on_init()
33+
controller_interface::CallbackReturn InterfacesStateBroadcaster::on_init()
3434
{
3535
try
3636
{
@@ -47,14 +47,14 @@ controller_interface::CallbackReturn GenericStateBroadcaster::on_init()
4747
}
4848

4949
controller_interface::InterfaceConfiguration
50-
GenericStateBroadcaster::command_interface_configuration() const
50+
InterfacesStateBroadcaster::command_interface_configuration() const
5151
{
5252
return controller_interface::InterfaceConfiguration{
5353
controller_interface::interface_configuration_type::NONE};
5454
}
5555

5656
controller_interface::InterfaceConfiguration
57-
GenericStateBroadcaster::state_interface_configuration() const
57+
InterfacesStateBroadcaster::state_interface_configuration() const
5858
{
5959
controller_interface::InterfaceConfiguration state_interfaces_config;
6060
state_interfaces_config.type = controller_interface::interface_configuration_type::INDIVIDUAL;
@@ -65,7 +65,7 @@ GenericStateBroadcaster::state_interface_configuration() const
6565
return state_interfaces_config;
6666
}
6767

68-
controller_interface::CallbackReturn GenericStateBroadcaster::on_configure(
68+
controller_interface::CallbackReturn InterfacesStateBroadcaster::on_configure(
6969
const rclcpp_lifecycle::State & /*previous_state*/)
7070
{
7171
params_ = param_listener_->get_params();
@@ -88,7 +88,7 @@ controller_interface::CallbackReturn GenericStateBroadcaster::on_configure(
8888
return CallbackReturn::SUCCESS;
8989
}
9090

91-
controller_interface::CallbackReturn GenericStateBroadcaster::on_activate(
91+
controller_interface::CallbackReturn InterfacesStateBroadcaster::on_activate(
9292
const rclcpp_lifecycle::State & /*previous_state*/)
9393
{
9494
for (auto i = 0u; i < state_interfaces_.size(); ++i)
@@ -97,7 +97,8 @@ controller_interface::CallbackReturn GenericStateBroadcaster::on_activate(
9797
{
9898
RCLCPP_ERROR(
9999
get_node()->get_logger(),
100-
"State interface '%s' is not castable to double. The GenericStateBroadcaster only supports "
100+
"State interface '%s' is not castable to double. The InterfacesStateBroadcaster only "
101+
"supports "
101102
"state interfaces that can be casted to double.",
102103
params_.interfaces[i].c_str());
103104
return CallbackReturn::FAILURE;
@@ -107,7 +108,7 @@ controller_interface::CallbackReturn GenericStateBroadcaster::on_activate(
107108
return CallbackReturn::SUCCESS;
108109
}
109110

110-
controller_interface::return_type GenericStateBroadcaster::update(
111+
controller_interface::return_type InterfacesStateBroadcaster::update(
111112
const rclcpp::Time & time, const rclcpp::Duration & /*period*/)
112113
{
113114
for (auto i = 0u; i < state_interfaces_.size(); ++i)
@@ -128,9 +129,10 @@ controller_interface::return_type GenericStateBroadcaster::update(
128129
return controller_interface::return_type::OK;
129130
}
130131

131-
} // namespace generic_state_broadcaster
132+
} // namespace interfaces_state_broadcaster
132133

133134
#include "pluginlib/class_list_macros.hpp"
134135

135136
PLUGINLIB_EXPORT_CLASS(
136-
generic_state_broadcaster::GenericStateBroadcaster, controller_interface::ControllerInterface)
137+
interfaces_state_broadcaster::InterfacesStateBroadcaster,
138+
controller_interface::ControllerInterface)

generic_state_broadcaster/src/generic_state_broadcaster_parameters.yaml renamed to interfaces_state_broadcaster/src/interfaces_state_broadcaster_parameters.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
generic_state_broadcaster:
1+
interfaces_state_broadcaster:
22
interfaces: {
33
type: string_array,
44
default_value: [],
5-
description: "The list of hardware interfaces information to be published by the generic state broadcaster.",
5+
description: "The list of hardware interfaces information to be published by the interfaces state broadcaster.",
66
read_only: true,
77
validation: {
88
not_empty<>: []

0 commit comments

Comments
 (0)