ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can create multiple nodes with the same name in different packages, but there are two things to watch out for if you really want to do this:
name=""
in your launch files, use anonymous names, or use the __name:=
parameter to change the node name when starting it from the command lineSince a catkin workspace is a single cmake project, each target name needs to be unique across the entire workspace. To get around this, you'll need to use a unique name for each target, and then set the executable name afterwards with set_target_properties:
Package A cmakelists.txt:
add_executable(packageA-node node.cpp) set_target_properties(packageA-node OUTPUT_NAME node)
Package B cmakelists.txt
add_executable(packageB-node node.cpp) set_target_properties(packageB-node OUTPUT_NAME node)
2 | No.2 Revision |
You can create multiple nodes with the same name in different packages, but there are two things to watch out for if you really want to do this:
name=""
in your launch files, use anonymous names, or use the __name:=
parameter to change the node name when starting it from the command linePackage A cmakelists.txt:
add_executable(packageA-node node.cpp)
Package B cmakelists.txt
add_executable(packageB-node node.cpp)