Ubuntu で ROS2 'Could not find the resource 'joint_state_publisher_gui'' を修正する方法

問題

ROS パッケージを実行または起動しているときに、次のエラーメッセージが表示されます:

ament-index-error.txt
File "/opt/ros/jazzy/lib/python3.12/site-packages/ament_index_python/packages.py", line 60, in get_package_prefix
    content, package_prefix = get_resource('packages', package_name)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/ros/jazzy/lib/python3.12/site-packages/ament_index_python/resources.py", line 93, in get_resource
    raise LookupError(
LookupError: Could not find the resource 'joint_state_publisher_gui' of type 'packages'

解決策

apt を使って joint-state-publisher-gui パッケージをインストールする必要があります:

install-joint-state-publisher.sh
sudo apt -y install ros-jazzy-joint-state-publisher-gui

同じカテゴリの類似記事をチェック: ROS