Skip to content

Commit ac82a42

Browse files
authored
Accept setup path with or without a trailing slash (#30)
1 parent 42d9fa6 commit ac82a42

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

launch/localization.launch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2626
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2727
# POSSIBILITY OF SUCH DAMAGE.
28+
import os
29+
2830
from ament_index_python.packages import get_package_share_directory
2931

3032
from clearpath_config.clearpath_config import ClearpathConfig
@@ -68,7 +70,7 @@ def launch_setup(context, *args, **kwargs):
6870
map = LaunchConfiguration('map') # noqa:A001
6971

7072
# Read robot YAML
71-
config = read_yaml(setup_path.perform(context) + 'robot.yaml')
73+
config = read_yaml(os.path.join(setup_path.perform(context), 'robot.yaml'))
7274
# Parse robot YAML into config
7375
clearpath_config = ClearpathConfig(config)
7476

launch/nav2.launch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2626
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2727
# POSSIBILITY OF SUCH DAMAGE.
28+
import os
29+
2830
from ament_index_python.packages import get_package_share_directory
2931

3032
from clearpath_config.clearpath_config import ClearpathConfig
@@ -67,7 +69,7 @@ def launch_setup(context, *args, **kwargs):
6769
setup_path = LaunchConfiguration('setup_path')
6870

6971
# Read robot YAML
70-
config = read_yaml(setup_path.perform(context) + 'robot.yaml')
72+
config = read_yaml(os.path.join(setup_path.perform(context), 'robot.yaml'))
7173
# Parse robot YAML into config
7274
clearpath_config = ClearpathConfig(config)
7375

launch/slam.launch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2626
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2727
# POSSIBILITY OF SUCH DAMAGE.
28+
import os
29+
2830
from ament_index_python.packages import get_package_share_directory
2931

3032
from clearpath_config.clearpath_config import ClearpathConfig
@@ -81,7 +83,7 @@ def launch_setup(context, *args, **kwargs):
8183
sync = LaunchConfiguration('sync')
8284

8385
# Read robot YAML
84-
config = read_yaml(setup_path.perform(context) + 'robot.yaml')
86+
config = read_yaml(os.path.join(setup_path.perform(context), 'robot.yaml'))
8587
# Parse robot YAML into config
8688
clearpath_config = ClearpathConfig(config)
8789

0 commit comments

Comments
 (0)