Skip to content

Commit

Permalink
Merge gz-sim7 into gz-sim8
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey committed Sep 20, 2023
2 parents f55212e + 3eb2c7c commit f5087df
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 16 deletions.
6 changes: 3 additions & 3 deletions examples/scripts/blender/sdf_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def export_sdf(prefix_path):

# 1 model and 1 link
model = ET.SubElement(sdf, "model", attrib={"name": "test"})
static = ET.SubElement(sdf, "static")
static = ET.SubElement(model, "static")
static.text = "true"
link = ET.SubElement(model, "link", attrib={"name": "testlink"})
# for each geometry in geometry library add a <visual> tag
Expand Down Expand Up @@ -165,8 +165,8 @@ def add_attenuation_tags(light_tag, blender_light):
uri.text = path.join(meshes_folder_prefix, dae_filename)

surface = ET.SubElement(collision, "surface")
contact = ET.SubElement(collision, "contact")
collide_bitmask = ET.SubElement(collision, "collide_bitmask")
contact = ET.SubElement(surface, "contact")
collide_bitmask = ET.SubElement(contact, "collide_bitmask")
collide_bitmask.text = "0x01"

## sdf write to file
Expand Down
1 change: 0 additions & 1 deletion examples/worlds/nested_model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<plugin
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
<engine><filename>gz-physics-tpe-plugin</filename></engine>
</plugin>
<plugin
filename="gz-sim-user-commands-system"
Expand Down
2 changes: 0 additions & 2 deletions examples/worlds/particle_emitter.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
<plugin
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
<!-- Use TPE in order to use nested models -->
<engine><filename>gz-physics-tpe-plugin</filename></engine>
</plugin>
<plugin
filename="gz-sim-user-commands-system"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ namespace gz::sim::gui
/// \brief Model holding all the joints.
public: JointsModel jointsModel;

/// \brief Model entity being controller.
/// \brief Model entity being controlled.
public: Entity modelEntity{kNullEntity};

/// \brief Previous model entity being controlled.
public: Entity prevModelEntity{kNullEntity};

/// \brief Name of the model
public: QString modelName{"No model selected"};

Expand Down Expand Up @@ -212,6 +215,12 @@ void JointPositionController::Update(const UpdateInfo &,
auto jointEntities = _ecm.EntitiesByComponents(components::Joint(),
components::ParentEntity(this->dataPtr->modelEntity));

if (this->dataPtr->prevModelEntity != this->dataPtr->modelEntity)
{
this->dataPtr->prevModelEntity = this->dataPtr->modelEntity;
this->dataPtr->jointsModel.Clear();
}

// List all joints
for (const auto &jointEntity : jointEntities)
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/plugins/view_angle/ViewAngle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ bool ViewAngle::OnMoveToModelService(const gz::msgs::GUICamera &_msg,
Entity entityId = kNullEntity;
try
{
entityId = std::get<unsigned int>(visualToMove->UserData("gazebo-entity"));
entityId = std::get<uint64_t>(visualToMove->UserData("gazebo-entity"));
}
catch(std::bad_variant_access &_e)
{
Expand Down
6 changes: 3 additions & 3 deletions src/systems/joint_state_publisher/JointStatePublisher.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace sim
inline namespace GZ_SIM_VERSION_NAMESPACE {
namespace systems
{
/// \brief The JointStatePub system publishes state information for
/// a model. The published message type is gz::msgs::Model, and the
/// \brief The JointStatePublisher system publishes joint state information
/// for a model. The published message type is gz::msgs::Model, and the
/// publication topic is determined by the `<topic>` parameter.
///
/// By default the JointStatePublisher will publish all joints for
Expand All @@ -45,7 +45,7 @@ namespace systems
///
/// `<topic>`: Name of the topic to publish to. This parameter is optional,
/// and if not provided, the joint state will be published to
/// "/world/<world_name>/model/<model_name>/state".
/// "/world/<world_name>/model/<model_name>/joint_state".
/// `<joint_name>`: Name of a joint to publish. This parameter can be
/// specified multiple times, and is optional. All joints in a model will
/// be published if joint names are not specified.
Expand Down
Binary file modified tutorials/files/video_recorder/video_recorder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tutorials/move_camera_to_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ This tutorial gives an introduction to Gazebo's service `/gui/move_to/model`. Th
For example, Let's move the camera to the `box` model looking down from 5 meters away.

```bash
ign 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
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
```

@image html files/move_camera_to_model/box_5.gif

The camera can also be placed far away, for example 20 meters:

```bash
ign service -s /gui/move_to/model --reqtype gz.msgs.GUICamera --reptype gz.msgs.Boolean -r 'name: "box", pose: {position: {z:20}, orientation: {x:0, y:0, z: -1, w:0}}, projection_type: "orbit"' --timeout 5000
gz service -s /gui/move_to/model --reqtype gz.msgs.GUICamera --reptype gz.msgs.Boolean -r 'name: "box", pose: {position: {z:20}, orientation: {x:0, y:0, z: -1, w:0}}, projection_type: "orbit"' --timeout 5000
```

@image html files/move_camera_to_model/box_20.gif
Expand Down
3 changes: 2 additions & 1 deletion tutorials/terminology.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ to developers touching the source code.
more than 1 world.
* It has a single ECM with all the entities and components
relevant to the levels / world / performer being simulated.
* It's still TBD how to support multiple `<worlds>` in parallel.
* It's still [an open task](https://github.com/gazebosim/gz-sim/issues/18)
to support multiple `<worlds>` in parallel.
* It has an event manager.
* It has a network manager, if simulation is distributed.
* It loads up a set of systems.
Expand Down
5 changes: 3 additions & 2 deletions tutorials/video_recorder.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Gazebo that already has this plugin included in the GUI.
gz sim -v 4 video_record_dbl_pendulum.sdf
```

In this plugin, you should see a single button with a video recorder icon.
Clicking on the button gives you the video format options that are available.
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

Expand Down

0 comments on commit f5087df

Please sign in to comment.