Skip to content

Commit 8e52481

Browse files
committed
rename ros2 component node for backwards compatibility
1 parent 4974b69 commit 8e52481

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

mqtt_client/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,31 @@ if(${ROS_VERSION} EQUAL 2)
2626
find_library(PahoMqttC_LIBRARY libpaho-mqtt3as.so.1 REQUIRED)
2727
find_library(PahoMqttCpp_LIBRARY libpaho-mqttpp3.so.1 REQUIRED)
2828

29-
add_library(${PROJECT_NAME} SHARED src/MqttClient.ros2.cpp)
29+
add_library(${PROJECT_NAME}_lib SHARED src/MqttClient.ros2.cpp)
3030

31-
rclcpp_components_register_node(${PROJECT_NAME}
31+
rclcpp_components_register_node(${PROJECT_NAME}_lib
3232
PLUGIN "mqtt_client::MqttClient"
33-
EXECUTABLE ${PROJECT_NAME}_node
33+
EXECUTABLE ${PROJECT_NAME}
3434
)
3535

36-
target_include_directories(${PROJECT_NAME} PUBLIC
36+
target_include_directories(${PROJECT_NAME}_lib PUBLIC
3737
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
3838
$<INSTALL_INTERFACE:include>)
3939

40-
target_link_libraries(${PROJECT_NAME}
40+
target_link_libraries(${PROJECT_NAME}_lib
4141
${PahoMqttC_LIBRARY}
4242
${PahoMqttCpp_LIBRARY}
4343
)
4444

45-
ament_target_dependencies(${PROJECT_NAME}
45+
ament_target_dependencies(${PROJECT_NAME}_lib
4646
fmt
4747
mqtt_client_interfaces
4848
rclcpp
4949
rclcpp_components
5050
std_msgs
5151
)
5252

53-
install(TARGETS ${PROJECT_NAME}
53+
install(TARGETS ${PROJECT_NAME}_lib
5454
ARCHIVE DESTINATION lib
5555
LIBRARY DESTINATION lib
5656
RUNTIME DESTINATION bin

mqtt_client/launch/standalone.launch.ros2.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<arg name="params_file" default="$(find-pkg-share mqtt_client)/config/params.ros2.yaml" />
44

5-
<node pkg="mqtt_client" exec="mqtt_client_node" name="mqtt_client" output="screen">
5+
<node pkg="mqtt_client" exec="mqtt_client" name="mqtt_client" output="screen">
66
<param from="$(var params_file)" />
77
</node>
88

0 commit comments

Comments
 (0)