Skip to content

Commit

Permalink
ign to gz (#1630)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Aug 5, 2022
1 parent 2297677 commit 021b3b0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 45 deletions.
64 changes: 32 additions & 32 deletions examples/worlds/boundingbox_camera.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
<sdf version="1.6">
<world name="boundingbox_sensor">
<plugin
filename="ignition-gazebo-physics-system"
name="ignition::gazebo::systems::Physics">
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
</plugin>
<plugin
filename="ignition-gazebo-user-commands-system"
name="ignition::gazebo::systems::UserCommands">
filename="gz-sim-user-commands-system"
name="gz::sim::systems::UserCommands">
</plugin>
<plugin
filename="ignition-gazebo-scene-broadcaster-system"
name="ignition::gazebo::systems::SceneBroadcaster">
filename="gz-sim-scene-broadcaster-system"
name="gz::sim::systems::SceneBroadcaster">
</plugin>
<plugin
filename="ignition-gazebo-sensors-system"
name="ignition::gazebo::systems::Sensors">
filename="gz-sim-sensors-system"
name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>

<gui fullscreen="0">

<!-- 3D scene -->
<plugin filename="MinimalScene" name="3D View">
<ignition-gui>
<gz-gui>
<title>3D View</title>
<property type="bool" key="showTitleBar">false</property>
<property type="string" key="state">docked</property>
</ignition-gui>
</gz-gui>

<engine>ogre2</engine>
<scene>scene</scene>
Expand All @@ -41,43 +41,43 @@

<!-- Plugins that add functionality to the scene -->
<plugin filename="EntityContextMenuPlugin" name="Entity context menu">
<ignition-gui>
<gz-gui>
<property key="state" type="string">floating</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</gz-gui>
</plugin>
<plugin filename="GzSceneManager" name="Scene Manager">
<ignition-gui>
<gz-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</gz-gui>
</plugin>
<plugin filename="InteractiveViewControl" name="Interactive view control">
<ignition-gui>
<gz-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</gz-gui>
</plugin>
<plugin filename="CameraTracking" name="Camera Tracking">
<ignition-gui>
<gz-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</gz-gui>
</plugin>
<!-- World control -->
<plugin filename="WorldControl" name="World control">
<ignition-gui>
<gz-gui>
<title>World control</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
Expand All @@ -90,7 +90,7 @@
<line own="left" target="left"/>
<line own="bottom" target="bottom"/>
</anchors>
</ignition-gui>
</gz-gui>

<play_pause>true</play_pause>
<step>true</step>
Expand All @@ -101,7 +101,7 @@

<!-- World statistics -->
<plugin filename="WorldStats" name="World stats">
<ignition-gui>
<gz-gui>
<title>World stats</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
Expand All @@ -114,7 +114,7 @@
<line own="right" target="right"/>
<line own="bottom" target="bottom"/>
</anchors>
</ignition-gui>
</gz-gui>

<sim_time>true</sim_time>
<real_time>true</real_time>
Expand All @@ -124,32 +124,32 @@

<plugin filename="ImageDisplay" name="Full 2D">
<topic>boxes_full_2d_image</topic>
<ignition-gui>
<gz-gui>
<title>Full 2D</title>
<property key="state" type="string">docked</property>
<property type="double" key="height">400</property>
<property type="double" key="width">600</property>
</ignition-gui>
</gz-gui>
</plugin>

<plugin filename="ImageDisplay" name="Visible 2D">
<topic>boxes_visible_2d_image</topic>
<ignition-gui>
<gz-gui>
<title>Visible 2D</title>
<property key="state" type="string">docked</property>
<property type="double" key="height">400</property>
<property type="double" key="width">600</property>
</ignition-gui>
</gz-gui>
</plugin>

<plugin filename="ImageDisplay" name="3D">
<topic>boxes_3d_image</topic>
<ignition-gui>
<gz-gui>
<title>3D</title>
<property key="state" type="string">docked</property>
<property type="double" key="height">400</property>
<property type="double" key="width">600</property>
</ignition-gui>
</gz-gui>
</plugin>

</gui>
Expand Down Expand Up @@ -228,15 +228,15 @@
<diffuse>0 0 1 1</diffuse>
<specular>0 0 0.3 1</specular>
</material>
<plugin filename="ignition-gazebo-label-system" name="ignition::gazebo::systems::Label">
<plugin filename="gz-sim-label-system" name="gz::sim::systems::Label">
<label>10</label>
</plugin>
</visual>
</link>
</model>

<model name="box2">
<plugin filename="ignition-gazebo-label-system" name="ignition::gazebo::systems::Label">
<plugin filename="gz-sim-label-system" name="gz::sim::systems::Label">
<label>10</label>
</plugin>
<pose>0 1 0.5 0 0 0</pose>
Expand Down Expand Up @@ -300,7 +300,7 @@
<cast_shadows>false</cast_shadows>
</visual>
</link>
<plugin filename="ignition-gazebo-label-system" name="ignition::gazebo::systems::Label">
<plugin filename="gz-sim-label-system" name="gz::sim::systems::Label">
<label>20</label>
</plugin>
</model>
Expand Down Expand Up @@ -405,7 +405,7 @@
<uri>
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Construction Cone
</uri>
<plugin filename="ignition-gazebo-label-system" name="ignition::gazebo::systems::Label">
<plugin filename="gz-sim-label-system" name="gz::sim::systems::Label">
<label>30</label>
</plugin>
</include>
Expand Down
2 changes: 1 addition & 1 deletion examples/worlds/multicopter_velocity_control.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can use the velocity controller and command linear velocity and yaw angular
Listen to poses:
ign topic -e -t "/model/x3/pose"
gz topic -e -t "/model/x3/pose"
Send commands to the hexacopter to go straight up:
Expand Down
8 changes: 4 additions & 4 deletions src/gz_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ TEST(CmdLine, GZ_UTILS_TEST_DISABLED_ON_WIN32(ResourcePath))
TEST(CmdLine, GZ_UTILS_TEST_DISABLED_ON_WIN32(GazeboHelpVsCompletionFlags))
{
// Flags in help message
std::string helpOutput = customExecStr(kGzCommand + " gazebo --help");
std::string helpOutput = customExecStr(kGzCommand + " sim --help");

// Call the output function in the bash completion script
std::string scriptPath = gz::common::joinPaths(
std::string(PROJECT_SOURCE_PATH),
"src", "cmd", "gazebo.bash_completion.sh");
"src", "cmd", "sim.bash_completion.sh");

// Equivalent to:
// sh -c "bash -c \". /path/to/gazebo.bash_completion.sh; _gz_sim_flags\""
// sh -c "bash -c \". /path/to/sim.bash_completion.sh; _gz_sim_flags\""
std::string cmd = "bash -c \". " + scriptPath + "; _gz_sim_flags\"";
std::string scriptOutput = customExecStr(cmd);

Expand All @@ -193,7 +193,7 @@ TEST(CmdLine, GZ_UTILS_TEST_DISABLED_ON_WIN32(GazeboHelpVsCompletionFlags))
// Match each flag in script output with help message
for (const auto &flag : flags)
{
EXPECT_NE(std::string::npos, helpOutput.find(flag)) << helpOutput;
EXPECT_NE(std::string::npos, helpOutput.find(flag)) << flag;
}
}

Expand Down
11 changes: 5 additions & 6 deletions src/systems/odometry_publisher/OdometryPublisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void OdometryPublisher::Configure(const Entity &_entity,
{
this->dataPtr->odomPub = this->dataPtr->node.Advertise<msgs::Odometry>(
odomTopicValid);
ignmsg << "OdometryPublisher publishing odometry on [" << odomTopicValid
gzmsg << "OdometryPublisher publishing odometry on [" << odomTopicValid
<< "]" << std::endl;
}

Expand All @@ -248,25 +248,24 @@ void OdometryPublisher::Configure(const Entity &_entity,
{
this->dataPtr->odomCovPub = this->dataPtr->node.Advertise<
msgs::OdometryWithCovariance>(odomCovTopicValid);
ignmsg << "OdometryPublisher publishing odometry with covariance on ["
gzmsg << "OdometryPublisher publishing odometry with covariance on ["
<< odomCovTopicValid << "]" << std::endl;
}

std::string tfTopic{"/model/" + this->dataPtr->model.Name(_ecm) +
"/pose"};
std::string tfTopic{"/model/" + this->dataPtr->model.Name(_ecm) + "/pose"};
if (_sdf->HasElement("tf_topic"))
tfTopic = _sdf->Get<std::string>("tf_topic");
std::string tfTopicValid {transport::TopicUtils::AsValidTopic(tfTopic)};
if (tfTopicValid.empty())
{
ignerr << "Failed to generate valid TF topic from [" << tfTopic << "]"
gzerr << "Failed to generate valid TF topic from [" << tfTopic << "]"
<< std::endl;
}
else
{
this->dataPtr->tfPub = this->dataPtr->node.Advertise<msgs::Pose_V>(
tfTopicValid);
ignmsg << "OdometryPublisher publishing Pose_V (TF) on ["
gzmsg << "OdometryPublisher publishing Pose_V (TF) on ["
<< tfTopicValid << "]" << std::endl;
}
}
Expand Down
2 changes: 0 additions & 2 deletions tutorials/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ Top-level entities such as models, lights and actors may be loaded through:
* Path / URL to SDF file
* (TODO) `gz::msgs::Model`, `gz::msgs::Light`
* Within a system, using
==== BASE ====
[SdfEntityCreator](https://ignitionrobotics.org/api/gazebo/4.6/classignition_1_1gazebo_1_1SdfEntityCreator.html)
==== BASE ====
or directly creating components and entities.

Gazebo will look for URIs (path / URL) in the following, in order:
Expand Down

0 comments on commit 021b3b0

Please sign in to comment.