[pull] gz-sim8 from gazebosim:gz-sim8#20
Open
pull[bot] wants to merge 249 commits into
Open
Conversation
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
…cs/ign-gazebo into arjo/fix/detachable_joint
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
CMake checks if rendering is available to enable some tests, so the rendering environment needs to be set before CMake runs. --------- Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
* test script tag Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * add dark grey before creating component Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * material parser Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * linters Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * Update src/rendering/MaterialParser/MaterialParser.cc Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Dharini Dutia <dharinidutia@gmail.com> Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * fix configLoader, material struct and feedback Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * default color and todos Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * install/load one file, range based loop, hardcode dependent solid colors Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * fix install_dir property Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * credits, initializing cleanup Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * eof Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * reformat Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * add integration test Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * migration note Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * intends, default case, invalid color Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * optional materialValues, typo Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * feedback Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * size check Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * get color values Signed-off-by: Dharini Dutia <dharini@openrobotics.org> * migration doc update Signed-off-by: Dharini Dutia <dharini@openrobotics.org> --------- Signed-off-by: Dharini Dutia <dharini@openrobotics.org> Signed-off-by: Dharini Dutia <dharinidutia@gmail.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Edited gazebo.material file to remove multiple passes in solid colors. Refactored the parser based on Gazebo's style guide. Signed-off-by: Dharini Dutia <dharini@openrobotics.org> Signed-off-by: Dharini Dutia <dharinidutia@gmail.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
The failures are caused by a change in the DART physics engine (dartsim/dart#1774) which causes joints to recover after reaching or exceeding their position limits. It seems like the model used in this plugin starts off with joint limits violated and recovers after a few iterations. This causes a small movement of the robot. Since the test works by comparing images taken of the robot at the start of simulation and after a few iterations, the small movement causes a discrepancy in the images. The solution here is to run the whole test while simulation is paused. This also cleans up some TestFixture warnings. Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Merge ign-gazebo6 ➡️ gz-sim7
…mespace `gz` (#2385) The `gz` namespace is not recognized by doxygen enough for it to autogenerate links to inner namespaces and classes. For example, `\ref gz::sim::systems` or simply `gz::sim::systems` don't link to the namespace documentation. You'd have to use `ignition::gazebo::systems` instead. I was hoping there was a more clever solution that would allow all `gz::` refs to work automatically, but I was not able to find one, so this is a compromise to fix the landing page for ign-gazebo6 (https://gazebosim.org/api/sim/6) Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
The package name has an underscore between `fuel` and `tools`. Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
* Use latest 1.14 google-test in gtest_setup
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
* Make gcc happy about dangling pointer
GCC is emitting a warning about a possible danling pointer on table
like definitions:
warning: possibly dangling reference to a temporary [-Wdangling-reference]
660 | auto const& table = get_current_events_table(state_indexes{});
| ^~~~~
Which I think that really comes from the use of state_indexes{} as
argument:
note: the temporary was destroyed at the end of the full expression
660 | auto const& table = get_current_events_table(state_indexes{});
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
Clang is quiet about this and make me think that is a false positive
since the metaprogramming code is using just the type of the state_indexes
as much as I can see.
---------
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
The test in this file does nothing. We should remove it. Signed-off-by: Arjo Chakravarty <arjoc@google.com>
This adds the dynamics to simulate a lighter-than-air vehicle such as blimps/airships. The modelling is based on [1] and [2]. Previously we added an airship-dynamics-plugin to Gazebo-Classic for [PX4 Gazebo SITL](PX4/PX4-SITL_gazebo-classic#490) , but we suffered simulation instability similar to that of the underwater-vehicles since Gazebo-Classic could not simulate the Added Mass dynamics. This PR brings that airship-dynamics-plugin to Gazebo which supports the Added Mass dynamics. Furthermore, I have extended, the Link class to provide access to the AddedMassMatrix, to allow the lighter-than-air system to easily access this matrix. The code is somewhat based of the Hydrodynamics system. I have an STL file which I can contribute, which is an envelope from [Wind Reiter](https://www.windreiter.com/shop/sb-324-300/), and the coefficients in the integrations test is for this envelope model. ### Citations [1] Li, Y., & Nahon, M. (2007). Modeling and simulation of airship dynamics. Journal of Guidance, Control, and Dynamics, 30(6), 1691–1700. [2] Li, Y., Nahon, M., & Sharf, I. (2011). Airship dynamics modeling: A literature review. Progress in Aerospace Sciences, 47(3), 217–239. Signed-off-by: henrykotze <henry@flycloudline.com>
This adds some comments and uses structured bindings in range-based for loops to improve readability. It also adds const to unmodified variables in a loop. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Co-authored-by: Jenn Nguyen <jenn.nguyen02@gmail.com>
Merge gz-sim7 ➡️ gz-sim8
…from the container (#2412) Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Ian Chen <iche@intrinsic.ai> Co-authored-by: Ian Chen <iche@intrinsic.ai> (cherry picked from commit fbf9aa6)
Signed-off-by: Carlos Agüero <caguero@osrfoundation.org> (cherry picked from commit b370313)
…3438) * Fix crash when calling reset in model_photo_shoot (#3416) Signed-off-by: momo <2438833481@qq.com> (cherry picked from commit fe17422) Signed-off-by: momo <2438833481@qq.com> Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> Co-authored-by: Oscmoar07 <108773152+XINJIANGMO@users.noreply.github.com> Co-authored-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
…3450) * docs: fix selected Doxygen warnings in docs build (#3445) Signed-off-by: Ammaar Ahmed <ammaarlatif53@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> (cherry picked from commit 8bb61f8) Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> Co-authored-by: Ammaar Ahmed <ammaarlatif53@gmail.com> Co-authored-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
This patch adds multiple improvements to the Hydrodynamic system:
## Bug fixes
- Coriolis matrix C(0,5): fixed wrong sign (Fossen eq. 6.43).
- Coriolis matrix C(5,0): fixed wrong index and sign; restores skew-symmetry.
- abs() → std::abs(): prevents silent truncation to int for sub-unit velocities; added `#include <cmath>`.
- First-timestep spike: firstIteration flag initializes prevState from actual velocity instead of zero.
- Dead waterDensity variable: removed (was set but never used).
- Coriolis current-velocity correction: when `<fluid_added_mass>` and ocean current are both present, applies a correction wrench so Coriolis uses relative velocity.
## New functionality
- Double added mass guard: emits `gzerr` if both native `<fluid_added_mass>` and plugin added mass parameters are active without `<disable_added_mass>true`.
- Context-dependent deprecation warning: replaces the unconditional "migrate to native" warning with engine-aware advice — recommends `<fluid_added_mass>` for DART, notes that Bullet/MuJoCo only support plugin-based added mass .
- Added simulation reset.
## Refactoring
- Extracted math into `HydrodynamicsUtils.hh`: `buildCoriolisMatrix()`, `buildDampingMatrix()`, `buildFullCoriolisMatrix()`, `skew3()`.
- `buildDampingMatrix()` uses references-to-arrays `(const double (&)[36], const double (&)[216])` for compile-time size checking.
- Fixed-size `Eigen` types throughout (stack-allocated, SIMD-friendly
## Tests
- `Hydrodynamics_TEST.cc` with unit tests covering:
- Known-value validation for all 18 Coriolis entries.
- Skew-symmetry and energy conservation properties.
- Regression tests for the two Coriolis bugs fixed.
- Sub-unit velocity regression for the `abs()` bug.
- Damping matrix: linear, quadratic, combined, cross-terms.
- Full Coriolis matrix: diagonal equivalence, correction wrench.
## Documentation
- `Hydrodynamics.hh`: updated Doxygen — added mass section scoped to DART, double-counting warning, engine recommendation.
- `Migration.md`: deprecation scoped to DART, double-counting warning, migration example labeled "(DART)".
- `theory_hydrodynamics.md`: added physics engine recommendation table.
- Tutorial files updated for new configuration style.
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
* Tweaks
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
* Tweaks
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
* Reset
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
* Exclude test file for Bazel
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
* Fix Windows
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
* Fix Win
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
* Build test
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
---------
Signed-off-by: Carlos Agüero <caguero@osrfoundation.org>
Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
(cherry picked from commit 57e28a0)
# Conflicts:
# BUILD.bazel
# Migration.md
# src/systems/hydrodynamics/Hydrodynamics.cc
# src/systems/hydrodynamics/Hydrodynamics.hh
) (#3472) ## Summary The `RenderEngineServerApiBackend` component header exists and is registered in the component factory, and `ServerConfig` exposes the `RenderEngineServerApiBackend()` accessor. However, `SimulationRunner` never creates this component on the world entity, so the render engine API backend setting from the server configuration is silently ignored at runtime. ### Changes Add the missing `CreateComponent` call for `RenderEngineServerApiBackend` in `SimulationRunner::OnWorldControl`, alongside the other render engine components (`RenderEngineServerPlugin`, `RenderEngineServerHeadless`, `RenderEngineGuiPlugin`). Generated-by: Claude Code (cherry picked from commit 7277624) Signed-off-by: Taylor Howard <taylor.howard@absiko.com.au> Co-authored-by: Taylor Howard <taylorhoward@me.com> Co-authored-by: Taylor Howard <taylor.howard@absiko.com.au>
This PR fixes timing issues on Windows. Simulation ratios have been observed as low as 6.5% on Windows with an empty scene, and simulation rates often hover around 80% with busier scenes. The problem was caused by the loop rate stabilization strategy. By default the Windows kernel timing resolution is 15.6 ms, meaning that a normal sleep command can not wake before 15.6 ms. On older version of Windows, a system-wide command was used to modify the system timing resolution, meaning that if any process requested a higher timing resolution all timers would also have this resolution. Newer Windows updates have changed this behavior, and each high resolution timer must now use the CREATE_WAITABLE_TIMER_HIGH_RESOLUTION with the Win32 API function CreateWaitableTimerEx() to create a timer that has the higher resolution capability. This PR modifies the SimulationRunner class to use a high resolution timer instead of std::this_thread::sleep_until() when on Windows. --------- Signed-off-by: John Wason <wason@wasontech.com> (cherry picked from commit 503bc6b) # Conflicts: # src/SimulationRunner.hh
Fix a syntax error in the Stop() function. Signed-off-by: Steve Peters <scpeters@openrobotics.org> (cherry picked from commit e8d87bf)
The AddEntity function calculates an iterator to its internal pendingEntities data structure to find children of a specified entity, then recursively calls itself. After iterating over all the children it will call erase on this previously computed iterator. This is potentially problematic because the function (called recursively) also includes a potential push_back call. If push_back reallocates it will invalidate all existing iterators, hence the following call to erase will try to erase an invalid iterator resulting in undefined behavior. This PR just moves all the entities to be iterated on into a separate vector and immediately erases them from the pendingEntities, then the iterator isn't used anymore. This assures that any operation that potentially invalidates iterators (such as the push_back) doesn't create any undefined behavior. --------- (cherry picked from commit a51bef7) Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai> Co-authored-by: Luca Della Vedova <lucadv@intrinsic.ai>
…3535) This PR adds getter APIs for retrieving joint velocity, effort, and position limits. gz::sim::Joint already provides setter methods for velocity limits, but no corresponding getter. This change adds Joint::VelocityLimits(), which reads the limit from the existing components::JointAxis state (sdf::JointAxis::MaxVelocity), including support for multi-axis joints. In addition, this PR also introduces getter methods for effort and position limits for completeness and API symmetry with the existing setters. --------- (cherry picked from commit f986646) Signed-off-by: Naitik Pahwa <naitikpahwa18@users.noreply.github.com> Co-authored-by: Naitik Pahwa <165963757+naitikpahwa18@users.noreply.github.com> Co-authored-by: Naitik Pahwa <naitikpahwa18@users.noreply.github.com>
…) (#3506) When adding a light via Component Inspector Editor, the created entity ends up with a Visual component but no valid Geometry. RenderUtil::CreateVisual assumes Geometry is present and calls visual.SetGeom(_geom->Data()), causing a crash. This fix return early when _geom is nullptr , avoiding the crash in SetGeom, while not affecting light creation --------- (cherry picked from commit 2d5f74b) Signed-off-by: momo <2438833481@qq.com> Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Co-authored-by: Oscmoar07 <108773152+XINJIANGMO@users.noreply.github.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
## Summary Previously, namespace was a mandatory parameter. This makes it a bit harder to have multiple instances of the same model without having to edit the SDF. Specifically, if a user had a model with a TouchPlugin in its SDF, two instances of the same model would inevitably publish to the same topic (unless they did some SDF experimental params overrides). With this PR, if users skip the `namespace` parameter, the plugin's namespace will default to `model_name/touch` making it easier to have models publish to unique topics. ## Test it Run the touch_plugin demo then list the topics: Current main: ``` $ gz sim -r touch_plugin.sdf $ gz topic -l [...] /white_touches_only_green/touched ``` Then change the demo world to remove the `namespace` parameter ``` $ gz sim -r touch_plugin.sdf $ gz topic -l [...] /white_box/touch/touched ``` Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai> * Use scoped name instead Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai> * Use topicFromScopedName instead Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai> --------- Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai> (cherry picked from commit d696e14)
* Fix EventManager RTTI failures across shared-library boundaries When plugins are loaded with RTLD_LOCAL and built with hidden visibility (the default via gz-cmake), each dylib gets its own copy of the RTTI type_info for the same C++ type. This causes three problems in EventManager: 1. dynamic_cast across the boundary returns nullptr even though the object really is the requested type. 2. typeid(E).hash_code() returns different values for the same type in different dylibs, so the unordered_map creates duplicate entries. 3. operator== on type_info references compares pointer identity, which also differs across dylibs. Fix by: - Replacing dynamic_cast with static_cast (the map key already guarantees the correct type by construction). - Switching the Hasher to name-based hashing via std::hash<std::string>(typeid::name()). - Adding a name-based fallback in EqualTo so that the same type loaded from different shared libraries compares equal. Generated-by: Claude Opus 4.6 --------- Signed-off-by: Taylor Howard <taylor.howard@absiko.com.au> Co-authored-by: Taylor Howard <taylor.howard@absiko.com.au> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> (cherry picked from commit 90e82be)
Adds fairly extensive benchmarks for various `EntityComponentManager` functions, from Each with different number of components, Entity[ies] / Children ByComponents, adding and removing components. Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai> Co-authored-by: Carlos Agüero <caguero@openrobotics.org> (cherry picked from commit 04f0f0a)
This PR adds support for the Reset API to the test fixture. As TestFixture is one of the main ways one can get access to the ECM in python when trying to write some scripts for Deep Reinforcement Learning I realized that without Reset supported in the TestFixture API, end users would have a very hard time using our python APIs (which are actually quite nice). (cherry picked from commit 6b7df49) Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
* Prepare 8.12.0 release --------- Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>
Some expectations in UNIT_ModelCommandAPI_TEST fail on arm64 CPUs on macOS, though the test passes with amd64 (see #3602). This suppresses the test failure by skipping the expectation on arm64. CI will not be fully clean yet due to compiler warnings from protobuf 35.0 (similar to gazebosim/gz-transport#873). Signed-off-by: Steve Peters <scpeters@intrinsic.ai> (cherry picked from commit 2b1971c)
## Summary The `Resize()` method from `protobuf/repeated_field.h` was deprecated in favor of `resize()` in protocolbuffers/protobuf#26025 and released in protobuf 35.0. This adds compiler directives to select the API based on the available protobuf version. It should fix the macOS compiler warnings: * [](https://build.osrfoundation.org/job/gz_sim-ci-main-homebrew-arm64/103/) https://build.osrfoundation.org/job/gz_sim-ci-main-homebrew-arm64/103/clang/ I believe this is safe to backport. Signed-off-by: Steve Peters <scpeters@intrinsic.ai> (cherry picked from commit fb893d2)
…view is queried (#3607) before the view is queried. `ecm.Each` always skips the entity, even if the view component is added back later. @iche033 and I ran into this bug specifically for the `ContactSensorData` component, where the `Physics` system wouldn't populate the data for a gripper collision entity if the component was previously added, then removed in a single step's `PreUpdate` calls. (The `ContactSensorData` component was being removed in our setup to minimize copying contact data from the physics engine to the ECM, which is expensive for a large number of contacts.) --------- Signed-off-by: Shameek Ganguly <shameek@intrinsic.ai> Co-authored-by: Ian Chen <iche@intrinsic.ai> (cherry picked from commit 7d1f3dc)
This suppresses a cmake warning on Ubuntu 26.04 (and macOS with homebrew). FetchContent_Populate with a single argument is deprecated in cmake 3.30 (see [CMP0169](https://cmake.org/cmake/help/latest/policy/CMP0169.html)) in favor of FetchContent_MakeAvailable, which was added in cmake 3.14. Since Harmonic only requires cmake 3.10.2 in general (and 3.11.0 in this specific example), this suppresses the warning by using the old behavior for CMP0169 to avoid disruption. See #3613 for the fix made in newer Gazebo versions. Signed-off-by: Steve Peters <scpeters@intrinsic.ai>
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> Co-authored-by: Ian Chen <iche@intrinsic.ai> (cherry picked from commit 63b0440)
Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>
Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai> Co-authored-by: Ian Chen <iche@intrinsic.ai> (cherry picked from commit 189dd17)
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> (cherry picked from commit e3ef021)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )