diff --git a/docker/Dockerfile b/docker/Dockerfile index a57a244c..08b2cd6d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,10 +1,13 @@ ARG ROS_DISTRO=humble +ARG BUILD_TYPE=simulation FROM husarnet/ros:${ROS_DISTRO}-ros-core +ARG BUILD_TYPE + WORKDIR /ros2_ws -ENV HUSARION_ROS_BUILD_TYPE=simulation +ENV HUSARION_ROS_BUILD_TYPE=$BUILD_TYPE COPY .. src/rosbot_ros diff --git a/docker/compose.hardware.yaml b/docker/compose.hardware.yaml index cb17fb6a..7281ffba 100644 --- a/docker/compose.hardware.yaml +++ b/docker/compose.hardware.yaml @@ -10,7 +10,7 @@ services: context: .. dockerfile: docker/Dockerfile args: - HUSARION_ROS_BUILD_TYPE: hardware + BUILD_TYPE: hardware network_mode: host ipc: host restart: unless-stopped @@ -18,7 +18,7 @@ services: - ${SERIAL_PORT:-/dev/ttyUSB0} - /dev/bus/usb/ # FTDI command: > - ros2 launch rosbot_bringup combined.launch.py + ros2 launch rosbot_bringup bringup.launch.py mecanum:=${MECANUM:-False} namespace:=${ROBOT_NAMESPACE:-rosbot} serial_port:=${SERIAL_PORT:-/dev/ttyUSB0} diff --git a/docker/compose.simulation.yaml b/docker/compose.simulation.yaml index 69668534..a99972bf 100644 --- a/docker/compose.simulation.yaml +++ b/docker/compose.simulation.yaml @@ -24,7 +24,7 @@ services: context: .. dockerfile: docker/Dockerfile args: - HUSARION_ROS_BUILD_TYPE: simulation + BUILD_TYPE: simulation network_mode: host ipc: host <<: [ *gpu-config] diff --git a/rosbot_bringup/launch/combined.launch.py b/rosbot_bringup/launch/combined.launch.py deleted file mode 100644 index a3eeae66..00000000 --- a/rosbot_bringup/launch/combined.launch.py +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright 2024 Husarion sp. z o.o. -# -# 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. - -import os - -from launch import LaunchDescription -from launch.actions import ( - DeclareLaunchArgument, - IncludeLaunchDescription, - OpaqueFunction, - SetEnvironmentVariable, -) -from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import LaunchConfiguration, ThisLaunchFileDir -from launch_ros.actions import Node -from launch_ros.substitutions import FindPackageShare - - -def generate_microros_agent_node(context, *args, **kwargs): - # Additional environment variable setup actions - env_setup_actions = [] - - # Check if ROS_DOMAIN_ID is set and not empty - ros_domain_id = os.environ.get("ROS_DOMAIN_ID") - if ros_domain_id: - env_setup_actions.append( - SetEnvironmentVariable(name="XRCE_DOMAIN_ID_OVERRIDE", value=ros_domain_id) - ) - - serial_port = LaunchConfiguration("serial_port").perform(context) - serial_baudrate = LaunchConfiguration("serial_baudrate").perform(context) - localhost_only_fastrtps_profiles_file = LaunchConfiguration( - "localhost_only_fastrtps_profiles_file" - ).perform(context) - - if os.environ.get("ROS_LOCALHOST_ONLY") == "1": - # with localhost only setup fastdds is required with a custom config - rmw_implementation = "rmw_fastrtps_cpp" - - env_setup_actions.extend( - [ - SetEnvironmentVariable(name="RMW_IMPLEMENTATION", value=rmw_implementation), - SetEnvironmentVariable( - name="FASTRTPS_DEFAULT_PROFILES_FILE", - value=localhost_only_fastrtps_profiles_file, - ), - ] - ) - - microros_agent_node = Node( - package="micro_ros_agent", - executable="micro_ros_agent", - arguments=["serial", "-D", serial_port, "-b", serial_baudrate], - output="screen", - ) - - return env_setup_actions + [microros_agent_node] - else: - microros_agent_node = Node( - package="micro_ros_agent", - executable="micro_ros_agent", - arguments=["serial", "-D", serial_port, "-b", serial_baudrate], - output="screen", - ) - - return env_setup_actions + [microros_agent_node] - - -def generate_launch_description(): - declare_serial_port_arg = DeclareLaunchArgument( - "serial_port", - default_value="/dev/ttySERIAL", - description="Serial port for micro-ROS agent", - ) - - declare_serial_baudrate_arg = DeclareLaunchArgument( - "serial_baudrate", default_value="576000", description="Baud rate for serial communication" - ) - - # Locate the rosbot_bringup package - package_dir = FindPackageShare("rosbot_bringup").find("rosbot_bringup") - - # Construct the path to the XML file within the package - fastrtps_profiles_file = os.path.join(package_dir, "config", "microros_localhost_only.xml") - - declare_localhost_only_fastrtps_profiles_file_arg = DeclareLaunchArgument( - "localhost_only_fastrtps_profiles_file", - default_value=fastrtps_profiles_file, - description=( - "Path to the Fast RTPS default profiles file for Micro-ROS agent for localhost only" - " setup" - ), - ) - - bringup_launch = IncludeLaunchDescription( - PythonLaunchDescriptionSource([ThisLaunchFileDir(), "/bringup.launch.py"]) - ) - - return LaunchDescription( - [ - declare_serial_port_arg, - declare_serial_baudrate_arg, - declare_localhost_only_fastrtps_profiles_file_arg, - OpaqueFunction(function=generate_microros_agent_node), - bringup_launch, - ] - ) diff --git a/rosbot_controller/package.xml b/rosbot_controller/package.xml index a0e82f6c..31f93620 100644 --- a/rosbot_controller/package.xml +++ b/rosbot_controller/package.xml @@ -1,9 +1,9 @@ - rosbot_controller + rosbot_gazebo 0.13.2 - Hardware configuration for ROSbot 2, 2R, PRO + Gazebo Ignition simulation for ROSbot 2, 2R, PRO Husarion @@ -13,37 +13,27 @@ https://github.com/husarion/rosbot_ros https://github.com/husarion/rosbot_ros/issues + Krzysztof Wojciechowski Jakub Delicat - - ament_cmake - - launch - launch_ros - xacro - controller_manager - robot_state_publisher - rosbot_description - ros_components_description - rosbot_hardware_interfaces - joint_state_broadcaster - imu_sensor_broadcaster - diff_drive_controller - mecanum_drive_controller - - python3-pytest - launch - launch_ros - launch_pytest - xacro - sensor_msgs - nav_msgs - rosbot_description - ros_components_description - controller_manager - joint_state_broadcaster - imu_sensor_broadcaster - diff_drive_controller - mecanum_drive_controller + Rafal Gorecki + + rosbot_bringup + launch + launch_ros + husarion_gz_worlds + ros_gz_sim + ros_gz_bridge + ign_ros2_control + nav2_common + + python3-pytest + launch + launch_ros + launch_pytest + tf_transformations + python-transforms3d-pip + nav_msgs + geometry_msgs ament_python