1
$\begingroup$

image

Gazebo GUI didn't work when i used the "ros2 launch gazebo_ros gazebo.launch.py" command, It did appear with the "gazebo" command. Does anyone know how to fix this? I have tried to reinstall gazebo and gazebo_ros pkg for couples of time, but It didnt work.

After running the "ros2 launch gazebo_ros gazebo.launch.py --debug" command, It said: "Failed to load the launch file without a context: ThisLaunchFileDir used outside of a launch file (in a script)" Debug image

Solution: "source /usr/share/gazebo/setup.bash" is required, I dont know why it is required because all tutorial that i watched this source command was not added. After adding this command, My problem is solved.

$\endgroup$
3
  • $\begingroup$ Try running the launch system in debug mode for verbose output. This is done as follows: ros2 launch gazebo_ros gazebo.launch.py --debug. If this mode gives more information, please update the question accordingly. $\endgroup$
    – Robotawi
    Commented Jan 25 at 15:50
  • $\begingroup$ After running the "ros2 launch gazebo_ros gazebo.launch.py" command, It said: "Failed to load the launch file without a context: ThisLaunchFileDir used outside of a launch file (in a script)". (image above) $\endgroup$ Commented Jan 25 at 16:39
  • $\begingroup$ Please copy and paste console output not screenshot. It's much more readable as well as searchable. $\endgroup$
    – Tully
    Commented Jan 28 at 9:37

1 Answer 1

2
$\begingroup$

I faced the same problem before. It seems like the environment variable need to be added. This works for me.

source /usr/share/gazebo/setup.bash
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.