Add --remap argument to launch command#435
Add --remap argument to launch command#435JoLichtenfeld wants to merge 12 commits intoros2:rollingfrom
Conversation
b2404b3 to
59ff19b
Compare
fujitatomoya
left a comment
There was a problem hiding this comment.
i believe that would be really nice to have the ros2launch test aligns with this enhancement.
d3f9659 to
582b51c
Compare
|
@JoLichtenfeld could you consider if we can add the test case for this? |
|
I will come up with a test case as soon as I find the time for it. |
|
@fujitatomoya Hi, in which directory should the test be placed? Do you want that we write the test cases in /ros2launch/test? def test_remap_argument(self):
"""Test that the --remap argument correctly remaps topics."""
try:
# Start the talker_listener launch file with remapping
launch_proc_remapped = subprocess.Popen(
['ros2', 'launch', 'demo_nodes_cpp', 'talker_listener_launch.py',
'--remap', '/chatter:=/chatter_remapped'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
# Run ros2 topic list to get the remapped topics
result = subprocess.run(['ros2', 'topic', 'list'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
check=True)
remapped_topics = result.stdout.strip().split('\n')
# Verify /chatter is NOT in the list
self.assertNotIn('/chatter', remapped_topics,
f"Did not expect to find /chatter after remapping. Topics: {remapped_topics}")
# Verify /chatter_remapped IS in the list
self.assertIn('/chatter_remapped', remapped_topics,
f"Expected to find /chatter_remapped after remapping. Topics: {remapped_topics}")
finally:
# Clean up
if 'launch_proc_remapped' in locals():
launch_proc_remapped.terminate()
try:
launch_proc_remapped.wait(timeout=5)
except subprocess.TimeoutExpired:
launch_proc_remapped.kill()
launch_proc_remapped.wait()
if __name__ == '__main__':
unittest.main() |
probably this one? because it actually verifies that this arguments work with |
|
@fujitatomoya It appears that the test environment is missing the ROS 2 CLI extensions that provide the Do you have any recommendations how to proceed? |
|
@Mergifyio rebase |
Signed-off-by: Jonathan <jonathan.lichtenfeld@gmail.com> Signed-off-by: Markus Kramer <kramer@sim.tu-darmstadt.de>
Signed-off-by: Jonathan <jonathan.lichtenfeld@gmail.com> Signed-off-by: Markus Kramer <kramer@sim.tu-darmstadt.de>
Signed-off-by: Markus Kramer <kramer@sim.tu-darmstadt.de>
Signed-off-by: Jonathan <jonathan.lichtenfeld@gmail.com>
Signed-off-by: Jonathan <jonathan.lichtenfeld@gmail.com>
Signed-off-by: kramer-sim <kramer@sim.tu-darmstadt.de>
Signed-off-by: Markus Kramer <kramer@sim.tu-darmstadt.de>
Signed-off-by: Markus Kramer <kramer@sim.tu-darmstadt.de>
Signed-off-by: Markus Kramer <kramer@sim.tu-darmstadt.de>
Signed-off-by: Markus Kramer <kramer@sim.tu-darmstadt.de>
Signed-off-by: Markus Kramer <kramer@sim.tu-darmstadt.de>
✅ Branch has been successfully rebased |
|
@ros-pull-request-builder retest this please |
This adds the option to specify remapping rules for launch files in the launch command.
Example: ros2 launch <launch_file> --remap topic1:=new1 --remap topic2:=new2