What you're describing here can be accomplished with topic remapping. You can find documentation on it here, and another question about this topic here.
The basic concept behind topic remapping is to take two nodes that have the same topic (for example, two LIDAR nodes both publishing to
/lidar) and change the name of the topic they operate under (so one goes to
/lidar_a and another goes to
This can be accomplished using launch files. Here's an example provided by the turtlesim launch demos:
from launch import LaunchDescription
from launch_ros.actions import Node
Note the 'remappings' entry found in the bottom node: this is remapping the '/input/pose' topic to 'turtlesim1/turtle1/pose', etc.