Skip to content

Commit

Permalink
Forward port 3 to 6
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Koenig <natekoenig@gmail.com>
  • Loading branch information
nkoenig committed May 26, 2023
2 parents 1a18071 + a2a2c85 commit ce1e531
Show file tree
Hide file tree
Showing 993 changed files with 22,845 additions and 18,568 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ find_package(ignition-cmake2 2.12.0 REQUIRED)
#============================================================================
# Configure the project
#============================================================================
ign_configure_project(VERSION_SUFFIX)
ign_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/sim
VERSION_SUFFIX
)
set (CMAKE_CXX_STANDARD 17)

#============================================================================
Expand Down Expand Up @@ -97,7 +100,7 @@ set(IGN_FUEL_TOOLS_VER ${ignition-fuel_tools7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-gui
ign_find_package(ignition-gui6 REQUIRED VERSION 6.5)
ign_find_package(ignition-gui6 REQUIRED VERSION 6.8)
set(IGN_GUI_VER ${ignition-gui6_VERSION_MAJOR})
ign_find_package (Qt5
COMPONENTS
Expand Down
10 changes: 5 additions & 5 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,7 @@
1. Fix generation of systems library symlinks in build directory
* [Pull request #1160](https://github.com/gazebosim/gz-sim/pull/1160)

1. Backport gazebo::Util::validTopic() from ign-gazebo4.
1. Backport sim::Util::validTopic() from ign-gazebo4.
* [Pull request #1153](https://github.com/gazebosim/gz-sim/pull/1153)

1. Support setting the background color for sensors
Expand Down Expand Up @@ -2886,7 +2886,7 @@
* [Pull Request 351](https://github.com/gazebosim/gz-sim/pull/351)
* [Pull Request 362](https://github.com/gazebosim/gz-sim/pull/362)

1. Tests & Warnings: Qt 5.14, breadcrumbs, Gui, ign_TEST
1. Tests & Warnings: Qt 5.14, breadcrumbs, Gui, gz_TEST
* [Pull Request 327](https://github.com/gazebosim/gz-sim/pull/327)

1. Added support for specifying topics to record.
Expand Down Expand Up @@ -3031,7 +3031,7 @@
1. Enhanced log playback performance.
* [Pull Request 351](https://github.com/gazebosim/gz-sim/pull/351)

1. Tests & Warnings: Qt 5.14, breadcrumbs, Gui, ign_TEST
1. Tests & Warnings: Qt 5.14, breadcrumbs, Gui, gz_TEST
* [Pull Request 327](https://github.com/gazebosim/gz-sim/pull/327)

1. Added support for specifying topics to record.
Expand Down Expand Up @@ -3145,7 +3145,7 @@

### Ignition Gazebo 2.18.0 (2020-05-20)

1. Added a `/world/<world_name>/create_multiple` service that parallels the current `/world/<world_name>/create` service. The `create_multiple` service can handle an `ignition::msgs::EntityFactory_V` message that may contain one or more entities to spawn.
1. Added a `/world/<world_name>/create_multiple` service that parallels the current `/world/<world_name>/create` service. The `create_multiple` service can handle an `gz::msgs::EntityFactory_V` message that may contain one or more entities to spawn.
* [Pull Request 146](https://github.com/gazebosim/gz-sim/pull/146)

1. DetachableJoint system: Add option to suppress warning about missing child model
Expand Down Expand Up @@ -3562,7 +3562,7 @@
1. Update Camera and DepthCamera components to use sdf::Sensor object instead of an sdf::ElementPtr.
* [BitBucket pull request 299](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gazebo/pull-requests/299)

1. Added system for ignition::sensors::AirPressureSensor.
1. Added system for gz::sensors::AirPressureSensor.
* [BitBucket pull request 300](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gazebo/pull-requests/300)

1. Support conversion and serialization of Imu components. IMU sensors are
Expand Down
8 changes: 4 additions & 4 deletions api.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ designed to rapidly develop robot and simulation applications.

**Useful links**

1. ignition::gazebo::components : List of built-in Component types. Components represent data, such as position information, that can be added to an Entity.
2. ignition::gazebo::systems : List of available Systems. A System operates on Entities that have a specific set of Components.
3. ignition::gazebo::events : List of simulation events. See the
ignition::gazebo::EventManager for details about events and how to use them.
1. gz::sim::components : List of built-in Component types. Components represent data, such as position information, that can be added to an Entity.
2. gz::sim::systems : List of available Systems. A System operates on Entities that have a specific set of Components.
3. gz::sim::events : List of simulation events. See the
gz::sim::EventManager for details about events and how to use them.

## License

Expand Down
4 changes: 2 additions & 2 deletions examples/plugin/custom_component/CustomComponentPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
#include "CustomComponentPlugin.hh"

#include <ignition/plugin/Register.hh>
#include <gz/plugin/Register.hh>

IGNITION_ADD_PLUGIN(examples::CustomComponentPlugin,
ignition::gazebo::System,
gz::sim::System,
examples::CustomComponentPlugin::ISystemConfigure)

22 changes: 11 additions & 11 deletions examples/plugin/custom_component/CustomComponentPlugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,36 @@
#define EXAMPLES_PLUGINS_CUSTOMCOMPONENTPLUGIN_HH_

// This header provides components::Component
#include <ignition/gazebo/components/Component.hh>
#include <gz/sim/components/Component.hh>

// This header provides the registration macro
#include <ignition/gazebo/components/Factory.hh>
#include <gz/sim/components/Factory.hh>

#include <ignition/gazebo/System.hh>
#include <ignition/gazebo/config.hh>
#include <gz/sim/System.hh>
#include <gz/sim/config.hh>

namespace examples
{
// The most convenient way to create a component is to create a template alias
// of `components::Component` where the first argument is the type being wrapped
// (i.e. int) and the second is a unique name tag.
using CustomComponent =
ignition::gazebo::components::Component<int, class CustomComponentTag>;
gz::sim::components::Component<int, class CustomComponentTag>;

// Use this macro to register a component. Give it a unique name across the
// entire simulation.
IGN_GAZEBO_REGISTER_COMPONENT("examples::CustomComponent", CustomComponent)

class CustomComponentPlugin :
public ignition::gazebo::System,
public ignition::gazebo::ISystemConfigure
public gz::sim::System,
public gz::sim::ISystemConfigure
{
public: CustomComponentPlugin() = default;

public: void Configure(const ignition::gazebo::Entity &_entity,
public: void Configure(const gz::sim::Entity &_entity,
const std::shared_ptr<const sdf::Element> &,
ignition::gazebo::EntityComponentManager &_ecm,
ignition::gazebo::EventManager &) override
gz::sim::EntityComponentManager &_ecm,
gz::sim::EventManager &) override
{
// You can create the custom component as you would create any other
igndbg << "Creating component" << std::endl;
Expand All @@ -56,7 +56,7 @@ class CustomComponentPlugin :
// You can use the ECM's API, such as Each, to query for the
// component:
_ecm.Each<CustomComponent>(
[&](const ignition::gazebo::Entity &_entityEach,
[&](const gz::sim::Entity &_entityEach,
const CustomComponent *_comp) -> bool
{
igndbg << "Entity: " << _entityEach << std::endl;
Expand Down
26 changes: 13 additions & 13 deletions examples/plugin/gui_system_plugin/GuiSystemPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*
*/

#include <ignition/plugin/Register.hh>
#include <ignition/gazebo/components/Name.hh>
#include <ignition/gazebo/components/World.hh>
#include <ignition/gazebo/EntityComponentManager.hh>
#include <ignition/gazebo/gui/GuiEvents.hh>
#include <gz/plugin/Register.hh>
#include <gz/sim/components/Name.hh>
#include <gz/sim/components/World.hh>
#include <gz/sim/EntityComponentManager.hh>
#include <gz/sim/gui/GuiEvents.hh>

#include "GuiSystemPlugin.hh"

Expand All @@ -39,16 +39,16 @@ void GuiSystemPlugin::LoadConfig(const tinyxml2::XMLElement * /*_pluginElem*/)
}

//////////////////////////////////////////////////
void GuiSystemPlugin::Update(const ignition::gazebo::UpdateInfo & /*_info*/,
ignition::gazebo::EntityComponentManager &_ecm)
void GuiSystemPlugin::Update(const gz::sim::UpdateInfo & /*_info*/,
gz::sim::EntityComponentManager &_ecm)
{
// In the update loop, you can for example get the name of the world and set
// it as a property that can be read from the QML.
_ecm.Each<ignition::gazebo::components::Name,
ignition::gazebo::components::World>(
[&](const ignition::gazebo::Entity &_entity,
const ignition::gazebo::components::Name *_name,
const ignition::gazebo::components::World *)->bool
_ecm.Each<gz::sim::components::Name,
gz::sim::components::World>(
[&](const gz::sim::Entity &_entity,
const gz::sim::components::Name *_name,
const gz::sim::components::World *)->bool
{
this->SetCustomProperty(QString::fromStdString(_name->Data()));
return true;
Expand All @@ -70,4 +70,4 @@ void GuiSystemPlugin::SetCustomProperty(const QString &_customProperty)

// Register this plugin
IGNITION_ADD_PLUGIN(GuiSystemPlugin,
ignition::gui::Plugin)
gz::gui::Plugin)
14 changes: 7 additions & 7 deletions examples/plugin/gui_system_plugin/GuiSystemPlugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*
*/

#ifndef IGNITION_GAZEBO_GUISYSTEMPLUGIN_HH_
#define IGNITION_GAZEBO_GUISYSTEMPLUGIN_HH_
#ifndef GZ_GAZEBO_GUISYSTEMPLUGIN_HH_
#define GZ_GAZEBO_GUISYSTEMPLUGIN_HH_

#include <ignition/gazebo/gui/GuiSystem.hh>
#include <gz/sim/gui/GuiSystem.hh>

/// \brief Example of a GUI plugin that has access to entities and components.
class GuiSystemPlugin : public ignition::gazebo::GuiSystem
class GuiSystemPlugin : public gz::sim::GuiSystem
{
Q_OBJECT

Expand All @@ -40,7 +40,7 @@ class GuiSystemPlugin : public ignition::gazebo::GuiSystem
/// \brief Destructor
public: ~GuiSystemPlugin() override;

/// \brief `ignition::gui::Plugin`s can overload this function to
/// \brief `gz::gui::Plugin`s can overload this function to
/// receive custom configuration from an XML file. Here, it comes from the
/// SDF.
///
Expand All @@ -59,8 +59,8 @@ class GuiSystemPlugin : public ignition::gazebo::GuiSystem
/// \param[in] _info Simulation information such as time.
/// \param[in] _ecm Entity component manager, which can be used to get the
/// latest information about entities and components.
public: void Update(const ignition::gazebo::UpdateInfo &_info,
ignition::gazebo::EntityComponentManager &_ecm) override;
public: void Update(const gz::sim::UpdateInfo &_info,
gz::sim::EntityComponentManager &_ecm) override;

/// \brief Get the custom property as a string.
/// \return Custom property
Expand Down
2 changes: 1 addition & 1 deletion examples/plugin/gui_system_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This example shows how to create a GUI system plugin.

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

Expand Down
10 changes: 5 additions & 5 deletions examples/plugin/hello_world/HelloWorld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
// We'll use a string and the ignmsg command below for a brief example.
// Remove these includes if your plugin doesn't need them.
#include <string>
#include <ignition/common/Console.hh>
#include <gz/common/Console.hh>

// This header is required to register plugins. It's good practice to place it
// in the cc file, like it's done here.
#include <ignition/plugin/Register.hh>
#include <gz/plugin/Register.hh>

// Don't forget to include the plugin's header.
#include "HelloWorld.hh"
Expand All @@ -31,15 +31,15 @@
// what's in the header.
IGNITION_ADD_PLUGIN(
hello_world::HelloWorld,
ignition::gazebo::System,
gz::sim::System,
hello_world::HelloWorld::ISystemPostUpdate)

using namespace hello_world;

// Here we implement the PostUpdate function, which is called at every
// iteration.
void HelloWorld::PostUpdate(const ignition::gazebo::UpdateInfo &_info,
const ignition::gazebo::EntityComponentManager &/*_ecm*/)
void HelloWorld::PostUpdate(const gz::sim::UpdateInfo &_info,
const gz::sim::EntityComponentManager &/*_ecm*/)
{
// This is a simple example of how to get information from UpdateInfo.
std::string msg = "Hello, world! Simulation is ";
Expand Down
10 changes: 5 additions & 5 deletions examples/plugin/hello_world/HelloWorld.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// The only required include in the header is this one.
// All others will depend on what your plugin does.
#include <ignition/gazebo/System.hh>
#include <gz/sim/System.hh>

// It's good practice to use a custom namespace for your project.
namespace hello_world
Expand All @@ -31,16 +31,16 @@ namespace hello_world
// physics runs. The opposite of that, `ISystemPreUpdate`, would be used by
// plugins that want to send commands.
class HelloWorld:
public ignition::gazebo::System,
public ignition::gazebo::ISystemPostUpdate
public gz::sim::System,
public gz::sim::ISystemPostUpdate
{
// Plugins inheriting ISystemPostUpdate must implement the PostUpdate
// callback. This is called at every simulation iteration after the physics
// updates the world. The _info variable provides information such as time,
// while the _ecm provides an interface to all entities and components in
// simulation.
public: void PostUpdate(const ignition::gazebo::UpdateInfo &_info,
const ignition::gazebo::EntityComponentManager &_ecm) override;
public: void PostUpdate(const gz::sim::UpdateInfo &_info,
const gz::sim::EntityComponentManager &_ecm) override;
};
}
#endif
34 changes: 17 additions & 17 deletions examples/plugin/rendering_plugins/RenderingGuiPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
*
*/

#include <ignition/gui/Application.hh>
#include <gz/gui/Application.hh>
//! [includeGuiEvents]
#include <ignition/gui/GuiEvents.hh>
#include <gz/gui/GuiEvents.hh>
//! [includeGuiEvents]
#include <ignition/gui/MainWindow.hh>
#include <ignition/math/Rand.hh>
#include <ignition/plugin/Register.hh>
#include <ignition/rendering/RenderEngine.hh>
#include <ignition/rendering/RenderingIface.hh>
#include <ignition/rendering/Scene.hh>
#include <gz/gui/MainWindow.hh>
#include <gz/math/Rand.hh>
#include <gz/plugin/Register.hh>
#include <gz/rendering/RenderEngine.hh>
#include <gz/rendering/RenderingIface.hh>
#include <gz/rendering/Scene.hh>

#include "RenderingGuiPlugin.hh"

Expand All @@ -33,8 +33,8 @@ void RenderingGuiPlugin::LoadConfig(const tinyxml2::XMLElement * /*_pluginElem*/
{
// This is necessary to receive the Render event on eventFilter
//! [connectToGuiEvent]
ignition::gui::App()->findChild<
ignition::gui::MainWindow *>()->installEventFilter(this);
gz::gui::App()->findChild<
gz::gui::MainWindow *>()->installEventFilter(this);
//! [connectToGuiEvent]
}

Expand All @@ -48,7 +48,7 @@ void RenderingGuiPlugin::RandomColor()
//! [eventFilter]
bool RenderingGuiPlugin::eventFilter(QObject *_obj, QEvent *_event)
{
if (_event->type() == ignition::gui::events::Render::kType)
if (_event->type() == gz::gui::events::Render::kType)
{
// This event is called in the render thread, so it's safe to make
// rendering calls here
Expand Down Expand Up @@ -78,9 +78,9 @@ void RenderingGuiPlugin::PerformRenderingOperations()
return;

this->scene->SetAmbientLight({
static_cast<float>(ignition::math::Rand::DblUniform(0.0, 1.0)),
static_cast<float>(ignition::math::Rand::DblUniform(0.0, 1.0)),
static_cast<float>(ignition::math::Rand::DblUniform(0.0, 1.0)),
static_cast<float>(gz::math::Rand::DblUniform(0.0, 1.0)),
static_cast<float>(gz::math::Rand::DblUniform(0.0, 1.0)),
static_cast<float>(gz::math::Rand::DblUniform(0.0, 1.0)),
1.0});

this->dirty = false;
Expand All @@ -90,7 +90,7 @@ void RenderingGuiPlugin::PerformRenderingOperations()
/////////////////////////////////////////////////
void RenderingGuiPlugin::FindScene()
{
auto loadedEngNames = ignition::rendering::loadedEngines();
auto loadedEngNames = gz::rendering::loadedEngines();
if (loadedEngNames.empty())
{
igndbg << "No rendering engine is loaded yet" << std::endl;
Expand All @@ -104,7 +104,7 @@ void RenderingGuiPlugin::FindScene()
igndbg << "More than one engine is available. "
<< "Using engine [" << engineName << "]" << std::endl;
}
auto engine = ignition::rendering::engine(engineName);
auto engine = gz::rendering::engine(engineName);
if (!engine)
{
ignerr << "Internal error: failed to load engine [" << engineName
Expand Down Expand Up @@ -142,4 +142,4 @@ void RenderingGuiPlugin::FindScene()

// Register this plugin
IGNITION_ADD_PLUGIN(RenderingGuiPlugin,
ignition::gui::Plugin)
gz::gui::Plugin)
Loading

0 comments on commit ce1e531

Please sign in to comment.