Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed May 8, 2024
1 parent 0162336 commit e645eac
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
10 changes: 8 additions & 2 deletions rosbot_xl_bringup/launch/combined.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
SetEnvironmentVariable,
)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, ThisLaunchFileDir
from launch.substitutions import (
LaunchConfiguration,
PathJoinSubstitution,
ThisLaunchFileDir,
)
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare

Expand Down Expand Up @@ -130,7 +134,9 @@ def generate_launch_description():
package_dir = FindPackageShare("rosbot_xl_bringup").find("rosbot_xl_bringup")

# Construct the path to the XML file within the package
fastrtps_profiles_file = os.path.join(package_dir, "config", "microros_localhost_only.xml")
fastrtps_profiles_file = PathJoinSubstitution(
[package_dir, "config", "microros_localhost_only.xml"]
)

declare_localhost_only_fastrtps_profiles_file_arg = DeclareLaunchArgument(
"localhost_only_fastrtps_profiles_file",
Expand Down
7 changes: 4 additions & 3 deletions rosbot_xl_controller/test/test_xacro.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.

import itertools
import os

import xacro
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare


Expand Down Expand Up @@ -69,8 +69,9 @@ def test_rosbot_description_parsing():
"lidar_model": lidar_model,
"camera_model": camera_model,
}
rosbot_xl_description = FindPackageShare("rosbot_xl_description")
xacro_path = os.path.join(rosbot_xl_description, "urdf/rosbot_xl.urdf.xacro")
xacro_path = PathJoinSubstitution(
[FindPackageShare("rosbot_xl_description"), "urdf", "rosbot_xl.urdf.xacro"]
)
try:
xacro.process_file(xacro_path, mappings=mappings)
except xacro.XacroException as e:
Expand Down
1 change: 1 addition & 0 deletions rosbot_xl_gazebo/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<exec_depend>ros2launch</exec_depend>
<exec_depend>launch</exec_depend>
<exec_depend>launch_ros</exec_depend>
<exec_depend>ament_index_python</exec_depend>

<exec_depend>rosbot_xl_bringup</exec_depend>
<exec_depend>husarion_gz_worlds</exec_depend>
Expand Down
6 changes: 4 additions & 2 deletions rosbot_xl_utils/rosbot_xl_utils/flash_firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import subprocess
import sys

import ament_index_python.packages
import requests
from launch_ros.substitutions import FindPackageShare

# Global variable to hold the subprocess reference
subproc = None
Expand All @@ -49,7 +49,9 @@ def download_firmware(firmware_url, firmware_path):

def find_firmware_file():
# Find the install directory of 'rosbot_utils' package
package_install_directory = FindPackageShare("rosbot_xl_utils")
package_install_directory = ament_index_python.packages.get_package_share_directory(
"rosbot_xl_utils"
)

# Construct the path to the firmware directory
firmware_dir = os.path.join(package_install_directory, "firmware")
Expand Down

0 comments on commit e645eac

Please sign in to comment.