ICube-Robotics / iiwa_ros2

ROS2 stack for KUKA iiwa collaborative robots
Apache License 2.0
94 stars 35 forks source link

launch gazebo simulation direclty from `iiwa.launch.py` #4

Closed mcbed closed 2 years ago

mcbed commented 2 years ago

In the current version of the iiwa.launch.py script gazebo cannot be run directly. Need to use iiwa_gazebo.launch.py instead. Feature: include the possibility to run gazebo sim from iiwa.launch.py simply using use_sim:=true.

Geson12138 commented 2 years ago

Hello, I want to start a simulation in the gazebo and I used the command "ros2 launch iiwa_bringup iiwa.launch.py use_sim=true". The RViz appeared the "RobotModel->Status: Error->link_1:No transform from [link_1] to [world]", as well as link_2 to link_7, and tool0. Is there anything I ignored or did not prepare? Thanks!

mcbed commented 2 years ago

Hello, this feature is not implemented yet, thus the need to run the iiwa_gazebo.launch.py script.

Geson12138 commented 2 years ago

Thank you, and I ran the command ' source install/setup.bash', then 'ros2 launch iiwa_bringup iiwa_gazebo.launch.py'. But the KUKA model did not appear in the gazebo. The output showed '[spawn_entity] node was waiting for service /spawn_entity. I found the iiwa_gazebo.launch.py would invoke the 'spawn_entity.py' in the 'gazebo_ros' package, and the 'gazebo_ros' package is already in my 'gazebo_ros_pkgs'. I have already installed the Gazebo11 and 'gazebo_ros_pkgs' for ros2 from source(on ubuntu), and source the install setup in every new terminal. So I wonder where I should fix the error above, Thanks again! 2022-07-14_12-42 ?

mcbed commented 2 years ago

Probably you did not reference the package models to gazebo. To do so, you need either to copy the iiwa_description package to the ~/.gazebo/models directory or set up the GAZEBO_MODEL_PATH as described here

Geson12138 commented 2 years ago

Yes, it did work. the KUKA model spawned in the gazebo. Thanks for your answer.