Skip to content

Commit

Permalink
Merge branch 'main' into feature/ign-gazebo7-metal-demo
Browse files Browse the repository at this point in the history
  • Loading branch information
srmainwaring authored Dec 29, 2021
2 parents 2106e55 + 0e720f0 commit 6800a8e
Show file tree
Hide file tree
Showing 97 changed files with 13,715 additions and 330 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
# as protobuf could be find transitively by any dependency
set(protobuf_MODULE_COMPATIBLE TRUE)

ign_find_package(sdformat12 REQUIRED VERSION 12.2)
ign_find_package(sdformat12 REQUIRED VERSION 12.3)
set(SDF_VER ${sdformat12_VERSION_MAJOR})

#--------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ignition Gazebo Dockerfiles

This directory contains a few Dockerfiles and supporting scripts. See each
section below for usage information about
section below for usage information about

1. [Dockerfile.ignition](#Ignition-Gazebo-Using-Debians-In-Docker)
1. [Dockerfile.nightly](#Build-Ignition-Gazebo-Using-Nightly-Debians)
Expand Down Expand Up @@ -69,25 +69,25 @@ distribution using debians.
**Steps**
1. Build a docker image using the `build.bash` command. The first argument
must be the name of the Ignition distribution. For example, to build an
image of Ignition Blueprint:
must be the name of the Ignition distribution. The list of Ignition distribution can be found at [Ignition distribution](https://ignitionrobotics.org/docs). For example, to build an
image of Ignition Fortress:
```
./build.bash ignition-blueprint ./Dockerfile.ignition
./build.bash ignition-garden ./Dockerfile.ignition
```
2. Run the docker image using `run.bash`, and pass in the name of the docker
image (first argument to the build.bash script).
```
./run.bash ignition-blueprint
./run.bash ignition-garden
```
3. You can pass arguments to Ignition Gazebo by appending them the
`run.bash` command. For example, to load the shapes.sdf file:
```
./run.bash ignition-blueprint -f shapes.sdf
./run.bash ignition-garden -f shapes.sdf
```
## Appendix
Expand Down Expand Up @@ -148,7 +148,7 @@ Docker has two available versions: Community Edition (CE) and Enterprise Edition
sudo apt-get install -y nvidia-docker2
1. Restart the Docker daemon
1. Restart the Docker daemon
sudo service docker restart
Expand Down
2 changes: 1 addition & 1 deletion docker/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
user_id=$(id -u)
image_name=$1
dir_name=$(dirname $2)
image_plus_tag=$image_name:$(date +%Y_%b_%d_%H%M)
image_plus_tag=$image_name:$(date +%Y_%m_%d_%H%M)

docker build --rm -t $image_plus_tag --build-arg user_id=$user_id --build-arg ign_distribution=$1 -f $2 .
docker tag $image_plus_tag $image_name:latest
Expand Down
2 changes: 1 addition & 1 deletion examples/worlds/sensors.sdf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" ?>
<!--
Ignition Gazebo sensor demo
Ignition Gazebo sensor demo for sensors that do not require rendering.
Listen to sensor readings:
Expand Down
4 changes: 4 additions & 0 deletions include/ignition/gazebo/EntityComponentManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,10 @@ namespace ignition
/// \param[in] _offset Offset value.
public: void SetEntityCreateOffset(uint64_t _offset);

/// \brief Return true if there are components marked for removal.
/// \return True if there are components marked for removal.
public: bool HasRemovedComponents() const;

/// \brief Clear the list of newly added entities so that a call to
/// EachAdded after this will have no entities to iterate. This function
/// is protected to facilitate testing.
Expand Down
7 changes: 7 additions & 0 deletions include/ignition/gazebo/SdfEntityCreator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ namespace ignition
/// \return Joint entity.
public: Entity CreateEntities(const sdf::Joint *_joint);

/// \brief Create all entities that exist in the sdf::Joint object and
/// load their plugins.
/// \param[in] _joint SDF joint object.
/// \param[in] _resolved True if all frames are already resolved
/// \return Joint entity.
public: Entity CreateEntities(const sdf::Joint *_joint, bool _resolved);

/// \brief Create all entities that exist in the sdf::Visual object and
/// load their plugins.
/// \param[in] _visual SDF visual object.
Expand Down
48 changes: 48 additions & 0 deletions include/ignition/gazebo/components/Recreate.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2021 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef IGNITION_GAZEBO_COMPONENTS_RECREATE_HH_
#define IGNITION_GAZEBO_COMPONENTS_RECREATE_HH_

#include <ignition/gazebo/components/Factory.hh>
#include <ignition/gazebo/components/Component.hh>
#include <ignition/gazebo/config.hh>

namespace ignition
{
namespace gazebo
{
// Inline bracket to help doxygen filtering.
inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
namespace components
{
/// \brief A component that identifies an entity needs to be recreated.
/// Currently, only Models will be processed for recreation by the
/// SimulationRunner in the ProcessRecreateEntitiesRemove and
/// ProcessRecreateEntitiesCreate functions.
///
/// The GUI ModelEditor contains example code on how to use this
/// component. For example, the ModelEditor allows a user to add a link to an
/// existing model. The existing model is tagged with this component so
/// that it can be recreated by the server.
using Recreate = Component<NoData, class RecreateTag>;
IGN_GAZEBO_REGISTER_COMPONENT("ign_gazebo_components.Recreate", Recreate)
}
}
}
}

#endif
1 change: 1 addition & 0 deletions include/ignition/gazebo/components/Serialization.hh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ namespace serializers
const DataType &_data)
{
MsgType msg;
// cppcheck-suppress syntaxError
if constexpr (traits::HasGazeboConvert<DataType, MsgType>::value)
{
msg = ignition::gazebo::convert<MsgType>(_data);
Expand Down
4 changes: 4 additions & 0 deletions include/ignition/gazebo/detail/View.hh
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ template<typename ...ComponentTypeTs>
bool View<ComponentTypeTs...>::NotifyComponentRemoval(const Entity _entity,
const ComponentTypeId _typeId)
{
// if entity is still marked as to add, remove from the view
if (this->RequiresComponent(_typeId))
this->toAddEntities.erase(_entity);

// make sure that _typeId is a type required by the view and that _entity is
// already a part of the view
if (!this->RequiresComponent(_typeId) ||
Expand Down
35 changes: 35 additions & 0 deletions include/ignition/gazebo/gui/GuiEvents.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#define IGNITION_GAZEBO_GUI_GUIEVENTS_HH_

#include <QEvent>
#include <QMap>
#include <QString>

#include <set>
#include <string>
#include <utility>
Expand Down Expand Up @@ -176,6 +179,38 @@ namespace events
/// \brief True if a transform mode is active.
private: bool tranformModeActive;
};

/// \brief Event that notifies an entity is to be added to the model editor
class ModelEditorAddEntity : public QEvent
{
/// \brief Constructor
/// \param[in] _entity Entity added
/// \param[in] _type Entity type
/// \param[in] _parent Parent entity.
public: explicit ModelEditorAddEntity(QString _entity, QString _type,
ignition::gazebo::Entity _parent);

/// \brief Get the entity to add
public: QString Entity() const;

/// \brief Get the entity type
public: QString EntityType() const;


/// \brief Get the parent entity to add the entity to
public: ignition::gazebo::Entity ParentEntity() const;

/// \brief Get the data map.
/// \return the QMap of string, string holding custom data.
public: QMap<QString, QString> &Data();

static const QEvent::Type kType = QEvent::Type(QEvent::User + 7);

/// \internal
/// \brief Private data pointer
IGN_UTILS_IMPL_PTR(dataPtr)
};

} // namespace events
}
} // namespace gui
Expand Down
9 changes: 9 additions & 0 deletions include/ignition/gazebo/rendering/RenderUtil.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define IGNITION_GAZEBO_RENDERUTIL_HH_

#include <memory>
#include <set>
#include <string>
#include <vector>

Expand Down Expand Up @@ -76,6 +77,14 @@ inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
public: void UpdateFromECM(const UpdateInfo &_info,
const EntityComponentManager &_ecm);

/// \brief Helper function to create visuals for new entities created in
/// ECM. This function is intended to be used by other GUI plugins when
/// new entities are created on the GUI side.
/// \param[in] _ecm Const reference to the entity component manager
/// \param[in] _entities Entities to create visuals for.
public: void CreateVisualsForEntities(const EntityComponentManager &_ecm,
const std::set<Entity> &_entities);

/// \brief Set the rendering engine to use
/// \param[in] _engineName Name of the rendering engine.
public: void SetEngineName(const std::string &_engineName);
Expand Down
Loading

0 comments on commit 6800a8e

Please sign in to comment.