diff --git a/Changelog.md b/Changelog.md index 3544829b54..620f3f922a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,210 @@ ## Gazebo Sim 9.x -### Gazebo Sim 9.0.0 (2024-XX-XX) +### Gazebo Sim 9.0.0 (2024-09-25) + +1. **Baseline:** this includes all changes from 8.6.0 and earlier. + +1. Miscellaneous documentation fixes + * [Pull request #2634](https://github.com/gazebosim/gz-sim/pull/2634) + * [Pull request #2632](https://github.com/gazebosim/gz-sim/pull/2632) + * [Pull request #2628](https://github.com/gazebosim/gz-sim/pull/2628) + * [Pull request #2631](https://github.com/gazebosim/gz-sim/pull/2631) + * [Pull request #2627](https://github.com/gazebosim/gz-sim/pull/2627) + * [Pull request #2625](https://github.com/gazebosim/gz-sim/pull/2625) + * [Pull request #2622](https://github.com/gazebosim/gz-sim/pull/2622) + * [Pull request #2607](https://github.com/gazebosim/gz-sim/pull/2607) + * [Pull request #2606](https://github.com/gazebosim/gz-sim/pull/2606) + * [Pull request #2602](https://github.com/gazebosim/gz-sim/pull/2602) + * [Pull request #2601](https://github.com/gazebosim/gz-sim/pull/2601) + * [Pull request #2603](https://github.com/gazebosim/gz-sim/pull/2603) + * [Pull request #2578](https://github.com/gazebosim/gz-sim/pull/2578) + * [Pull request #2592](https://github.com/gazebosim/gz-sim/pull/2592) + * [Pull request #2582](https://github.com/gazebosim/gz-sim/pull/2582) + * [Pull request #2585](https://github.com/gazebosim/gz-sim/pull/2585) + * [Pull request #2576](https://github.com/gazebosim/gz-sim/pull/2576) + * [Pull request #2573](https://github.com/gazebosim/gz-sim/pull/2573) + * [Pull request #2571](https://github.com/gazebosim/gz-sim/pull/2571) + * [Pull request #2574](https://github.com/gazebosim/gz-sim/pull/2574) + * [Pull request #2564](https://github.com/gazebosim/gz-sim/pull/2564) + * [Pull request #2563](https://github.com/gazebosim/gz-sim/pull/2563) + * [Pull request #2562](https://github.com/gazebosim/gz-sim/pull/2562) + * [Pull request #2553](https://github.com/gazebosim/gz-sim/pull/2553) + +1. Fix log playback GUI display + * [Pull request #2611](https://github.com/gazebosim/gz-sim/pull/2611) + * [Pull request #2619](https://github.com/gazebosim/gz-sim/pull/2619) + +1. Add tutorial + example SDF for shadow texture size + * [Pull request #2597](https://github.com/gazebosim/gz-sim/pull/2597) + +1. Fix making breadcrumb static if it's a nested model + * [Pull request #2593](https://github.com/gazebosim/gz-sim/pull/2593) + +1. Update physics system error msg when plugin can not be loaded + * [Pull request #2604](https://github.com/gazebosim/gz-sim/pull/2604) + +1. Fix configuring global illumination GUI plugin parameters + * [Pull request #2594](https://github.com/gazebosim/gz-sim/pull/2594) + +1. Fix particle emitter color range image path warning + * [Pull request #2560](https://github.com/gazebosim/gz-sim/pull/2560) + +1. Fix empty gui world file + * [Pull request #2591](https://github.com/gazebosim/gz-sim/pull/2591) + +1. Fix crash on windows due to invalid log directory path + * [Pull request #2589](https://github.com/gazebosim/gz-sim/pull/2589) + +1. Use ogre2 for DEM worlds + * [Pull request #2586](https://github.com/gazebosim/gz-sim/pull/2586) + +1. Fix crash when running the optical tactile sensor world + * [Pull request #2561](https://github.com/gazebosim/gz-sim/pull/2561) + +1. Prevent follow actor plugin from crashing when actor is removed + * [Pull request #2577](https://github.com/gazebosim/gz-sim/pull/2577) + * [Pull request #2584](https://github.com/gazebosim/gz-sim/pull/2584) + +1. Fix hydrodynamics deprecation warning. + * [Pull request #2579](https://github.com/gazebosim/gz-sim/pull/2579) + +1. Removed actor population world due to bad merge + * [Pull request #2581](https://github.com/gazebosim/gz-sim/pull/2581) + +1. Fixed warning joint trayectory sdf + * [Pull request #2580](https://github.com/gazebosim/gz-sim/pull/2580) + +1. Fix looking up camera name in camera lens system + * [Pull request #2559](https://github.com/gazebosim/gz-sim/pull/2559) + +1. Add a flexible mechanism to combine user and default plugins + * [Pull request #2497](https://github.com/gazebosim/gz-sim/pull/2497) + +1. Fix crash at exit due to a race condition with new signal handler + * [Pull request #2545](https://github.com/gazebosim/gz-sim/pull/2545) + +1. Remove from test worlds + * [Pull request #2551](https://github.com/gazebosim/gz-sim/pull/2551) + +1. Consolidate entity creation. + * [Pull request #2452](https://github.com/gazebosim/gz-sim/pull/2452) + * [Pull request #2527](https://github.com/gazebosim/gz-sim/pull/2527) + * [Pull request #2546](https://github.com/gazebosim/gz-sim/pull/2546) + +1. Add cmake install prefix + * [Pull request #2539](https://github.com/gazebosim/gz-sim/pull/2539) + +1. Fix UNIT_Server_TEST failure caused by change in behavior of `gz::common::SignalHandler` + * [Pull request #2537](https://github.com/gazebosim/gz-sim/pull/2537) + +1. Fix SphericalCoordinates deprecation warnings + * [Pull request #2535](https://github.com/gazebosim/gz-sim/pull/2535) + +1. Revert behavior change introduced in #2452 + +1. Specify System::PreUpdate, Update execution order + * [Pull request #2487](https://github.com/gazebosim/gz-sim/pull/2487) + +1. Add System interface to set default priority + * [Pull request #2500](https://github.com/gazebosim/gz-sim/pull/2500) + +1. Force Qt to use xcb plugin on Wayland + * [Pull request #2526](https://github.com/gazebosim/gz-sim/pull/2526) + +1. Physics: set link velocity from VelocityReset components + * [Pull request #2489](https://github.com/gazebosim/gz-sim/pull/2489) + +1. ForceTorque system: write WrenchMeasured to ECM + * [Pull request #2494](https://github.com/gazebosim/gz-sim/pull/2494) + +1. Remove unused var + * [Pull request #2524](https://github.com/gazebosim/gz-sim/pull/2524) + +1. Deprecate use of added mass via hydrodynamics + * [Pull request #2493](https://github.com/gazebosim/gz-sim/pull/2493) + +1. Make sure steering joints exist before updating velocity / odometry in AckermannSteering plugin + * [Pull request #2521](https://github.com/gazebosim/gz-sim/pull/2521) + +1. Fix ResourceSpawner + * [Pull request #2490](https://github.com/gazebosim/gz-sim/pull/2490) + +1. gui_system_plugin: clarify description in README + * [Pull request #2253](https://github.com/gazebosim/gz-sim/pull/2253) + +1. Fix adding system to non-existent entity + * [Pull request #2516](https://github.com/gazebosim/gz-sim/pull/2516) + +1. Remove ignition related deprecations + * [Pull request #2505](https://github.com/gazebosim/gz-sim/pull/2505) + +1. Fix #2458 - Checking linkEnity is empty + * [Pull request #2509](https://github.com/gazebosim/gz-sim/pull/2509) + +1. Specify System::PreUpdate, Update execution order + * [Pull request #2487](https://github.com/gazebosim/gz-sim/pull/2487) + +1. Improve signal handling + * [Pull request #2501](https://github.com/gazebosim/gz-sim/pull/2501) + +1. Initialize threadsNeedCleanUp + * [Pull request #2503](https://github.com/gazebosim/gz-sim/pull/2503) + +1. Added support for spacecraft thrusters + * [Pull request #2431](https://github.com/gazebosim/gz-sim/pull/2431) + +1. Remove systems if their parent entity is removed + * [Pull request #2232](https://github.com/gazebosim/gz-sim/pull/2232) + +1. Disable rendering tests that are failing on github actions + * [Pull request #2480](https://github.com/gazebosim/gz-sim/pull/2480) + +1. Fix warnings generated by NetworkConfigTest + * [Pull request #2469](https://github.com/gazebosim/gz-sim/pull/2469) + +1. Support visualizing mesh collisions with convex decomposition + * [Pull request #2352](https://github.com/gazebosim/gz-sim/pull/2352) + +1. Remove python3-distutils from package.xml + * [Pull request #2450](https://github.com/gazebosim/gz-sim/pull/2450) + +1. shapes.sdf example: bump to 1.12, add cone shape + * [Pull request #2448](https://github.com/gazebosim/gz-sim/pull/2448) + +1. Adding cone primitives. + * [Pull request #2410](https://github.com/gazebosim/gz-sim/pull/2410) + * [Pull request #2449](https://github.com/gazebosim/gz-sim/pull/2449) + +1. Enable 24.04 CI, require cmake 3.22.1 + * [Pull request #2420](https://github.com/gazebosim/gz-sim/pull/2420) + +1. Parse and set bullet solver iterations + * [Pull request #2351](https://github.com/gazebosim/gz-sim/pull/2351) + +1. ForceTorque system: improve readability + * [Pull request #2403](https://github.com/gazebosim/gz-sim/pull/2403) + +1. Fix warn unused variable in test + * [Pull request #2388](https://github.com/gazebosim/gz-sim/pull/2388) + +1. Physics: remove VelocityCmd at each time step + * [Pull request #2228](https://github.com/gazebosim/gz-sim/pull/2228) + +1. Regroup tutorials into four categories + * [Pull request #2109](https://github.com/gazebosim/gz-sim/pull/2109) + +1. Remove HIDE_SYMBOLS_BY_DEFAULT: replace by a default configuration in gz-cmake. + * [Pull request #2283](https://github.com/gazebosim/gz-sim/pull/2283) + +1. Enable HIDE_SYMBOLS_BY_DEFAULT + linux patches + * [Pull request #2248](https://github.com/gazebosim/gz-sim/pull/2248) + +1. Use sdf FindElement API to avoid const_cast + * [Pull request #2231](https://github.com/gazebosim/gz-sim/pull/2231) + +1. Bumps in Ionic: gz-sim9 + * [Pull request #2205](https://github.com/gazebosim/gz-sim/pull/2205) + * [Pull request #2211](https://github.com/gazebosim/gz-sim/pull/2211) ## Gazebo Sim 8.x diff --git a/README.md b/README.md index 145b8b9dde..2229645f1d 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ Build | Status -- | -- -Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-sim/tree/gz-sim8/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-sim/tree/gz-sim8) -Ubuntu Jammy | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_sim-ci-gz-sim8-jammy-amd64)](https://build.osrfoundation.org/job/gz_sim-ci-gz-sim8-jammy-amd64) -Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_sim-ci-gz-sim8-homebrew-amd64)](https://build.osrfoundation.org/job/gz_sim-ci-gz-sim8-homebrew-amd64) -Windows | [![Build Status](https://build.osrfoundation.org/job/gz_sim-8-win/badge/icon)](https://build.osrfoundation.org/job/gz_sim-8-win/) +Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-sim/tree/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-sim/tree/main) +Ubuntu Noble | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_sim-ci-main-noble-amd64)](https://build.osrfoundation.org/job/gz_sim-ci-main-noble-amd64) +Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_sim-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/gz_sim-ci-main-homebrew-amd64) +Windows | [![Build Status](https://build.osrfoundation.org/job/gz_sim-main-win/badge/icon)](https://build.osrfoundation.org/job/gz_sim-main-win/) Gazebo Sim is an open source robotics simulator. Through Gazebo Sim, users have access to high fidelity physics, rendering, and sensor models. Additionally, users and developers have multiple points of entry to simulation including a graphical user interface, plugins, and asynchronous message passing and services. @@ -32,10 +32,10 @@ Gazebo Sim is derived from [Gazebo Classic](http://classic.gazebosim.org) and re [Folder Structure](#folder-structure) -[Code of Conduct](#code-of-conduct) - [Contributing](#contributing) +[Code of Conduct](#code-of-conduct) + [Versioning](#versioning) [License](#license) @@ -99,29 +99,20 @@ gz sim -h In the event that the installation is a mix of Debian and from source, command line tools from `gz-tools` may not work correctly. -A workaround for a single package is to define the environment variable -`GZ_CONFIG_PATH` to point to the location of the Gazebo library installation, -where the YAML file for the package is found, such as +A workaround is to define the environment variable +`GZ_CONFIG_PATH` to point to the different locations of the Gazebo libraries installations, +where the YAML files for the packages are found, such as ``` -export GZ_CONFIG_PATH=/usr/local/share/gz +export GZ_CONFIG_PATH=/usr/local/share/gz:$HOME/ws/install/share/gz ``` -However, that environment variable only takes a single path, which means if the -installations from source are in different locations, only one can be specified. +where `$HOME/ws` is an example colcon workspace used to build Gazebo. -Another workaround for working with multiple Gazebo libraries on the command -line is using symbolic links to each library's YAML file. -``` -mkdir ~/.gz/tools/configs -p -cd ~/.gz/tools/configs/ -ln -s /usr/local/share/gz/fuel8.yaml . -ln -s /usr/local/share/gz/transport14.yaml . -ln -s /usr/local/share/gz/transportlog13.yaml . -... -export GZ_CONFIG_PATH=$HOME/.gz/tools/configs -``` - -This issue is tracked [here](https://github.com/gazebosim/gz-tools/issues/8). +On Windows, `gz sim` (i.e. running both server and GUI in one command) doesn't yet work. +To run Gazebo Sim on Windows, you need to run the server in one terminal (`gz sim -s `) +and the GUI in another terminal (`gz sim -g `). Remember this when reading through +all Gazebo Sim tutorials. Also remember that Conda and `install\setup.bat` need to be sourced +in both terminals (as well as any changes to `GZ_PARTITION` and other environment variables). # Documentation @@ -131,7 +122,7 @@ See the [installation tutorial](https://gazebosim.org/api/sim/9/install.html). See the [installation tutorial](https://gazebosim.org/api/sim/9/install.html). -See the [Writing Tests section of the contributor guide](https://github.com/gazebosim/gz-sim/blob/main/CONTRIBUTING.md#writing-tests) for help creating or modifying tests. +See the [Writing Tests section of the contributor guide](https://gazebosim.org/docs/all/contributing/#writing-tests) for help creating or modifying tests. # Folder Structure @@ -154,7 +145,7 @@ gz-sim │   ├── performance Performance tests. │   ├── plugins Plugins used in tests. │   ├── regression Regression tests. -│   └── tutorials Tutorials, written in markdown. +├── tutorials Tutorials, written in markdown. ├── Changelog.md Changelog. ├── CMakeLists.txt CMake build script. ├── Migration.md Migration guide. @@ -163,8 +154,8 @@ gz-sim # Contributing -Please see -[CONTRIBUTING.md](https://github.com/gazebosim/gz-sim/blob/main/CONTRIBUTING.md). +Please see the +[contribution guide](https://gazebosim.org/docs/all/contributing/). # Code of Conduct diff --git a/examples/plugin/custom_sensor_system/README.md b/examples/plugin/custom_sensor_system/README.md index 47700bc7fe..7d47ddb04b 100644 --- a/examples/plugin/custom_sensor_system/README.md +++ b/examples/plugin/custom_sensor_system/README.md @@ -10,7 +10,7 @@ It uses the odometer created on this example: From the root of the `gz-sim` repository, do the following to build the example: ~~~ -cd examples/plugins/custom_sensor_system +cd examples/plugin/custom_sensor_system mkdir build cd build cmake .. @@ -27,7 +27,7 @@ the `odometer.sdf` file that's going to be loaded. Before starting Gazebo, we must make sure it can find the plugin by doing: ~~~ -cd examples/plugins/custom_sensor_system +cd examples/plugin/custom_sensor_system export GZ_SIM_SYSTEM_PLUGIN_PATH=`pwd`/build ~~~ diff --git a/examples/worlds/actors_population.sdf b/examples/worlds/actors_population.sdf deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/examples/worlds/dem_monterey_bay.sdf b/examples/worlds/dem_monterey_bay.sdf index 7f2d170121..39539ca1f2 100644 --- a/examples/worlds/dem_monterey_bay.sdf +++ b/examples/worlds/dem_monterey_bay.sdf @@ -22,7 +22,7 @@ docked - ogre + ogre2 scene 0 0 0 0.8 0.8 0.8 diff --git a/examples/worlds/dem_moon.sdf b/examples/worlds/dem_moon.sdf index a1de71ad5e..047607d3f1 100644 --- a/examples/worlds/dem_moon.sdf +++ b/examples/worlds/dem_moon.sdf @@ -29,7 +29,7 @@ docked - ogre + ogre2 scene 0 0 0 0.8 0.8 0.8 diff --git a/examples/worlds/dem_volcano.sdf b/examples/worlds/dem_volcano.sdf index f48b2779a4..f2f766b869 100644 --- a/examples/worlds/dem_volcano.sdf +++ b/examples/worlds/dem_volcano.sdf @@ -21,7 +21,7 @@ docked - ogre + ogre2 scene 0 0 0 0.8 0.8 0.8 diff --git a/examples/worlds/empty_gui.sdf b/examples/worlds/empty_gui.sdf index 0975a4f142..54df8c2e31 100644 --- a/examples/worlds/empty_gui.sdf +++ b/examples/worlds/empty_gui.sdf @@ -37,6 +37,10 @@ This example helps illustrate the interaction of the MinimalScene with other GUI + + false + + diff --git a/examples/worlds/joint_trajectory_controller.sdf b/examples/worlds/joint_trajectory_controller.sdf index 2f9508bd49..d6b62a5b8c 100644 --- a/examples/worlds/joint_trajectory_controller.sdf +++ b/examples/worlds/joint_trajectory_controller.sdf @@ -479,10 +479,10 @@ RR_velocity_control_link1 1 0 0 + + 0.02 + - - 0.02 - 0 0 0.1 0 0 0 @@ -490,10 +490,10 @@ RR_velocity_control_link2 1 0 0 + + 0.01 + - - 0.01 - + + + + 0.1 0.1 0.1 + 0.0 0.0 0.0 + + + + + + ogre2 + -10 0 7 0 0.5 0 + + 8192 + + + + + + + + + + 0 0 8 0 0 0 + 1 1 1 1 + 0 0 0 0 + + 50 + 0 + 0 + 0 + + true + -2 2 -1.5 + 1.0 + + + + + 0 0 0 0 0 -1.57 + + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Garden Mascot + + + + + -5 0 -0.5 0 0 0 + true + + + + + 15 15 1 + + + + + + + 15 15 1 + + + + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + + + + + + diff --git a/python/src/gz/sim/Joint.cc b/python/src/gz/sim/Joint.cc index 307289ec44..328e4d51cf 100644 --- a/python/src/gz/sim/Joint.cc +++ b/python/src/gz/sim/Joint.cc @@ -94,7 +94,22 @@ void defineSimJoint(py::object module) py::arg("ecm"), py::arg("limits"), "Set the effort limits on a joint axis.") - .def("set_position_imits", &gz::sim::Joint::SetPositionLimits, + .def("set_position_imits", + [](pybind11::object &self, EntityComponentManager &_ecm, + const std::vector &_limits) + { + auto warnings = pybind11::module::import("warnings"); + auto builtins = pybind11::module::import("builtins"); + warnings.attr("warn")( + "set_position_imits() is deprecated, use set_position_limits() instead.", + builtins.attr("DeprecationWarning")); + + return self.attr("set_position_limits")(_ecm, _limits); + }, + py::arg("ecm"), + py::arg("limits"), + "Set the position limits on a joint axis.") + .def("set_position_limits", &gz::sim::Joint::SetPositionLimits, py::arg("ecm"), py::arg("limits"), "Set the position limits on a joint axis.") diff --git a/src/SdfEntityCreator.cc b/src/SdfEntityCreator.cc index 1c45bfc4e8..2c258c1ad8 100644 --- a/src/SdfEntityCreator.cc +++ b/src/SdfEntityCreator.cc @@ -23,6 +23,7 @@ #include "gz/sim/Events.hh" #include "gz/sim/SdfEntityCreator.hh" +#include "gz/sim/Util.hh" #include "gz/sim/components/Actor.hh" #include "gz/sim/components/AirPressureSensor.hh" @@ -67,7 +68,7 @@ #include "gz/sim/components/NavSat.hh" #include "gz/sim/components/ParentEntity.hh" #include "gz/sim/components/ParentLinkName.hh" -#include +#include "gz/sim/components/ParticleEmitter.hh" #include "gz/sim/components/Performer.hh" #include "gz/sim/components/Physics.hh" #include "gz/sim/components/PhysicsEnginePlugin.hh" @@ -1004,9 +1005,27 @@ Entity SdfEntityCreator::CreateEntities(const sdf::ParticleEmitter *_emitter) // Entity Entity emitterEntity = this->dataPtr->ecm->CreateEntity(); + auto particleEmitterMsg = convert(*_emitter); + + // Update image path + // Ideally this is done by gz/sim/src/SceneManager.cc when creating + // the particle emitter. However the component stores a msg instead of + // an sdf so the sdf FilePath information is lost and rendering is not + // able to construct the full path of the image. + // \todo(iche033) Consider changing the ParticleEmitter component to + // store an sdf::ParticleEmitter object instead of msgs::ParticleEmitter. + std::string imagePath = _emitter->ColorRangeImage(); + if (!imagePath.empty()) + { + std::string path = common::findFile(asFullPath(imagePath, + _emitter->Element()->FilePath())); + path = path.empty() ? imagePath : path; + particleEmitterMsg.mutable_color_range_image()->set_data(path); + } + // Components this->dataPtr->ecm->CreateComponent(emitterEntity, - components::ParticleEmitter(convert(*_emitter))); + components::ParticleEmitter(particleEmitterMsg)); this->dataPtr->ecm->CreateComponent(emitterEntity, components::Pose(ResolveSdfPose(_emitter->SemanticPose()))); this->dataPtr->ecm->CreateComponent(emitterEntity, diff --git a/src/ServerConfig.cc b/src/ServerConfig.cc index 4e75a68ea0..c3562a77fb 100644 --- a/src/ServerConfig.cc +++ b/src/ServerConfig.cc @@ -168,9 +168,13 @@ class gz::sim::ServerConfigPrivate this->timestamp = GZ_SYSTEM_TIME(); + std::string timeInIso = common::timeToIso(this->timestamp); + #ifdef _WIN32 + std::replace(timeInIso.begin(), timeInIso.end(), ':', '-'); + #endif // Set a default log record path this->logRecordPath = common::joinPaths(home, - ".gz", "sim", "log", common::timeToIso(this->timestamp)); + ".gz", "sim", "log", timeInIso); // If directory already exists, do not overwrite. This could potentially // happen if multiple simulation instances are started in rapid diff --git a/src/SimulationRunner.cc b/src/SimulationRunner.cc index 268e956cda..baa2712adc 100644 --- a/src/SimulationRunner.cc +++ b/src/SimulationRunner.cc @@ -1596,8 +1596,6 @@ void SimulationRunner::CreateEntities(const sdf::World &_world) this->entityCompMgr.ProcessRemoveEntityRequests(); this->entityCompMgr.ClearRemovedComponents(); - this->LoadLoggingPlugins(this->serverConfig); - // Load any additional plugins from the Server Configuration this->LoadServerPlugins(this->serverConfig.Plugins()); @@ -1653,6 +1651,11 @@ void SimulationRunner::CreateEntities(const sdf::World &_world) } this->LoadServerPlugins(defaultPlugins); + // Load logging plugins after all server plugins so that necessary + // plugins such as SceneBroadcaster are loaded first. This might be + // a bug or an assumption made in the logging plugins. + this->LoadLoggingPlugins(this->serverConfig); + }; // Store the initial state of the ECM; diff --git a/src/gui/plugins/global_illumination_civct/GlobalIlluminationCiVct.cc b/src/gui/plugins/global_illumination_civct/GlobalIlluminationCiVct.cc index d2b8f4c20c..cfab7f414f 100644 --- a/src/gui/plugins/global_illumination_civct/GlobalIlluminationCiVct.cc +++ b/src/gui/plugins/global_illumination_civct/GlobalIlluminationCiVct.cc @@ -172,13 +172,13 @@ GlobalIlluminationCiVct::~GlobalIlluminationCiVct() } ///////////////////////////////////////////////// -void GlobalIlluminationCiVct::LoadGlobalIlluminationCiVct() +bool GlobalIlluminationCiVct::LoadGlobalIlluminationCiVct() REQUIRES(this->dataPtr->serviceMutex) { auto loadedEngNames = rendering::loadedEngines(); if (loadedEngNames.empty()) { - return; + return false; } // assume there is only one engine loaded @@ -194,11 +194,11 @@ void GlobalIlluminationCiVct::LoadGlobalIlluminationCiVct() { gzerr << "Internal error: failed to load engine [" << engineName << "]. GlobalIlluminationCiVct plugin won't work." << std::endl; - return; + return false; } if (engine->SceneCount() == 0) - return; + return false; // assume there is only one scene // load scene @@ -206,12 +206,13 @@ void GlobalIlluminationCiVct::LoadGlobalIlluminationCiVct() if (!scene) { gzerr << "Internal error: scene is null." << std::endl; - return; + return false; } - if (!scene->IsInitialized() || scene->VisualCount() == 0) + if (!scene->IsInitialized() || scene->VisualCount() == 0 || + scene->LightCount() == 0) { - return; + return false; } // Create visual @@ -225,6 +226,7 @@ void GlobalIlluminationCiVct::LoadGlobalIlluminationCiVct() << std::endl; gz::gui::App()->findChild()->removeEventFilter(this); + return false; } else { @@ -254,6 +256,7 @@ void GlobalIlluminationCiVct::LoadGlobalIlluminationCiVct() this->OnRefreshCamerasImpl(); } + return true; } /// \brief XML helper to retrieve values and handle errors @@ -358,9 +361,7 @@ void GlobalIlluminationCiVct::LoadConfig( const tinyxml2::XMLElement *_pluginElem) { if (this->title.empty()) - this->title = "Global Illumination (VCT)"; - - std::lock_guard lock(this->dataPtr->serviceMutex); + this->title = "Global Illumination (CI VCT)"; if (auto elem = _pluginElem->FirstChildElement("enabled")) { @@ -447,15 +448,25 @@ bool GlobalIlluminationCiVct::eventFilter(QObject *_obj, QEvent *_event) { if (_event->type() == gz::gui::events::Render::kType) { - // This event is called in Scene3d's RenderThread, so it's safe to make + // This event is called in the render thread, so it's safe to make // rendering calls here - std::lock_guard lock(this->dataPtr->serviceMutex); if (!this->dataPtr->initialized) { - this->LoadGlobalIlluminationCiVct(); + if (this->LoadGlobalIlluminationCiVct()) + { + this->SetEnabled(this->dataPtr->enabled); + this->SetBounceCount(this->dataPtr->bounceCount); + this->SetHighQuality(this->dataPtr->highQuality); + this->SetAnisotropic(this->dataPtr->anisotropic); + this->SetDebugVisualizationMode(this->dataPtr->debugVisMode); + this->EnabledChanged(); + this->LightingChanged(); + this->DebugVisualizationModeChanged(); + } } + std::lock_guard lock(this->dataPtr->serviceMutex); if (this->dataPtr->gi) { if (!this->dataPtr->visualDirty && !this->dataPtr->gi->Enabled() && @@ -563,10 +574,6 @@ bool GlobalIlluminationCiVct::eventFilter(QObject *_obj, QEvent *_event) this->dataPtr->resetRequested = false; } } - else - { - gzerr << "GI pointer is not set" << std::endl; - } } // Standard event processing diff --git a/src/gui/plugins/global_illumination_civct/GlobalIlluminationCiVct.hh b/src/gui/plugins/global_illumination_civct/GlobalIlluminationCiVct.hh index 6ebaee5741..d5327ae32f 100644 --- a/src/gui/plugins/global_illumination_civct/GlobalIlluminationCiVct.hh +++ b/src/gui/plugins/global_illumination_civct/GlobalIlluminationCiVct.hh @@ -103,7 +103,8 @@ inline namespace GZ_SIM_VERSION_NAMESPACE public: bool eventFilter(QObject *_obj, QEvent *_event) override; /// \brief Load the scene and attach LidarVisual to the scene - public: void LoadGlobalIlluminationCiVct(); + /// \return True if GI CIVCT is loaded successfully, false otherwise. + public: bool LoadGlobalIlluminationCiVct(); /// \brief Set debug visualization mode GlogbalIllumination /// \param[in] _mode Index of selected debug visualization mode diff --git a/src/gui/plugins/global_illumination_vct/GlobalIlluminationVct.cc b/src/gui/plugins/global_illumination_vct/GlobalIlluminationVct.cc index 0d6400c1a5..3abbabaec4 100644 --- a/src/gui/plugins/global_illumination_vct/GlobalIlluminationVct.cc +++ b/src/gui/plugins/global_illumination_vct/GlobalIlluminationVct.cc @@ -166,13 +166,13 @@ GlobalIlluminationVct::~GlobalIlluminationVct() } ///////////////////////////////////////////////// -void GlobalIlluminationVct::LoadGlobalIlluminationVct() +bool GlobalIlluminationVct::LoadGlobalIlluminationVct() REQUIRES(this->dataPtr->serviceMutex) { auto loadedEngNames = rendering::loadedEngines(); if (loadedEngNames.empty()) { - return; + return false; } // assume there is only one engine loaded @@ -188,11 +188,11 @@ void GlobalIlluminationVct::LoadGlobalIlluminationVct() { gzerr << "Internal error: failed to load engine [" << engineName << "]. GlobalIlluminationVct plugin won't work." << std::endl; - return; + return false; } if (engine->SceneCount() == 0) - return; + return false; // assume there is only one scene // load scene @@ -200,15 +200,16 @@ void GlobalIlluminationVct::LoadGlobalIlluminationVct() if (!scene) { gzerr << "Internal error: scene is null." << std::endl; - return; + return false; } - if (!scene->IsInitialized() || scene->VisualCount() == 0) + if (!scene->IsInitialized() || scene->VisualCount() == 0 || + scene->LightCount() == 0) { - return; + return false; } - // Create lidar visual + // Create GI gzdbg << "Creating GlobalIlluminationVct" << std::endl; auto root = scene->RootVisual(); @@ -219,6 +220,7 @@ void GlobalIlluminationVct::LoadGlobalIlluminationVct() << std::endl; gz::gui::App()->findChild()->removeEventFilter(this); + return false; } else { @@ -228,6 +230,7 @@ void GlobalIlluminationVct::LoadGlobalIlluminationVct() this->dataPtr->scene = scene; this->dataPtr->initialized = true; } + return true; } /// \brief XML helper to retrieve values and handle errors @@ -319,8 +322,6 @@ void GlobalIlluminationVct::LoadConfig(const tinyxml2::XMLElement *_pluginElem) if (this->title.empty()) this->title = "Global Illumination (VCT)"; - std::lock_guard lock(this->dataPtr->serviceMutex); - if (auto elem = _pluginElem->FirstChildElement("enabled")) { GetXmlBool(elem, this->dataPtr->enabled); @@ -394,15 +395,35 @@ bool GlobalIlluminationVct::eventFilter(QObject *_obj, QEvent *_event) { if (_event->type() == gz::gui::events::Render::kType) { - // This event is called in Scene3d's RenderThread, so it's safe to make + // This event is called in render thread, so it's safe to make // rendering calls here - std::lock_guard lock(this->dataPtr->serviceMutex); if (!this->dataPtr->initialized) { - this->LoadGlobalIlluminationVct(); + if (this->LoadGlobalIlluminationVct()) + { + // update properties and notify QML + this->SetEnabled(this->dataPtr->enabled); + this->SetResolutionX(this->dataPtr->resolution[0]); + this->SetResolutionY(this->dataPtr->resolution[1]); + this->SetResolutionZ(this->dataPtr->resolution[2]); + this->SetOctantCountX(this->dataPtr->octantCount[0]); + this->SetOctantCountY(this->dataPtr->octantCount[1]); + this->SetOctantCountZ(this->dataPtr->octantCount[2]); + this->SetBounceCount(this->dataPtr->bounceCount); + this->SetHighQuality(this->dataPtr->highQuality); + this->SetAnisotropic(this->dataPtr->anisotropic); + this->SetConserveMemory(this->dataPtr->conserveMemory); + this->SetThinWallCounter(this->dataPtr->thinWallCounter); + this->SetDebugVisualizationMode(this->dataPtr->debugVisMode); + this->EnabledChanged(); + this->LightingChanged(); + this->SettingsChanged(); + this->DebugVisualizationModeChanged(); + } } + std::lock_guard lock(this->dataPtr->serviceMutex); if (this->dataPtr->gi) { if (this->dataPtr->resetVisual) @@ -485,10 +506,6 @@ bool GlobalIlluminationVct::eventFilter(QObject *_obj, QEvent *_event) this->dataPtr->debugVisualizationDirty = false; } } - else - { - gzerr << "GI pointer is not set" << std::endl; - } } // Standard event processing diff --git a/src/gui/plugins/global_illumination_vct/GlobalIlluminationVct.hh b/src/gui/plugins/global_illumination_vct/GlobalIlluminationVct.hh index fde6a6979b..19a6d3ec61 100644 --- a/src/gui/plugins/global_illumination_vct/GlobalIlluminationVct.hh +++ b/src/gui/plugins/global_illumination_vct/GlobalIlluminationVct.hh @@ -156,7 +156,8 @@ inline namespace GZ_SIM_VERSION_NAMESPACE public: bool eventFilter(QObject *_obj, QEvent *_event) override; /// \brief Load the scene and attach LidarVisual to the scene - public: void LoadGlobalIlluminationVct(); + /// \return True if GI VCT is loaded successfully, false otherwise. + public: bool LoadGlobalIlluminationVct(); /// \brief Set debug visualization mode GlogbalIllumination /// \param[in] _mode Index of selected debug visualization mode diff --git a/src/systems/breadcrumbs/Breadcrumbs.cc b/src/systems/breadcrumbs/Breadcrumbs.cc index 0f22687984..7db739da98 100644 --- a/src/systems/breadcrumbs/Breadcrumbs.cc +++ b/src/systems/breadcrumbs/Breadcrumbs.cc @@ -387,8 +387,33 @@ bool Breadcrumbs::MakeStatic(Entity _entity, EntityComponentManager &_ecm) Entity childLinkEntity = _ecm.EntityByComponents( components::CanonicalLink(), components::ParentEntity(_entity)); + // If the entity does not have a canonical link, it may be a nested model if (childLinkEntity == kNullEntity) - return false; + { + // Find canonical link within nested model + auto findCanonicalLink = [&_ecm](Entity _parent, auto &&_findCanonicalLink) + { + auto nestedEntities = _ecm.EntitiesByComponents( + components::Model(), components::ParentEntity(_parent)); + for (const auto ent : nestedEntities) + { + auto comp = _ecm.Component(ent); + if (comp) + { + return comp->Data(); + } + else + { + // recursively search for canonical link + return _findCanonicalLink(ent, _findCanonicalLink); + } + } + return kNullEntity; + }; + childLinkEntity = findCanonicalLink(_entity, findCanonicalLink); + if (childLinkEntity == kNullEntity) + return false; + } Entity detachableJointEntity = _ecm.CreateEntity(); _ecm.CreateComponent(detachableJointEntity, diff --git a/src/systems/follow_actor/FollowActor.cc b/src/systems/follow_actor/FollowActor.cc index 99d8315882..88f72c3f84 100644 --- a/src/systems/follow_actor/FollowActor.cc +++ b/src/systems/follow_actor/FollowActor.cc @@ -209,7 +209,9 @@ void FollowActor::PreUpdate(const UpdateInfo &_info, this->dataPtr->lastUpdate = _info.simTime; // Is there a follow target? - if (this->dataPtr->targetEntity == kNullEntity) + if (this->dataPtr->targetEntity == kNullEntity || + !_ecm.HasEntity(this->dataPtr->targetEntity) || + !_ecm.HasEntity(this->dataPtr->actorEntity)) return; // Current world pose diff --git a/src/systems/hydrodynamics/Hydrodynamics.cc b/src/systems/hydrodynamics/Hydrodynamics.cc index c3cd80e9c1..eed111deff 100644 --- a/src/systems/hydrodynamics/Hydrodynamics.cc +++ b/src/systems/hydrodynamics/Hydrodynamics.cc @@ -355,21 +355,22 @@ void Hydrodynamics::Configure( prefix += snameConventionVel[j]; this->dataPtr->Ma(i, j) = SdfParamDouble(_sdf, prefix, 0); addedMassSpecified = (std::abs(this->dataPtr->Ma(i, j)) > 1e-6) - && addedMassSpecified; + || addedMassSpecified; } } _sdf->Get("disable_coriolis", this->dataPtr->disableCoriolis, false); - _sdf->Get("disable_added_mass", this->dataPtr->disableAddedMass, false); - if (!this->dataPtr->disableAddedMass || addedMassSpecified) + _sdf->Get("disable_added_mass", + this->dataPtr->disableAddedMass, false); + if (!this->dataPtr->disableAddedMass && addedMassSpecified) { - gzerr << "The use of added mass through this plugin is deprecated and will" - << "be removed in Gazebo J* as this formulation has instabilities." - << " We recommend using the SDF `` tag based method" + gzwarn << "The use of added mass through this plugin is deprecated and " + << "will be removed in Gazebo J* as this formulation has instabilities. " + << "We recommend using the SDF `` tag based method " << "[http://sdformat.org/spec?ver=1.11&elem=link" << "#inertial_fluid_added_mass]" - << "To get rid of this warning we recommend setting" - << "` to true." + << "To get rid of this warning we recommend setting " + << "`` to true and updating your model" << std::endl; } // Create model object, to access convenient functions diff --git a/src/systems/lens_flare/LensFlare.cc b/src/systems/lens_flare/LensFlare.cc index 8f099d6653..6739bb4e71 100644 --- a/src/systems/lens_flare/LensFlare.cc +++ b/src/systems/lens_flare/LensFlare.cc @@ -128,8 +128,9 @@ void LensFlare::Configure( } // Get Camera Name - this->dataPtr->cameraName = scopedName(this->dataPtr->entity, - _ecm, "::", false); + this->dataPtr->cameraName = + removeParentScope(scopedName(this->dataPtr->entity, + _ecm, "::", false), "::"); // call function that connects to post render event this->dataPtr->postRenderConn = diff --git a/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc b/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc index f1d6d618fa..e2bf376e1e 100644 --- a/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc +++ b/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc @@ -530,6 +530,7 @@ void OpticalTactilePluginPrivate::Load(const EntityComponentManager &_ecm) int contactSensorCounter = 0; sdf::Sensor depthCameraSdf; components::Pose depthCameraPose = components::Pose(); + std::string depthCameraTopic; for (const Entity &sensor : sensorsInsideLink) { if (_ecm.EntityHasComponentType(sensor, components::DepthCamera::typeId)) @@ -538,6 +539,10 @@ void OpticalTactilePluginPrivate::Load(const EntityComponentManager &_ecm) depthCameraSdf = _ecm.Component(sensor)->Data(); depthCameraPose = *(_ecm.Component(sensor)); + auto depthCameraTopicComp = + _ecm.Component(sensor); + if (depthCameraTopicComp) + depthCameraTopic = depthCameraTopicComp->Data(); } if (_ecm.EntityHasComponentType(sensor, components::ContactSensor::typeId)) @@ -558,16 +563,6 @@ void OpticalTactilePluginPrivate::Load(const EntityComponentManager &_ecm) } // Store depth camera update rate - if (!depthCameraSdf.Element()->HasElement("update_rate")) - { - if (!this->initErrorPrinted) - { - gzerr << "Depth camera should have an value " - << "(only printed once)" << std::endl; - this->initErrorPrinted = true; - } - return; - } this->cameraUpdateRate = depthCameraSdf.UpdateRate(); // Depth camera data is float, so convert Pose3d to Pose3f @@ -581,20 +576,27 @@ void OpticalTactilePluginPrivate::Load(const EntityComponentManager &_ecm) depthCameraPose.Data().Rot().Z()); // Configure subscriber for depth camera images - if (!depthCameraSdf.Element()->HasElement("topic")) + if (depthCameraTopic.empty()) { - gzwarn << "Depth camera publishing to __default__ topic. " - << "It's possible that two depth cameras are publishing into the same " - << "topic" << std::endl; + // get the topic from sdf if the one in sensor topic component is empty + depthCameraTopic = depthCameraSdf.Topic(); } - else + + if (depthCameraTopic.empty()) { - gzdbg << "Depth camera publishing to " - << depthCameraSdf.Topic() << " topic" << std::endl; + if (!this->initErrorPrinted) + { + gzerr << "Depth camera topic is empty. " << std::endl; + this->initErrorPrinted = true; + } + return; } + gzdbg << "Depth camera publishing to " + << depthCameraTopic << " topic" << std::endl; + std::string topic = - "/" + depthCameraSdf.Topic() + "/points"; + "/" + depthCameraTopic + "/points"; if (!this->node.Subscribe(topic, &OpticalTactilePluginPrivate::DepthCameraCallback, this)) { diff --git a/src/systems/physics/Physics.cc b/src/systems/physics/Physics.cc index 7038e2e143..6a2f3eda79 100644 --- a/src/systems/physics/Physics.cc +++ b/src/systems/physics/Physics.cc @@ -851,8 +851,8 @@ void Physics::Configure(const Entity &_entity, physics::FeaturePolicy3d>>(); if (classNames.empty()) { - gzerr << "No physics plugins found in library [" << pathToLib << "]." - << std::endl; + gzerr << "No physics plugins implementing required interface found in " + << "library [" << pathToLib << "]." << std::endl; return; } diff --git a/test/integration/log_system.cc b/test/integration/log_system.cc index f867ca731a..a2335cae56 100644 --- a/test/integration/log_system.cc +++ b/test/integration/log_system.cc @@ -774,6 +774,18 @@ TEST_F(LogSystemTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(RecordAndPlayback)) // Start server Server playServer(playServerConfig); + // Simulate a client + gz::transport::Node node; + std::atomic numMsgs = 0; + std::function mockClient = + [&](const msgs::SerializedStepMap &/*_res*/) + { + numMsgs++; + }; + using namespace std::placeholders; + EXPECT_TRUE(node.Subscribe( + "/world/default/state", mockClient)); + // Callback function for entities played back // Compare current pose being played back with the pose from the stateMsg test::Relay playbackPoseTester; @@ -837,6 +849,9 @@ TEST_F(LogSystemTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(RecordAndPlayback)) // checked in the playbackPoseTester playServer.Run(true, 500, false); + // The client should have received some messages. + EXPECT_NE(numMsgs, 0); + // Count the total number of state messages in the log file int nTotal{0}; for (auto it = batch.begin(); it != batch.end(); ++it, ++nTotal) { } diff --git a/test/worlds/joint_trajectory_controller.sdf b/test/worlds/joint_trajectory_controller.sdf index e761ab49b2..78ae047a68 100644 --- a/test/worlds/joint_trajectory_controller.sdf +++ b/test/worlds/joint_trajectory_controller.sdf @@ -324,10 +324,10 @@ RR_velocity_control_link1 1 0 0 + + 0.02 + - - 0.02 - 0 0 0.1 0 0 0 @@ -335,10 +335,10 @@ RR_velocity_control_link2 1 0 0 + + 0.01 + - - 0.01 - - + + true @@ -65,7 +65,7 @@ model. You can find more information on the [SDF website](http://sdformat.org/). - + 1 1 0.009948450858321252 @@ -73,7 +73,7 @@ model. You can find more information on the [SDF website](http://sdformat.org/). - + 0.08 0 0.05 0 0 0 diff --git a/tutorials/files/lander/lander_visuals.png b/tutorials/files/lander/lander_visuals.png index af12dd03a4..51b08228f2 100644 Binary files a/tutorials/files/lander/lander_visuals.png and b/tutorials/files/lander/lander_visuals.png differ diff --git a/tutorials/files/particle_emitter/particle_emitter_scatter_effects.sdf b/tutorials/files/particle_emitter/particle_emitter_scatter_effects.sdf new file mode 100644 index 0000000000..4a1c8e666b --- /dev/null +++ b/tutorials/files/particle_emitter/particle_emitter_scatter_effects.sdf @@ -0,0 +1,309 @@ + + + + + + + 0.001 + 1.0 + + + + ogre2 + + + + + + + + + RGB camera + floating + 350 + 315 + + camera + false + + + + Depth camera + floating + 350 + 315 + 500 + + depth_camera + false + + + + RGBD: image + floating + 350 + 315 + 320 + + rgbd_camera/image + false + + + + RGBD: depth + floating + 350 + 315 + 500 + 320 + + rgbd_camera/depth_image + false + + + + Thermal camera + floating + 350 + 315 + 500 + 640 + + thermal_camera + false + + + + + + + + + true + 0 0 10 0 0 0 + 1 1 1 1 + 0.5 0.5 0.5 1 + + 1000 + 0.9 + 0.01 + 0.001 + + -0.5 0.1 -0.9 + + + + true + + + + + 0 0 1 + + + + + + + 0 0 1 + 100 100 + + + + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + + + + + + + https://fuel.gazebosim.org/1.0/openrobotics/models/fog generator + + + + 8 0 0.5 0 0.0 3.14 + + 0.05 0.05 0.05 0 0 0 + + 0.1 + + 0.000166667 + 0.000166667 + 0.000166667 + + + + + + 0.1 0.1 0.1 + + + + + + + 0.1 0.1 0.1 + + + + + + + 1.047 + + 320 + 240 + + + 0.1 + 100 + + + 1 + 30 + true + camera + + + + 10 + depth_camera + + 1.05 + + 320 + 240 + R_FLOAT32 + + + 0.1 + 100.0 + + + + + " + lidar + 10 + + + + 640 + 1 + -1.396263 + 1.396263 + + + 1 + 0.01 + 0 + 0 + + + + 0.08 + 10.0 + 0.01 + + + 1 + true + + + + true + + + + 8 0 0.5 0 0.0 3.14 + true + + 0.05 0.05 0.05 0 0 0 + + + + 0.1 0.1 0.1 + + + + + + + 0.1 0.1 0.1 + + + + + + 1.047 + + 320 + 240 + + + 0.1 + 100 + + + 1 + 30 + true + rgbd_camera + + + true + + + + 8 0 0.5 0 0.0 3.14 + true + + 0.05 0.05 0.05 0 0 0 + + + + 0.1 0.1 0.1 + + + + + + + 0.1 0.1 0.1 + + + + + + 1.047 + + 320 + 240 + + + 0.1 + 100 + + + 1 + 30 + true + thermal_camera + + + + + + 0 0 0 0 0 1.570796 + rescue_randy + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Rescue Randy + + + + diff --git a/tutorials/files/point_cloud_to_mesh/blob2.jpg b/tutorials/files/point_cloud_to_mesh/blob2.jpg new file mode 100644 index 0000000000..b78a854313 Binary files /dev/null and b/tutorials/files/point_cloud_to_mesh/blob2.jpg differ diff --git a/tutorials/files/point_cloud_to_mesh/blob2.png b/tutorials/files/point_cloud_to_mesh/blob2.png deleted file mode 100644 index 47c23cbf9c..0000000000 Binary files a/tutorials/files/point_cloud_to_mesh/blob2.png and /dev/null differ diff --git a/tutorials/files/point_cloud_to_mesh/error.jpg b/tutorials/files/point_cloud_to_mesh/error.jpg new file mode 100644 index 0000000000..f1d57861cd Binary files /dev/null and b/tutorials/files/point_cloud_to_mesh/error.jpg differ diff --git a/tutorials/files/point_cloud_to_mesh/hidden_polygons2.jpg b/tutorials/files/point_cloud_to_mesh/hidden_polygons2.jpg new file mode 100644 index 0000000000..584a98976b Binary files /dev/null and b/tutorials/files/point_cloud_to_mesh/hidden_polygons2.jpg differ diff --git a/tutorials/files/point_cloud_to_mesh/hidden_polygons2.png b/tutorials/files/point_cloud_to_mesh/hidden_polygons2.png deleted file mode 100644 index 6dfa068610..0000000000 Binary files a/tutorials/files/point_cloud_to_mesh/hidden_polygons2.png and /dev/null differ diff --git a/tutorials/files/point_cloud_to_mesh/min_space.jpg b/tutorials/files/point_cloud_to_mesh/min_space.jpg new file mode 100644 index 0000000000..e19615659b Binary files /dev/null and b/tutorials/files/point_cloud_to_mesh/min_space.jpg differ diff --git a/tutorials/files/point_cloud_to_mesh/min_space.png b/tutorials/files/point_cloud_to_mesh/min_space.png deleted file mode 100644 index 183a67b119..0000000000 Binary files a/tutorials/files/point_cloud_to_mesh/min_space.png and /dev/null differ diff --git a/tutorials/files/shadow_texture_size/shadow_texsize_2k_to_16k.gif b/tutorials/files/shadow_texture_size/shadow_texsize_2k_to_16k.gif new file mode 100644 index 0000000000..09cfabbea8 Binary files /dev/null and b/tutorials/files/shadow_texture_size/shadow_texsize_2k_to_16k.gif differ diff --git a/tutorials/headless_rendering.md b/tutorials/headless_rendering.md index 6c01ef756d..787755da47 100644 --- a/tutorials/headless_rendering.md +++ b/tutorials/headless_rendering.md @@ -13,7 +13,7 @@ An easier solution is through the use of [EGL](https://www.khronos.org/egl), whi Example usage: ``` -gz sim -v 4 -s --headless-rendering sensors_demo.sdf +DISPLAY= gz sim -v 4 -s -r --headless-rendering sensors_demo.sdf ``` If you are using Gazebo as a library, then you can configure the @@ -63,14 +63,23 @@ here](https://www.ogre3d.org/2021/02/06/ogre-2-2-5-cerberus-released-and-egl-hea ``` sudo reboot ``` -11. [Install Gazebo](https://gazebosim.org/docs/latest/install). -12. Run a Gazebo world that uses OGRE2 with camera sensors using headless rendering. This will enable EGL. +15. [Install Gazebo](https://gazebosim.org/docs/latest/install). +16. Run a Gazebo world that uses OGRE2 with camera sensors using headless rendering. This will enable EGL. ``` - gz sim -v 4 -s -r --headless-rendering sensors_demo.sdf + DISPLAY= gz sim -v 4 -s -r --headless-rendering sensors_demo.sdf ``` -13. Check that simulation is producing sensor data by ssh'ing into the EC2 - instance from a new terminal and echoing a sensor topic. +17. Check that simulation is producing sensor data by ssh'ing into the EC2 + instance from a new terminal and testing the frequency of a sensor topic. ``` ssh -i SSH_PEM_FILE_USED_DURING_LAUNCH ubuntu@EC_INSTANCE_PUBLIC_IP - gz topic -et /thermal_camera + gz topic -ft /thermal_camera + ``` +18. To verify that the EGL backend was used, try the following command: + ``` + grep -R "EGL Subsystem" ~/.gz/rendering/ogre2.log + ``` + Its output should not be empty, e.g.: + ``` + *** Starting EGL Subsystem *** + *** Stopping EGL Subsystem *** ``` diff --git a/tutorials/install.md b/tutorials/install.md index db06f13db2..7ecadbfd3c 100644 --- a/tutorials/install.md +++ b/tutorials/install.md @@ -1,7 +1,8 @@ \page install Installation -These instructions are for installing only Gazebo. If you're interested -in using all the Gazebo libraries, not only Igniton Gazebo, check out this +These instructions are for installing only Gazebo Sim. If you're interested +in using all the Gazebo libraries including gz-launch, or to install all +libraries from source, check out [Gazebo installation](https://gazebosim.org/docs/latest/install). We recommend following the binary install instructions to get up and running as @@ -50,6 +51,27 @@ installing Gazebo from source. brew install gz-sim<#> ``` +### Windows + +1. First, follow the steps 1-4 of [Gazebo source install](https://gazebosim.org/docs/ionic/install_windows_src/#install-dependencies) + tutorial to install Conda, Visual Studio and set up a Conda environment (we'll call it `gz-ws`). + + Do not forget to activate the Conda env (if not already activated) + inside the Visual Studio Command Prompt: + + ``` + conda activate gz-ws + ``` + +2. Now install Gazebo. + + ``` + conda install gz-sim<#> --channel conda-forge + ``` + + Be sure to replace `<#>` with a number value, such as 8 or 9, depending on + which version you need. + ## Source Install Install from source if you're interested in changing the source code or need a @@ -115,6 +137,50 @@ feature which hasn't been released yet. sudo make install ``` +### Windows + +1. First, follow the steps 1-4 of [Gazebo source install](https://gazebosim.org/docs/ionic/install_windows_src/#install-dependencies) + tutorial to install Conda, Visual Studio and set up a Conda environment (we'll call it `gz-ws`). + + Do not forget to activate the Conda env (if not already activated) + inside the Visual Studio Command Prompt: + + ``` + conda activate gz-ws + ``` + +2. Install Gazebo dependencies: + + You can view available versions and their dependencies: + ``` + conda search libgz-sim* --channel conda-forge --info + ``` + + Install the dependencies, replacing `<#>` with the required versions: + ``` + conda install gz-cmake<#> gz-common<#> gz-fuel-tools<#> gz-gui<#> gz-math<#> gz-msgs<#> gz-physics<#> gz-plugin<#> gz-rendering<#> gz-sensors<#> gz-tools<#> gz-transport<#> gz-utils<#> sdformat<#> --channel conda-forge + ``` + +3. Navigate to where you would like to build the library, and clone the repository. + ``` + # Optionally, append `-b gz-sim#` (replace # with a number) to check out a specific version + git clone https://github.com/gazebosim/gz-sim.git + ``` + +4. Configure and build + ``` + cd gz-sim + mkdir build + cd build + cmake .. -DBUILD_TESTING=OFF # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\install + cmake --build . --config Release + ``` + +5. Optionally, install + ``` + cmake --install . --config Release + ``` + ## Documentation API documentation and tutorials can be accessed at [https://gazebosim.org/libs/gazebo](https://gazebosim.org/libs/gazebo) @@ -123,7 +189,10 @@ You can also generate the documentation from a clone of this repository by follo 1. You will need [Doxygen](http://www.doxygen.org/). On Ubuntu Doxygen can be installed using ``` + # Linux sudo apt-get install doxygen + # Windows + conda install doxygen --channel conda-forge ``` 2. Clone the repository @@ -137,7 +206,7 @@ You can also generate the documentation from a clone of this repository by follo mkdir build cd build cmake ../ - make doc + cmake --build . --target doc ``` 4. View the documentation by running the following command from the `build` directory. diff --git a/tutorials/joint_controller.md b/tutorials/joint_controller.md index f677794f4d..ad01d53925 100644 --- a/tutorials/joint_controller.md +++ b/tutorials/joint_controller.md @@ -385,7 +385,7 @@ Let’s set up a new model for this example. A two-linked manipulator arm which - SDF file: ```xml - @@ -653,7 +653,7 @@ gz topic -t "topic_name" -m gz.msgs.JointTrajectory -p ' sec: 1 nsec: 0 } - } + }' ```
diff --git a/tutorials/lander.md b/tutorials/lander.md index 184f17be44..3c1552ebfe 100644 --- a/tutorials/lander.md +++ b/tutorials/lander.md @@ -37,7 +37,7 @@ mkdir -p ~/gazebo_maritime/models/my_lander && cd ~/gazebo_maritime/models/my_la Download the `model.config` file and copy it within that directory: ```bash -wget https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim8/tutorials/files/lander/model.config -O ~/gazebo_maritime/models/my_lander/model.config +wget https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim9/tutorials/files/lander/model.config -O ~/gazebo_maritime/models/my_lander/model.config ``` In its simple version, the lander does not have any moving pieces, so the SDF @@ -95,7 +95,7 @@ Let's now add nicer-looking visuals to our lander. Download the following ```bash mkdir ~/gazebo_maritime/models/my_lander/meshes -wget https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim8/tutorials/files/lander/inkfish-lander.dae -O ~/gazebo_maritime/models/my_lander/meshes/inkfish-lander.dae +wget https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim9/tutorials/files/lander/inkfish-lander.dae -O ~/gazebo_maritime/models/my_lander/meshes/inkfish-lander.dae ``` Replace the `chassis_visual` element in your `model.sdf` with the following @@ -114,7 +114,7 @@ block: And launch Gazebo to see the results: ```bash -gz sim ~/my_models/my_lander/model.sdf +gz sim ~/gazebo_maritime/models/my_lander/model.sdf ``` Your box should now be replaced with a better looking mesh. @@ -153,7 +153,7 @@ Let's start with the world. Download the following world: ```bash mkdir -p ~/gazebo_maritime/worlds -wget https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim8/tutorials/files/lander/buoyant_lander.sdf -O ~/gazebo_maritime/worlds/buoyant_lander.sdf +wget https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim9/tutorials/files/lander/buoyant_lander.sdf -O ~/gazebo_maritime/worlds/buoyant_lander.sdf export GZ_SIM_RESOURCE_PATH=:$HOME/gazebo_maritime/models ``` diff --git a/tutorials/migration_plugins.md b/tutorials/migration_plugins.md index bad1919e6f..a134f796e8 100644 --- a/tutorials/migration_plugins.md +++ b/tutorials/migration_plugins.md @@ -1,7 +1,7 @@ \page migrationplugins Migration from Gazebo Classic: Plugins Gazebo Classic supports -[6 different C++ plugin types](http://gazebosim.org/tutorials?tut=plugins_hello_world&cat=write_plugin), +[6 different C++ plugin types](https://classic.gazebosim.org/tutorials?tut=plugins_hello_world#PluginTypes), each providing access to different parts of the API, like physics, rendering, sensors, GUI, etc. Due to Gazebo Sim's architecture based on an [ECS](https://en.wikipedia.org/wiki/Entity_component_system) diff --git a/tutorials/migration_sdf.md b/tutorials/migration_sdf.md index 37a6a444c0..a9ae0008db 100644 --- a/tutorials/migration_sdf.md +++ b/tutorials/migration_sdf.md @@ -250,7 +250,7 @@ side-by-side on the same file. Instead, keep separate files and inject the plugi needed. There isn't a built-in mechanism on SDFormat to inject plugins into files yet, -but users can make use of templating tools like [ERB](erb_template.html) +but users can make use of templating tools like [ERB](https://github.com/gazebosim/gz-sim/blob/gz-sim9/tutorials/erb_template.md) and [xacro](http://wiki.ros.org/xacro) to generate SDF files with the correct plugins. ### Default plugins @@ -260,8 +260,8 @@ For example, by default, Gazebo will load all the system plugins defined on the `~/.gz/sim/<#>/server.config` file and all GUI plugins defined on the `~/.gz/sim/<#>/gui.config` file. But the user can always remove plugins from those files, or choose different ones by adding `` tags to the SDF file. -(For more details, see the [Server configuration tutorial](server_config.html) -and the [GUI configuration tutorial](gui_config.html)). +(For more details, see the [Server configuration tutorial](https://github.com/gazebosim/gz-sim/blob/gz-sim9/tutorials/server_config.md) +and the [GUI configuration tutorial](https://github.com/gazebosim/gz-sim/blob/gz-sim9/tutorials/gui_config.md)). This is important to keep in mind when migrating your SDF files, because files that worked on Gazebo classic may need more plugins on Gazebo. diff --git a/tutorials/model_photo_shoot.md b/tutorials/model_photo_shoot.md index f3ce372c9c..0730e337a1 100644 --- a/tutorials/model_photo_shoot.md +++ b/tutorials/model_photo_shoot.md @@ -37,7 +37,7 @@ contains a good example of the different options and other related plugins: filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors"> ogre2 - 1, 1, 1 + 1.0, 1.0, 1.0 ``` A render plugin is needed to render the image. If `ogre2` is used, as shown in @@ -53,7 +53,7 @@ contains a good example of the different options and other related plugins: filename="gz-sim-model-photo-shoot-system" name="gz::sim::systems::ModelPhotoShoot"> poses.txt - true + false ``` diff --git a/tutorials/move_camera_to_model.md b/tutorials/move_camera_to_model.md index 0ba5287eeb..8b6eac8172 100644 --- a/tutorials/move_camera_to_model.md +++ b/tutorials/move_camera_to_model.md @@ -7,7 +7,7 @@ This tutorial gives an introduction to Gazebo's service `/gui/move_to/model`. Th 1. Load the **View Angle** plugin. This service is only available when the **View Angle** plugin is loaded. 2. Call the service using the request message type `gz.msgs.GUICamera` and the response message type `gz.msgs.Boolean`. The distance to the object is defined as the z coordinate, and the direction of the camera with a quaternion. It's possible to select the projection type. -For example, Let's move the camera to the `box` model looking down from 5 meters away. +For example, Let's move the camera to the `box` model looking down from 5 meters away. This example uses the `shapes.sdf` world. ```bash gz service -s /gui/move_to/model --reqtype gz.msgs.GUICamera --reptype gz.msgs.Boolean -r 'name: "box", pose: {position: {z:5}, orientation: {x:0, y:0, z: -1, w:0}}, projection_type: "orbit"' --timeout 5000 diff --git a/tutorials/particle_tutorial.md b/tutorials/particle_tutorial.md index c0c37e73b5..7150027684 100644 --- a/tutorials/particle_tutorial.md +++ b/tutorials/particle_tutorial.md @@ -97,7 +97,18 @@ The particles are not only a visual effect in simulation, they also have an effe * `gpu_lidar`: The particles have a scattering effect on the lidar range readings. * `thermal_camera`: The particles are not visible in the thermal camera image. -The gif below shows an [example world](https://gist.github.com/iche033/bcd3b7d3f4874e1e707e392d6dbb0aa0) with six different sensors looking at the fog generator with a rescue randy model inside the fog. + +The [particle_emitter_scatter_effects.sdf](https://github.com/gazebosim/gz-sim/blob/gz-sim9/tutorials/files/particle_emitter/particle_emitter_scatter_effects.sdf) +demo world shows six different sensors looking at the fog generator with a rescue randy model inside the fog. + +Download the example world file and launch it to see what it looks like. + +```bash +gz sim -v 4 -r particle_emitter_scatter_effects.sdf +``` + +Navigate to the Visualize Lidar plugin on the right and click on the refresh button to set the lidar topic. You should see the sensor images and lidar visualization like below: + @image html files/particle_emitter/sensor_scatter_tutorial.gif diff --git a/tutorials/physics.md b/tutorials/physics.md index b4a94c7d1e..1099560f5a 100644 --- a/tutorials/physics.md +++ b/tutorials/physics.md @@ -10,7 +10,7 @@ by default. Downstream developers may also integrate other physics engines by creating new Gazebo Physics engine plugins. See -[Gazebo Physics](https://gazebosim.org/api/physics/7/tutorials.html)'s +[Gazebo Physics](https://gazebosim.org/api/physics/8/tutorials.html)'s tutorials to learn how to integrate a new engine. ## How Gazebo finds engines @@ -25,24 +25,32 @@ If you've created a custom engine plugin, you can tell Gazebo where to find it by setting the `GZ_SIM_PHYSICS_ENGINE_PATH` environment variable to the directory where the plugin's shared library can be found. -For example, if you've created the following physics engine shared library on -Linux: +For example, if you've created the following physics engine shared library: ``` +# Linux /home/physics_engines/libCustomEngine.so +# Windows +C:\Users\Robot\physics_engines\CustomEngine.dll ``` You should set the variable as follows: ``` +# Linux export GZ_SIM_PHYSICS_ENGINE_PATH=/home/physics_engines +# Windows +set GZ_SIM_PHYSICS_ENGINE_PATH=C:\Users\Robot\physics_engines ``` If you have several libraries installed in different paths, you can add more paths, for example: ``` +# Linux, separate with : export GZ_SIM_PHYSICS_ENGINE_PATH=/home/physics_engines:/home/more_engines +# Windows, separate with ; +set GZ_SIM_PHYSICS_ENGINE_PATH=C:\Users\Robot\physics_engines;C:\MoreEngines ``` ## Tell Gazebo what engine to load @@ -52,6 +60,7 @@ There are a few different ways of telling Gazebo which engine to load. For any method, you should provide the name of your plugin's shared library, but the `lib` prefix and the file extension are optional. So in this example, the file is `libCustomEngine.so` but it's enough to set `CustomEngine`. +That is also prefered to support multiple operating systems. ### From SDF @@ -103,10 +112,10 @@ Gazebo supports the following physics engine configurations through SDF. These options are available to all physics engines, but not all engines may support them. The default physics engine, DART, supports all these options. -* [//physics/dart/collision_detector](http://sdformat.org/spec?ver=1.8&elem=physics#dart_collision_detector) +* [//physics/dart/collision_detector](http://sdformat.org/spec?ver=1.11&elem=physics#dart_collision_detector) * Options supported by DART: `ode` (default), `bullet`, `fcl`, `dart`. -* [//physics/dart/solver/solver_type](http://sdformat.org/spec?ver=1.8&elem=physics#solver_solver_type) +* [//physics/dart/solver/solver_type](http://sdformat.org/spec?ver=1.11&elem=physics#solver_solver_type) * Options supported by DART: `dantzig` (default), `pgs` ## Troubleshooting @@ -114,12 +123,12 @@ may support them. The default physics engine, DART, supports all these options. > Failed to find plugin [libCustomEngine.so]. Have you checked the > GZ_SIM_PHYSICS_ENGINE_PATH environment variable? -Gazebo can't find out where `libCustomEngine.so` is located. +Gazebo can't find out where `libCustomEngine.so` or `CustomEngine.dll` is located. If that's an engine you believe should be installed with Gazebo Physics, check if the relevant plugin is installed. -If that's a 3rd party engine, find where the `.so` file is installed and add +If that's a 3rd party engine, find where the `.so` or `.dll` file is installed and add that path to the environment variable as described above. > Unable to load the [/home/physics_engines/libCustomEngine.so] library. @@ -127,6 +136,12 @@ that path to the environment variable as described above. There was some problem loading that file. Check that it exists, that you have permissions to access it, and that it's acually a physics engine plugin. +> No physics plugins implementing required interface found in library +> [/home/physics_engines/libCustomEngine.so] + +The library was found but none of the plugins in the library implement the +required interface to be considered a physics plugin. + > No plugins with all required features found in library > [/home/physics_engines/libCustomEngine.so] diff --git a/tutorials/point_cloud_to_mesh.md b/tutorials/point_cloud_to_mesh.md index d0628d8f66..04d710013c 100644 --- a/tutorials/point_cloud_to_mesh.md +++ b/tutorials/point_cloud_to_mesh.md @@ -13,6 +13,7 @@ Next, you’ll need to download CloudCompare. This is the software we will be using to convert our point cloud to a mesh. CloudCompare is free and open source. You can download it [here](http://www.danielgm.net/cc/release/). +This tutorial was created using CloudCompare 1.13.2. ## Converting with CloudCompare @@ -20,7 +21,7 @@ After installing, open CloudCompare and import your point cloud file by going to Depending on the number of points in your point cloud, this could take several minutes. Once loaded, you should see the following tunnel section: -![Opening the point cloud](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/cloudcompare2.png) +\image html files/point_cloud_to_mesh/cloudcompare2.png Many 3D scans will be composed of millions, sometimes hundreds of millions of points. Converting a scan to a 3D model with that many points would be very difficult due to the number of polygons that would be created and the long processing time necessary to compute the normals. @@ -34,13 +35,13 @@ We'll still walk through reducing points, however, to make the process quicker. To reduce the number of points in your cloud, click on the tunnel so a yellow cube outline appears around it, then go to `Edit` > `Subsample`. -![Min. space between points](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/min_space.png) +\image html files/point_cloud_to_mesh/min_space.jpg The number you will need to enter in the `min. space between points` field will vary depending on your point cloud. A value of .01 was sufficient to bring our point cloud to an easy-to-manage 1 million points. Point count is visible in the `Properties` window on the lower left side of the screen. -![Point count of subsample](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/properties.png) +\image html files/point_cloud_to_mesh/properties.png How many points you reduce down to will largely depend on how long you are willing to wait for the point cloud to be converted into a mesh. The more points you start with, the longer it will take to compute the normals and create the mesh. @@ -48,7 +49,7 @@ The more points you start with, the longer it will take to compute the normals a After the operation is complete you’ll have two clouds in your scene: the original point cloud and your subsampled point cloud. Most operations in CloudCompare will create new point clouds and keep the original, so make sure that you have the new point cloud selected before running an operation. -![Selecting the new point cloud](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/secondcloud.png) +\image html files/point_cloud_to_mesh/secondcloud.png ### Create a Polygonal Mesh @@ -59,7 +60,7 @@ A normal is essentially the direction a polygon is facing. To do this, go to `Edit` > `Normals` > `Compute`. You'll see this dialog box: -![Choose Triangulation surface model](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/compute_normals.png) +\image html files/point_cloud_to_mesh/compute_normals.png You’ll see various options in the dialog box that appears. The main thing you’ll want to consider is what `Local surface model` to use. @@ -72,7 +73,7 @@ Now we get to actually convert our point cloud to a mesh. To do this go to `Plugins` > `PoissonRecon`. You'll see this dialog box: -![Octree depth and output density selection](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/outputdensity.png) +\image html files/point_cloud_to_mesh/outputdensity.png The value you enter in the `Octree depth` field will determine the polygon count of the created model. You may have to run the surface reconstruction a couple times with varying values before you land on a polygon count that is suitable for your needs. @@ -93,18 +94,18 @@ Our tunnel has turned into a blob shape. This is because the mesh that CloudCompare creates will always be water tight even if it has to add polygons where there are no points. We just want our tunnels, though, so we need to remove those unnecessary polygons. -![The blob shape](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/blob2.png) +\image html files/point_cloud_to_mesh/blob2.jpg This is where our scalar field comes in. In the mesh's `Properties` window go to `SF display params` and take the left handle in the graph and drag it to the right until it hits the area where the bulk of the scalar field starts. -![Adjusting scalar filed params](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/sf_display.png) +\image html files/point_cloud_to_mesh/sf_display.png This will display only the polygons that were created from the point cloud and hide the polygons used to make the model watertight. The polygons are only hidden however. We still need to actually remove them. -![Display original polygons](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/hidden_polygons2.png) +\image html files/point_cloud_to_mesh/hidden_polygons2.jpg To remove the hidden polygons go to `Edit` > `Scalar fields` > `Filter By Value`. @@ -113,7 +114,11 @@ Hitting export will simply export the mesh within that range. Instead, we'll hit `Split` to create two meshes. One with the polygons inside our specified range and one containing polygons outside that range. -![Splitting the mesh](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/split.png) +\image html files/point_cloud_to_mesh/split.png + +It is possible that you will get error "Visibility table not instantiated". This error causes only the "wanted" part of the mesh to be created when splitting, while the other ("unwanted") part will not be generated. But that is not a problem for our use-case. + +\image html files/point_cloud_to_mesh/error.jpg ### The Completed Model @@ -121,6 +126,8 @@ By hitting `Split` we can view the model before exporting by simply going to `Fi Remember to have the correct mesh selected (`.part`) since choosing `Split` will give you two new meshes, plus you will still have your original, complete mesh. Your file format will depend on the software you want to use but `.obj` is a widely supported format that should work in most 3D applications. -![The completed mesh](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/point_cloud_to_mesh/complete2.png) +Before exporting, check your mesh for holes. If still checked, disable display of the pointcloud, so that only your output mesh is shown. Inspect ground parts of the mesh (or any other parts you are most interested in) and check if there aren't holes in it. If there are some, you can try to repeat the trimming step with more relaxed threshold. + +\image html files/point_cloud_to_mesh/complete2.png You can find more information on CloudCompare and a more in depth look at the tools we used in this tutorial on [the CloudCompare website](https://www.cloudcompare.org/) and the [CloudCompare wiki](https://www.cloudcompare.org/doc/wiki/index.php?title=Main_Page). diff --git a/tutorials/shadow_texture_size.md b/tutorials/shadow_texture_size.md new file mode 100644 index 0000000000..b117370deb --- /dev/null +++ b/tutorials/shadow_texture_size.md @@ -0,0 +1,118 @@ +\page shadow_texture_size Shadow Texture Size + +This tutorial showcases how to change the texture size of shadows casted by lights. + +
+ \image html files/shadow_texture_size/shadow_texsize_2k_to_16k.gif width=60% +
+ +## Texture size options + +Supported texture sizes include: 512px, 1024px, 2048px, 4096px, 8192px, 16384px. + +The default shadow texture size for all lights is 2K. The default max texture size is 16K, but for less powerful computers, it may be a lower value, like 8K. + +## Changing shadow texture size + +The shadow texture size can be changed for the GUI with the usage of the Minimal Scene GUI plugin in the SDF. + +Currently, light type is restricted to only directional light. As a scene should typically have at most one directional light (representing the sun), this will ensure that an increase in shadow texture size does not increase VRAM too much. + +### Example usage for the GUI + +Let's change the shadow texture size for directional light with the SDF file below. (The finished SDF file can be viewed [here](https://github.com/gazebosim/gz-sim/tree/gz-sim9/examples/worlds/shadow_texture_size.sdf).) + +1) Save the below in an SDF file named `shadow_texture_size.sdf`: + +```xml + + + + + 0.1 0.1 0.1 + 0.0 0.0 0.0 + + + + + + ogre2 + -10 0 7 0 0.5 0 + + + + + + + + + 0 0 8 0 0 0 + 1 1 1 1 + 0 0 0 0 + + 50 + 0 + 0 + 0 + + true + -2 2 -1.5 + 1.0 + + + + + 0 0 0 0 0 -1.57 + + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Garden Mascot + + + + + -5 0 -0.5 0 0 0 + true + + + + + 15 15 1 + + + + + + + 15 15 1 + + + + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + + + + + + +``` + +2) Add the following lines to the Minimal Scene GUI plugin. + +```xml + + 8192 + +``` + +The `` value can be changed as per the Texture size options section. + +3) Open the `shadow_texsize_demo.sdf` world with + +```bash +gz sim shadow_texture_size.sdf +``` + +## Impact on VRAM usage + +Keep in mind that the larger the shadow texture size, the more VRAM is used. Thus, in a scene populated with many lights, changing the directional light's shadow texture size should be fine because there is typically only one directional light in a scene. But if the scene has many point lights and the point light's shadow texture size is increased, the VRAM consumption goes up significantly. diff --git a/tutorials/terminology.md b/tutorials/terminology.md index 7103fee7ec..ec0391475b 100644 --- a/tutorials/terminology.md +++ b/tutorials/terminology.md @@ -26,7 +26,7 @@ to developers touching the source code. * **System**: Logic that operates on all entities that have a given set of components. Systems are plugins that can be loaded at runtime. - Gazebo ships with various systems, and downstream develpers can + Gazebo ships with various systems, and downstream developers can [create their own systems](createsystemplugins.html). * **Entity-component manager** (**ECM**): Provides functions for diff --git a/tutorials/video_recorder.md b/tutorials/video_recorder.md index efea6422c2..432bd94f21 100644 --- a/tutorials/video_recorder.md +++ b/tutorials/video_recorder.md @@ -13,12 +13,18 @@ Gazebo that already has this plugin included in the GUI. gz sim -v 4 video_record_dbl_pendulum.sdf ``` -In this demo world, you should see a video recorder icon positioned on the top. +In this demo world, you should see a video recorder icon positioned on the top left area of the window along with other buttons. Clicking on the video recorder button gives you the video format options that are available. @image html files/video_recorder/video_recorder.png +> **NOTE** +> The OGV format might not be supported by the underlying libavcodec implementation. +> This is especially true on Windows with the conda-installed dependencies. +> There is no easy way to add the VP8 codec support except for building +> libavcodec manually and enabling the support. + Once an option is selected, recording starts immediately as indicated by a flashing video recorder icon. At anytime that you wish to stop recording, click on the flashing icon and select `Stop`. A file dialog window should pop up @@ -107,5 +113,5 @@ generated video. The default bitrate is 2Mbps. Since Gazebo Common 3.10.2, there is support for utilizing the power of GPUs to speed up the video encoding process. See the -[Hardware-accelerated Video Encoding tutorial](https://gazebosim.org/api/common/5/hw-encoding.html) +[Hardware-accelerated Video Encoding tutorial](https://gazebosim.org/api/common/6/hw-encoding.html) for more details.