-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ros2: Set Gazebo clock publish rate #1305
Comments
I had this same issue. Pretty frustrating 😅 If anyone else finds this, there is a workaround (it would be a good solution if not for the error message, but it worked for me on ros2 galactic, gazebo version 11.9.0): |
@john-maidbot I have a pull request (see #1332) for dealing with this... It works for all my purposes, but would require you to build from source. |
#1391 has made it more convenient to set ROS parameters (including |
For anyone else having problems with this and sees this issue, I finally got it to work with this: gazebo_params_path = os.path.join(
get_package_share_directory(package_name),'config','gazebo_params.yaml')
gazebo_world_path = os.path.join(
get_package_share_directory(package_name),'worlds','AAAA.world')
gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource([os.path.join(
get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')]),
launch_arguments={
'params_file': gazebo_params_path,
'world': gazebo_world_path }.items()
) Dont forget to include the config dir in the CMakeList.txt
gazebo_config.yaml # gazebo_params.yml
gazebo:
ros__parameters:
publish_rate: 400.0 |
Hello,
the default publish rate of the gazebo clock node is 10Hz. So far, it is most convenient to use the following approach to use Ros2 and Gazebo in a launch file for me:
gazebo_launch_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(pkg_gazebo_ros, 'launch', 'gazebo.launch.py')),
launch_arguments={'world': world}.items()
)
However, looking at the launch files and some other threads, I can't manage to set the publish_rate for the gazebo clock node. Is it possible to include the parameter .yaml file in the launch arguments or to include a parameter {'publish_rate': '10'} to the list of parameters, so that it can be set by the launch file.
The text was updated successfully, but these errors were encountered: