Skip to content

[example_9] Add gazebo bridge node for clock sync-ing #755

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

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

Juliaj
Copy link
Contributor

@Juliaj Juliaj commented Mar 27, 2025

The main change is to add a Gazebo bridge node to fix following Gazebo runtime error after launching the example. The error will cause Gazebo to be terminated.

ros2 launch ros2_control_demo_example_9 rrbot_gazebo.launch.py gui:=true

# logs 
[gazebo-1] terminate called after throwing an instance of 'std::runtime_error'
[gazebo-1]   what():  can't compare times with different time sources
[gazebo-1] Stack trace (most recent call last) in thread 270397:
[gazebo-1] #14   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
[gazebo-1] #13   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7d5de3d29c3b, in 
[gazebo-1] #12   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7d5de3c9caa3, in 
[gazebo-1] #11   Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7d5dde2ecdb3, in 
[gazebo-1] #10   Object "/opt/ros/jazzy/opt/gz_sim_vendor/lib/libgz-sim8.so.8", at 0x7d5ddd34ed45, in 
[gazebo-1] #9    Object "/home/juliajia/ros2_control_ws/install/gz_ros2_control/lib/libgz_ros2_control-system.so", at 0x7d5daa9717c5, in gz_ros2_control::GazeboSimROS2ControlPlugin::PostUpdate(gz::sim::v8::UpdateInfo const&, gz::sim::v8::EntityComponentManager const&)
[gazebo-1] #8    Object "/home/juliajia/ros2_control_ws/install/controller_manager/lib/libcontroller_manager.so", at 0x7d5daa486561, in controller_manager::ControllerManager::update(rclcpp::Time const&, rclcpp::Duration const&)
[gazebo-1] #7    Object "/opt/ros/jazzy/lib/librclcpp.so", at 0x7d5da96e2a90, in 
[gazebo-1] #6    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7d5dde2bb390, in __cxa_throw
[gazebo-1] #5    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7d5dde2a5a54, in std::terminate()

The additional changes are to fix following warnings reported.

[gazebo-1] [Wrn] [SdfEntityCreator.cc:949] Using an internal gazebo.material to parse Gazebo/Orange
[gazebo-1] [Wrn] [SdfEntityCreator.cc:933] Gazebo does not support Ogre material scripts. See https://gazebosim.org/api/sim/8/migrationsdf.html#:~:text=Materials for details.
  • The mismatched update rate from controller manager and Gazebo sim. Increased the update_rate for controller manager.
[gazebo-1] [WARN] [1743040617.401316543] [gz_ros_control]:  Desired controller update period (0.1 s) is slower than the gazebo simulation period (0.001 s).

There are more warnings that appear unrelated to the example based on my initial check. I am open to change if it's not the case. For example

[gazebo-1] [GUI] [Wrn] [Application.cc:908] [QT] file::/WorldStats/WorldStats.qml:53:3: QML RowLayout: Binding loop detected for property "x"

[gazebo-1] Warning [parser_urdf.cc:1220] Attribute value string not set

@christophfroehlich
Copy link
Contributor

@Mergifyio backport mergify/bp/humble/pr-482

Copy link
Contributor

mergify bot commented Mar 27, 2025

backport mergify/bp/humble/pr-482

✅ Backports have been created

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, you are totally right.
I'm just wondering why the test succeeds without your changes, this should not happen. Calling manually the same as within the test fails:
ros2 launch ros2_control_demo_example_9 rrbot_gazebo.launch.py gui:=false

@christophfroehlich christophfroehlich merged commit 2587970 into ros-controls:master Mar 27, 2025
7 of 11 checks passed
mergify bot pushed a commit that referenced this pull request Mar 27, 2025
@christophfroehlich
Copy link
Contributor

Ah, we are testing only the rrbot.launch.py without gazebo 🙈

christophfroehlich pushed a commit that referenced this pull request Mar 27, 2025
(cherry picked from commit 2587970)

Co-authored-by: Julia Jia <[email protected]>
christophfroehlich added a commit that referenced this pull request Apr 25, 2025
* [example_9] Switch to gz_ros2_control (#482)

* Switch from gazebo classic to gazebo

* update docs

* Use gz_ros2_control in semi-binary builds

* rm dependency conditional

Co-authored-by: Dr. Denis <[email protected]>

* Remove gazebo classic from repos file

* Add gazebo bridge node and fix some warnings (#755) (#757)

(cherry picked from commit 2587970)

Co-authored-by: Julia Jia <[email protected]>

---------

Co-authored-by: Christoph Fröhlich <[email protected]>
Co-authored-by: Dr. Denis <[email protected]>
Co-authored-by: Christoph Froehlich <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Julia Jia <[email protected]>
@Juliaj Juliaj deleted the fix_ex9_gazebo branch May 19, 2025 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants