ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to pause gazebo at the start in foxy?

asked 2023-02-07 13:03:17 -0600

nino gravatar image

updated 2023-02-08 12:28:33 -0600

shonigmann gravatar image

Im want to start the simulation at pause state with the launch file. some one can help me? tks

edit retag flag offensive close merge delete

Comments

Probably you should provide with version of Gazebo are you using?

Andromeda gravatar image Andromeda  ( 2023-02-08 12:24:51 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2023-02-08 12:39:16 -0600

shonigmann gravatar image

There is a pause Launch Argument that you can set to true (defined here in the source)

Your launch command could look something like this:

import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource


def generate_launch_description():
    ld = LaunchDescription()
    gz_launch_path = os.path.join(get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')
    ld.add_action(
        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(gz_launch_path), 
            launch_arguments={'pause': 'true'}.items()
    ))
    return ld
edit flag offensive delete link more

Comments

Thks for your support. I have solved this by add this code in launch file

   load_gazebo= ExecuteProcess(
    cmd=['gazebo', '-u', "-s","libgazebo_ros_factory.so"],
    output='screen')
nino gravatar image nino  ( 2023-02-12 03:41:38 -0600 )edit

@shonigmann: could you please not close questions when they have an accepted answer? Askbot displays those mostly as [closed], which makes it look like there was no resolution. Accepting an answer already marks the question as answered, without needing to close it.

gvdhoorn gravatar image gvdhoorn  ( 2023-02-14 01:42:26 -0600 )edit

I'm not familiar with Askbot, but my intent was always to help people coming to ROS Answers to answer questions more readily find questions that haven't yet been resolved. But if its making things less visible, I can certainly save myself that step and avoid closing questions. Thanks for the feedback

shonigmann gravatar image shonigmann  ( 2023-02-14 12:25:18 -0600 )edit

Askbot is the software platform behind ROS Answers.

my intent was always to help people coming to ROS Answers to answer questions more readily find questions that haven't yet been resolved

of course. I never doubted that.

But answered questions are already clearly marked as such, while closing them makes the "this is closed" part stand out more. So just accepting the correct answer would be enough.

gvdhoorn gravatar image gvdhoorn  ( 2023-02-14 12:55:21 -0600 )edit
0

answered 2023-02-12 00:17:56 -0600

Davies Ogunsina gravatar image

Check your launch file and set the pause argument to true .

edit flag offensive delete link more

Question Tools

Stats

Asked: 2023-02-07 13:03:17 -0600

Seen: 725 times

Last updated: Feb 12 '23