Skip to content

Commit

Permalink
Merge branch 'main' into link_reset_components
Browse files Browse the repository at this point in the history
  • Loading branch information
scpeters authored Aug 14, 2024
2 parents 4477f77 + 6595a52 commit 8c9c46f
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 92 deletions.
56 changes: 56 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,62 @@

## Gazebo Sim 8.x

### Gazebo Sim 8.6.0 (2024-07-25)

1. Fix error resolving gazebo classic material when loading world
* [Pull request #2492](https://github.com/gazebosim/gz-sim/pull/2492)

1. Remove systems if their parent entity is removed
* [Pull request #2232](https://github.com/gazebosim/gz-sim/pull/2232)

1. Fix warnings generated by NetworkConfigTest
* [Pull request #2469](https://github.com/gazebosim/gz-sim/pull/2469)

1. Fix lidar visualization when `gz_frame_id` is specified
* [Pull request #2481](https://github.com/gazebosim/gz-sim/pull/2481)

1. Backport convex decomposition visualization
* [Pull request #2454](https://github.com/gazebosim/gz-sim/pull/2454)

1. Add UserCommands plugin to GPU lidar sensor example
* [Pull request #2479](https://github.com/gazebosim/gz-sim/pull/2479)

1. Check if any entity actually has a ContactSensorData component before calling GetContactsFromLastStep
* [Pull request #2474](https://github.com/gazebosim/gz-sim/pull/2474)

1. Enable tests on macOS
* [Pull request #2468](https://github.com/gazebosim/gz-sim/pull/2468)

1. Update description of reset_sensors test
* [Pull request #2467](https://github.com/gazebosim/gz-sim/pull/2467)

1. Magnetometer: correct field calculation
* [Pull request #2460](https://github.com/gazebosim/gz-sim/pull/2460)

1. Address a couple of todos in Conversion.cc
* [Pull request #2461](https://github.com/gazebosim/gz-sim/pull/2461)

1. Correct name of sensor in warning message
* [Pull request #2457](https://github.com/gazebosim/gz-sim/pull/2457)

1. Set max contacts for collision pairs
* [Pull request #2270](https://github.com/gazebosim/gz-sim/pull/2270)

1. Add GravityEnabled boolean component
* [Pull request #2451](https://github.com/gazebosim/gz-sim/pull/2451)

1. Add support for no gravity link
* [Pull request #2398](https://github.com/gazebosim/gz-sim/pull/2398)

1. Handle sdf::Geometry::EMPTY in conversions
* [Pull request #2430](https://github.com/gazebosim/gz-sim/pull/2430)

1. Use topicFromScopedName in a few systems
* [Pull request #2427](https://github.com/gazebosim/gz-sim/pull/2427)

1. Fix typo in a comment
* [Pull request #2429](https://github.com/gazebosim/gz-sim/pull/2429)

### Gazebo Sim 8.5.0 (2024-06-26)

1. Backport: Adding cone primitives
Expand Down
8 changes: 4 additions & 4 deletions examples/plugin/gui_system_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This example shows how to create a GUI system plugin.

Gazebo supports any kind of Gazebo GUI plugin
(`gz::gui::Plugin`). Gazebo GUI plugins are a special type of Gazebo
GUI plugin which also have access to entity and component updates coming from
the server.
Gazebo supports any kind of GUI plugin
(`gz-gui` library: `gz::gui::Plugin`). However, GuiSystem plugins
(`gz-sim` library: `gz::sim::GuiSystem`) are a special type of GUI plugin,
which also have access to entity and component updates coming from the server.

See `GuiSystemPluginPlugin.hh` for more information.

Expand Down
4 changes: 4 additions & 0 deletions examples/worlds/gpu_lidar_sensor.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
filename="gz-sim-scene-broadcaster-system"
name="gz::sim::systems::SceneBroadcaster">
</plugin>
<plugin
filename="gz-sim-user-commands-system"
name="gz::sim::systems::UserCommands">
</plugin>

<light type="directional" name="sun">
<cast_shadows>true</cast_shadows>
Expand Down
4 changes: 3 additions & 1 deletion src/SdfEntityCreator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
#include "gz/sim/components/World.hh"

#include "rendering/MaterialParser/MaterialParser.hh"
#include "ServerPrivate.hh"

class gz::sim::SdfEntityCreatorPrivate
{
Expand Down Expand Up @@ -823,7 +824,8 @@ Entity SdfEntityCreator::CreateEntities(const sdf::Visual *_visual)
"https://gazebosim.org/api/sim/8/migrationsdf.html#:~:text=Materials " <<
"for details." << std::endl;
std::string scriptUri = visualMaterial.ScriptUri();
if (scriptUri != "file://media/materials/scripts/gazebo.material") {
if (scriptUri != ServerPrivate::kClassicMaterialScriptUri)
{
gzwarn << "Custom material scripts are not supported."
<< std::endl;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ Server::Server(const ServerConfig &_config)
// 'src/gui_main.cc'.
errors = sdfRoot.Load(filePath, sdfParserConfig);
if (errors.empty() || _config.BehaviorOnSdfErrors() !=
ServerConfig::SdfErrorBehavior::EXIT_IMMEDIATELY) {
ServerConfig::SdfErrorBehavior::EXIT_IMMEDIATELY)
{
if (sdfRoot.Model() == nullptr) {
this->dataPtr->sdfRoot = std::move(sdfRoot);
}
Expand Down
9 changes: 9 additions & 0 deletions src/ServerPrivate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
using namespace gz;
using namespace sim;

const char ServerPrivate::kClassicMaterialScriptUri[] =
"file://media/materials/scripts/gazebo.material";

/// \brief This struct provides access to the record plugin SDF string
struct LoggingPlugin
{
Expand Down Expand Up @@ -554,6 +557,12 @@ bool ServerPrivate::ResourcePathsResolveService(
//////////////////////////////////////////////////
std::string ServerPrivate::FetchResource(const std::string &_uri)
{
// Handle gazebo classic material URIs.
// Return original URI string as the SdfEntityCreator checks for this URI
if (_uri == kClassicMaterialScriptUri)
return _uri;

// Fetch resource from fuel
auto path =
fuel_tools::fetchResourceWithClient(_uri, *this->fuelClient.get());

Expand Down
5 changes: 5 additions & 0 deletions src/ServerPrivate.hh
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ namespace gz
/// Server. It is used in the SDFormat world generator when saving worlds
public: std::unordered_map<std::string, std::string> fuelUriMap;

/// \brief Gazebo classic material URI string
/// A URI matching this string indicates that it is a gazebo classic
/// material.
public: static const char kClassicMaterialScriptUri[];

/// \brief List of names for all worlds loaded in this server.
private: std::vector<std::string> worldNames;

Expand Down
2 changes: 1 addition & 1 deletion src/SimulationRunner.hh
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ namespace gz
private: std::unique_ptr<msgs::WorldControlState> newWorldControlState;

/// \brief Set if we need to remove systems due to entity removal
private: bool threadsNeedCleanUp;
private: bool threadsNeedCleanUp{false};

private: bool resetInitiated{false};
friend class LevelManager;
Expand Down
23 changes: 21 additions & 2 deletions src/SystemManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "gz/sim/components/SystemPluginInfo.hh"
#include "gz/sim/Conversions.hh"
#include "gz/sim/System.hh"
#include "gz/sim/Util.hh"
#include "SystemManager.hh"

using namespace gz;
Expand Down Expand Up @@ -358,6 +359,11 @@ bool SystemManager::EntitySystemAddService(const msgs::EntityPlugin_V &_req,
{
std::lock_guard<std::mutex> lock(this->systemsMsgMutex);
this->systemsToAdd.push_back(_req);

// The response is set to true to indicate that the service request is
// handled but it does not necessarily mean the system is added
// successfully
// \todo(iche033) Return false if system is not added successfully?
_res.set_data(true);
return true;
}
Expand Down Expand Up @@ -417,8 +423,21 @@ void SystemManager::ProcessPendingEntitySystems()

if (req.plugins().empty())
{
gzwarn << "Unable to add plugins to Entity: '" << entity
<< "'. No plugins specified." << std::endl;
gzerr << "Unable to add plugins to Entity: '" << entity
<< "'. No plugins specified." << std::endl;
continue;
}

// set to world entity if entity id is not specified in the request.
if (entity == kNullEntity || entity == 0u)
{
entity = worldEntity(*this->entityCompMgr);
}
// otherwise check if entity exists before attempting to load the plugin.
else if (!this->entityCompMgr->HasEntity(entity))
{
gzerr << "Unable to add plugins to Entity: '" << entity
<< "'. Entity does not exist." << std::endl;
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/plugins/resource_spawner/ResourceSpawner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ void ResourceSpawner::OnDownloadFuelResource(const QString &_path,
// Set the waiting cursor while the resource downloads
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
if (this->dataPtr->fuelClient->DownloadModel(
common::URI(_path.toStdString()), localPath))
common::URI(_path.toStdString(), true), localPath))
{
// Successful download, set thumbnail
std::string thumbnailPath = common::joinPaths(localPath, "thumbnails");
Expand Down Expand Up @@ -739,7 +739,7 @@ void ResourceSpawner::RunFetchResourceListThread(const std::string &_owner)
resource.isFuel = true;
resource.isDownloaded = false;
resource.owner = id.Owner();
resource.sdfPath = id.UniqueName();
resource.sdfPath = id.Url().Str();

QMetaObject::invokeMethod(
this, "UpdateOwnerListModel", Qt::QueuedConnection,
Expand Down
Loading

0 comments on commit 8c9c46f

Please sign in to comment.