-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port system tests in nav2_system_tests (#4440)
* wip, ported only test_bt_navigator Signed-off-by: stevedan <[email protected]> * include test_bt_navigator_with dijlstra and test_bt_navigator_2 Signed-off-by: stevedan <[email protected]> * uncomment some lines Signed-off-by: stevedan <[email protected]> * More tests Signed-off-by: stevedan <[email protected]> * Include end of line Signed-off-by: stevedan <[email protected]> * move gz_sim cleanup process to utils nav2_simple_commander Signed-off-by: stevedan <[email protected]> * fix linter Signed-off-by: stevedan <[email protected]> * cleanup Signed-off-by: stevedan <[email protected]> * removed unused path Signed-off-by: stevedan <[email protected]> * cleanup Signed-off-by: stevedan <[email protected]> * more cleanup Signed-off-by: stevedan <[email protected]> * reduce set initial pose time Signed-off-by: stevedan <[email protected]> * remove repeated variable Signed-off-by: stevedan <[email protected]> * Remove log Signed-off-by: stevedan <[email protected]> * Remove todo Signed-off-by: stevedan <[email protected]> * use robot publisher Signed-off-by: stevedan <[email protected]> * use robot publisher Signed-off-by: stevedan <[email protected]> * include copyright Signed-off-by: stevedan <[email protected]> * correct year Signed-off-by: stevedan <[email protected]> --------- Signed-off-by: stevedan <[email protected]> Signed-off-by: Stevedan Ogochukwu Omodolor <[email protected]>
- Loading branch information
1 parent
43b2388
commit 9057456
Showing
18 changed files
with
451 additions
and
2,234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#! /usr/bin/env python3 | ||
# Copyright 2024 Open Navigation LLC | ||
# Copyright 2024 Stevedan Ogochukwu Omodolor Omodia | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""General utility functions.""" | ||
|
||
import os | ||
import signal | ||
import subprocess | ||
|
||
|
||
def find_os_processes(name): | ||
"""Find all the processes that are running gz sim.""" | ||
ps_output = subprocess.check_output(['ps', 'aux'], text=True) | ||
ps_lines = ps_output.split('\n') | ||
gz_sim_processes = [] | ||
for line in ps_lines: | ||
if name in line: | ||
columns = line.split() | ||
pid = columns[1] | ||
command = ' '.join(columns[10:]) | ||
if command.startswith(name): | ||
gz_sim_processes.append((pid, command)) | ||
return gz_sim_processes | ||
|
||
|
||
def kill_process(pid): | ||
"""Kill a process with a given PID.""" | ||
try: | ||
os.kill(int(pid), signal.SIGKILL) | ||
print(f'Successfully killed process with PID: {pid}') | ||
except Exception as e: | ||
print(f'Failed to kill process with PID: {pid}. Error: {e}') | ||
|
||
|
||
def kill_os_processes(name): | ||
"""Kill all processes that are running with name.""" | ||
processes = find_os_processes(name) | ||
if processes: | ||
for pid, _ in processes: | ||
kill_process(pid) | ||
else: | ||
print(f'No processes found starting with {name}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<sdf version="1.6"> | ||
<model name='cardboard_box'> | ||
<include> | ||
<uri> | ||
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Cardboard box | ||
</uri> | ||
</include> | ||
</model> | ||
</sdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.