-
Notifications
You must be signed in to change notification settings - Fork 85
Add --remap argument to launch command #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rolling
Are you sure you want to change the base?
Conversation
b2404b3
to
59ff19b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> Signed-off-by: Markus Kramer <[email protected]>
Signed-off-by: Jonathan <[email protected]> Signed-off-by: Markus Kramer <[email protected]>
Signed-off-by: Markus Kramer <[email protected]>
Signed-off-by: Jonathan <[email protected]>
Signed-off-by: Jonathan <[email protected]>
Signed-off-by: kramer-sim <[email protected]>
Signed-off-by: Markus Kramer <[email protected]>
Signed-off-by: Markus Kramer <[email protected]>
Signed-off-by: Markus Kramer <[email protected]>
Signed-off-by: Markus Kramer <[email protected]>
Signed-off-by: Markus Kramer <[email protected]>
✅ 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