Search code examples
macosrosgazebo-simu

cannot find gazebo_ros package in robostack / how run gazebo with ros2-humble in robostack?


OS: mac
installation process of ros: https://robostack.github.io/GettingStarted.html#__tabbed_1_1
ros version: humble

gazebo_ros package is a vital package for communication between ros2 and gazebo as far as I know. But I cannot find it in robostack channel:
mamba search gazebo_ros -c robostack 
result: No match found for: gazebo_ros. Search: *gazebo_ros*
my launch.py:

import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import ExecuteProcess

def generate_launch_description():
    # Paths to the URDF file
    pkg_share = get_package_share_directory('hrssd')
    default_model_path = os.path.join(pkg_share, 'urdf', 'hrssd.urdf')
    
    # Launch Gazebo with an empty world, replace this with your world file if needed
    gazebo = ExecuteProcess(
        cmd=['gazebo', '--verbose', '-s', 'libgazebo_ros_factory.so'],
        output='screen'
    )

    # Node to spawn the robot in Gazebo
    spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py',
                        arguments=['-entity', 'hrssd', '-file', default_model_path],
                        output='screen')

    return LaunchDescription([
        gazebo,
        spawn_entity,
    ])

run with this command: ros2 launch hrssd hrssd.launch.py      
error:

[INFO] [launch]: All log files can be found below /Users/X/.ros/log/2024-02-04-00-15-30-935223-MSK-C02DW5J1MD6R.local-1565
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): "package 'gazebo_ros' not found, searching: ['/Users/X/Development/ros_ws/install/hrssd', '/usr/local/Caskroom/miniforge/base/envs/ros_env']"

If you have some working examples launch.py with gazebo-ros integration on robostack will be highly acceptable, thank you!

This error is seems related: ros2 launch file does not spawing custom urdf but because there is no explanation of error, and i cannot leave comments (stupid reputation system) I cannot be 100% sure.


Solution

    • The correct channels to use to install recent robostack packages are conda-forge (for the dependencies) and robostack-staging (for the actual robostack packages)
    • The name of the package you are looking for is ros-humble-gazebo-ros

    See https://github.com/RoboStack/ros-humble/issues/130#issuecomment-1929621103 .