Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ign -> gz Namespace Migration : gz-launch #163

Merged
merged 31 commits into from
May 29, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
58bd75e
Update namespace definitions and using statements
methylDragon May 16, 2022
ac6c93c
Migrate ignition::gazebo to gz::sim
methylDragon May 16, 2022
4bceecc
Migrate ignition:: to gz::
methylDragon May 16, 2022
c0e66f9
Update header guards
methylDragon May 16, 2022
7e31ad5
Use deprecation trick and implement test
methylDragon May 16, 2022
9d9dd22
Add migration line
methylDragon May 17, 2022
5b7857f
Add copyright to deprecation test
methylDragon May 18, 2022
5d0d44f
Include config.hh
methylDragon May 18, 2022
3b53949
Ticktock config macros
methylDragon May 19, 2022
bed056e
Mention gz headers in migration
methylDragon May 20, 2022
1113313
Migrate includes to gz
methylDragon May 20, 2022
4e14c74
Update config.hh
methylDragon May 20, 2022
b902b64
Update migration
methylDragon May 20, 2022
d04b696
Migrate Export.hh macros, CMake install vars, and the deprecated test
methylDragon May 20, 2022
6a2e3f3
Migrate github links
methylDragon May 20, 2022
82fc395
Migrate user-facing Ignition to Gazebo
methylDragon May 20, 2022
68814de
Fix broken references
methylDragon May 20, 2022
a3b320c
Migrate gz-common logging calls
methylDragon May 20, 2022
52bdc8a
Revert plugin names to ignition-gazebo
methylDragon May 20, 2022
3646ee8
Migrate "ignition.msgs" -> "gz.msgs"
methylDragon May 21, 2022
382fe17
Include config.hh in recursive directories and <lib>.hh
methylDragon May 22, 2022
d678d7e
`Gazebo Robotics` -> `Gazebo`
methylDragon May 23, 2022
a99bec8
`ignitionrobotics` -> `gazebosim`
methylDragon May 23, 2022
0753c8b
Revert migration for fuel.ignitionrobotics.org
methylDragon May 23, 2022
643b2b2
Rollback osrf-migration.github.io migrations
methylDragon May 24, 2022
08d9cf9
Wording changes
methylDragon May 25, 2022
91282c4
Migrate `igndbg` -> `gzdbg`
methylDragon May 25, 2022
702f452
Tick-tock plugin finding (`IGN_LAUNCH_PLUGIN_PATH`)
methylDragon May 25, 2022
223814b
Add tick-tock warning and changelog entry for `IGN_LAUNCH_PLUGIN_PATH`
methylDragon May 26, 2022
feb94cd
Update migration
methylDragon May 26, 2022
b51b2aa
Fix `IGN_LAUNCH_PLUGIN_PATH` logic
methylDragon May 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ release will remove the deprecated code.
a single path could be set here, and setting a path list would break the whole
launch file lookup functionality.

- The `ignition` namespace is deprecated and will be removed in future versions.
Use `gz` instead.

- Header files under `ignition/...` are deprecated and will be removed in future versions.
Use `gz/...` instead.

chapulina marked this conversation as resolved.
Show resolved Hide resolved
## Ignition Launch 0.X to N.M
6 changes: 3 additions & 3 deletions examples/factory.ign
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ignition version='1.0'>
<plugin name="ignition::launch::GazeboFactory"
<plugin name="gz::launch::GazeboFactory"
filename="ignition-launch-gazebo-factory">
<spawn>
<name>x2</name>
Expand All @@ -11,7 +11,7 @@
<include>
<uri>https://fuel.ignitionrobotics.org/1.0/openrobotics/models/X2 UGV/1</uri>
<plugin filename="ignition-gazebo-diff-drive-system"
name="ignition::gazebo::systems::DiffDrive">
name="gz::sim::systems::DiffDrive">
<left_joint>front_left_wheel_joint</left_joint>
<left_joint>rear_left_wheel_joint</left_joint>
<right_joint>front_right_wheel_joint</right_joint>
Expand All @@ -22,7 +22,7 @@

<!-- Publish robot joint state information -->
<plugin filename="ignition-gazebo-state-publisher-system"
name="ignition::gazebo::systems::JointStatePublisher"></plugin>
name="gz::sim::systems::JointStatePublisher"></plugin>
</include>
</sdf>
</spawn>
Expand Down
18 changes: 9 additions & 9 deletions examples/gazebo_plugins.ign
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ignition version='1.0'>
<!-- Load a joystick plugin that will read from a device and output to a
topic -->
<plugin name="ignition::launch::Joystick"
<plugin name="gz::launch::Joystick"
filename="ignition-launch-joystick">
<device>/dev/input/js0</device>
<sticky_buttons>false</sticky_buttons>
Expand All @@ -30,22 +30,22 @@

<!-- Load a plugin that transforms a joystick message to a
twist message -->
<plugin name="ignition::launch::JoyToTwist"
<plugin name="gz::launch::JoyToTwist"
filename="ignition-launch-joytotwist">
<input_topic>/joy</input_topic>
<output_topic>/model/vehicle_green/cmd_vel</output_topic>
</plugin>

<!-- Load a plugin that transforms a joystick message to a
twist message -->
<plugin name="ignition::launch::JoyToTwist"
<plugin name="gz::launch::JoyToTwist"
filename="ignition-launch-joytotwist">
<input_topic>/joy</input_topic>
<output_topic>/model/vehicle_blue/cmd_vel</output_topic>
</plugin>

<!-- Run the gazebo server with a set of plugins -->
<plugin name="ignition::launch::GazeboServer"
<plugin name="gz::launch::GazeboServer"
filename="ignition-launch-gazebo">
<world_file><%= worldName %>.sdf</world_file>
<run>true</run>
Expand Down Expand Up @@ -79,18 +79,18 @@
<plugin entity_name="<%= worldName %>"
entity_type="world"
filename="ignition-gazebo1-physics-system"
name="ignition::gazebo::systems::Physics">
name="gz::sim::systems::Physics">
</plugin>
<plugin entity_name="<%= worldName %>"
entity_type="world"
filename="ignition-gazebo1-scene-broadcaster-system"
name="ignition::gazebo::systems::SceneBroadcaster">
name="gz::sim::systems::SceneBroadcaster">
</plugin>

<plugin entity_name="vehicle_green"
entity_type="model"
filename="ignition-gazebo1-diff-drive-system"
name="ignition::gazebo::systems::DiffDrive">
name="gz::sim::systems::DiffDrive">
<left_joint>left_wheel_joint</left_joint>
<right_joint>right_wheel_joint</right_joint>
<wheel_separation>1.25</wheel_separation>
Expand All @@ -100,7 +100,7 @@
<plugin entity_name="vehicle_blue"
entity_type="model"
filename="ignition-gazebo1-diff-drive-system"
name="ignition::gazebo::systems::DiffDrive">
name="gz::sim::systems::DiffDrive">
<left_joint>left_wheel_joint</left_joint>
<right_joint>right_wheel_joint</right_joint>
<wheel_separation>1.25</wheel_separation>
Expand All @@ -111,7 +111,7 @@
</plugin>

<executable_wrapper>
<plugin name="ignition::launch::GazeboGui"
<plugin name="gz::launch::GazeboGui"
filename="ignition-launch-gazebogui">

<!-- Override default window title (Gazebo) -->
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_factory.ign
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ignition version='1.0'>
<plugin name="ignition::launch::GazeboFactory"
<plugin name="gz::launch::GazeboFactory"
filename="ignition-launch-gazebo-factory">
<spawn>
<name>x2</name>
Expand Down
10 changes: 5 additions & 5 deletions examples/plugins.ign
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- Load a joystick plugin that will read from a device and output to a
topic -->
<plugin name="ignition::launch::Joystick"
<plugin name="gz::launch::Joystick"
filename="ignition-launch-joystick">
<device>/dev/input/js0</device>
<sticky_buttons>false</sticky_buttons>
Expand All @@ -14,20 +14,20 @@

<!-- Load a plugin that transforms a joystick message to a
twist message -->
<plugin name="ignition::launch::JoyToTwist"
<plugin name="gz::launch::JoyToTwist"
filename="ignition-launch-joytotwist">
<input_topic>/joy</input_topic>
<output_topic>/model/vehicle_green/cmd_vel</output_topic>
</plugin>

<!-- Load a plugin that transforms a joystick message to a
twist message -->
<plugin name="ignition::launch::JoyToTwist"
<plugin name="gz::launch::JoyToTwist"
filename="ignition-launch-joytotwist">
<!-- Incoming topic that publishes ignition::msgs::Joystick messages -->
<!-- Incoming topic that publishes gz::msgs::Joystick messages -->
<input_topic>/joy</input_topic>

<!-- Outgoing topic that publishes ignition::msgs::Twist messages -->
<!-- Outgoing topic that publishes gz::msgs::Twist messages -->
<output_topic>/model/vehicle_blue/cmd_vel</output_topic>

<!-- Button which must be pressed to enable publishing, defaults to 0 -->
Expand Down
2 changes: 1 addition & 1 deletion examples/websocket.ign
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- Load a websocket server that provides access to Ignition Transport
topics through websockets.-->
<plugin name="ignition::launch::WebsocketServer"
<plugin name="gz::launch::WebsocketServer"
filename="ignition-launch-websocket-server">
<publication_hz>30</publication_hz>
<port>9002</port>
Expand Down
8 changes: 4 additions & 4 deletions include/gz/launch/Plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
#include <gz/plugin/SpecializedPluginPtr.hh>
#include <gz/launch/Export.hh>

namespace ignition
namespace gz
{
namespace launch
{
// Inline bracket to help doxygen filtering.
inline namespace IGNITION_LAUNCH_VERSION_NAMESPACE {
inline namespace GZ_LAUNCH_VERSION_NAMESPACE {
/// \brief Base class for launch plugins.
class Plugin
{
Expand All @@ -38,8 +38,8 @@ namespace ignition
};

/// \brief Pointer to a launch plugin.
using PluginPtr = ignition::plugin::SpecializedPluginPtr<
ignition::launch::Plugin>;
using PluginPtr = gz::plugin::SpecializedPluginPtr<
gz::launch::Plugin>;
}
}
}
Expand Down
38 changes: 30 additions & 8 deletions include/gz/launch/config.hh.in
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
/*
* Copyright (C) 2022 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.
*
*/

/* Config.hh. Generated by CMake for @PROJECT_NAME@. */

#ifndef GZ_LAUNCH_CONFIG_HH_
#define GZ_LAUNCH_CONFIG_HH_

/* Version number */
#define IGNITION_LAUNCH_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}
#define IGNITION_LAUNCH_MINOR_VERSION ${PROJECT_VERSION_MINOR}
#define IGNITION_LAUNCH_PATCH_VERSION ${PROJECT_VERSION_PATCH}
#define GZ_LAUNCH_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}
#define GZ_LAUNCH_MINOR_VERSION ${PROJECT_VERSION_MINOR}
#define GZ_LAUNCH_PATCH_VERSION ${PROJECT_VERSION_PATCH}

#define IGNITION_LAUNCH_VERSION "${PROJECT_VERSION}"
#define IGNITION_LAUNCH_VERSION_FULL "${PROJECT_VERSION_FULL}"
#define GZ_LAUNCH_VERSION "${PROJECT_VERSION}"
#define GZ_LAUNCH_VERSION_FULL "${PROJECT_VERSION_FULL}"

#define IGNITION_LAUNCH_VERSION_HEADER "${PROJECT_NAME_LOWER}, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2019 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n"
#define GZ_LAUNCH_VERSION_HEADER "Gz Launch, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2019 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n"

#define IGNITION_LAUNCH_INITIAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${IGN_DATA_INSTALL_DIR}/configs"
#define GZ_LAUNCH_INITIAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${IGN_DATA_INSTALL_DIR}/configs"
chapulina marked this conversation as resolved.
Show resolved Hide resolved

#define IGNITION_LAUNCH_PLUGIN_INSTALL_PATH "${IGN_LAUNCH_PLUGIN_INSTALL_PATH}"
#define GZ_LAUNCH_PLUGIN_INSTALL_PATH "${IGN_LAUNCH_PLUGIN_INSTALL_PATH}"
chapulina marked this conversation as resolved.
Show resolved Hide resolved

#cmakedefine BUILD_TYPE_PROFILE 1
#cmakedefine BUILD_TYPE_DEBUG 1
#cmakedefine BUILD_TYPE_RELEASE 1
chapulina marked this conversation as resolved.
Show resolved Hide resolved

#endif
1 change: 1 addition & 0 deletions include/ignition/launch/Export.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
*/

#include <gz/launch/Export.hh>
#include <ignition/launch/config.hh>
1 change: 1 addition & 0 deletions include/ignition/launch/Plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
*/

#include <gz/launch/Plugin.hh>
#include <ignition/launch/config.hh>
26 changes: 26 additions & 0 deletions include/ignition/launch/config.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,30 @@
*
*/

#ifndef IGNITION_LAUNCH__CONFIG_HH_
#define IGNITION_LAUNCH__CONFIG_HH_

#include <gz/launch/config.hh>

#define IGNITION_LAUNCH_MAJOR_VERSION GZ_LAUNCH_MAJOR_VERSION
#define IGNITION_LAUNCH_MINOR_VERSION GZ_LAUNCH_MINOR_VERSION
#define IGNITION_LAUNCH_PATCH_VERSION GZ_LAUNCH_PATCH_VERSION

#define IGNITION_LAUNCH_VERSION GZ_LAUNCH_VERSION
#define IGNITION_LAUNCH_VERSION_FULL GZ_LAUNCH_VERSION_FULL

#define IGNITION_LAUNCH_VERSION_HEADER GZ_LAUNCH_VERSION_HEADER

#define IGNITION_LAUNCH_PLUGIN_INITIAL_CONFIG_PATH GZ_LAUNCH_PLUGIN_INITIAL_CONFIG_PATH

#define IGNITION_LAUNCH_PLUGIN_INSTALL_DIR GZ_LAUNCH_PLUGIN_INSTALL_DIR
chapulina marked this conversation as resolved.
Show resolved Hide resolved

namespace ignition
{
#ifndef SUPPRESS_IGNITION_HEADER_DEPRECATION
#pragma message("ignition namespace is deprecated! Use gz instead!")
#endif
using namespace gz;
}

#endif
16 changes: 8 additions & 8 deletions plugins/gazebo_factory/GazeboFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
*
*/

#include <ignition/msgs/entity_factory.pb.h>
#include <ignition/msgs/boolean.pb.h>
#include <gz/msgs/entity_factory.pb.h>
#include <gz/msgs/boolean.pb.h>

#include <ignition/common/Util.hh>
#include <ignition/common/Console.hh>
#include <gz/common/Util.hh>
#include <gz/common/Console.hh>
#include "GazeboFactory.hh"

using namespace ignition;
using namespace ignition::launch;
using namespace gz;
using namespace gz::launch;

/////////////////////////////////////////////////
GazeboFactory::GazeboFactory()
: ignition::launch::Plugin()
: gz::launch::Plugin()
{
}

Expand Down Expand Up @@ -123,7 +123,7 @@ void GazeboFactory::ProcessSpawn(const tinyxml2::XMLElement *_elem)
elem = _elem->FirstChildElement("pose");
if (elem)
{
ignition::math::Pose3d pose;
gz::math::Pose3d pose;
std::stringstream stream;
stream << elem->GetText();
stream >> pose;
Expand Down
20 changes: 10 additions & 10 deletions plugins/gazebo_factory/GazeboFactory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
* limitations under the License.
*
*/
#ifndef IGNITION_LAUNCH_GAZEBOFACTORY_HH_
#define IGNITION_LAUNCH_GAZEBOFACTORY_HH_
#ifndef GZ_LAUNCH_GAZEBOFACTORY_HH_
#define GZ_LAUNCH_GAZEBOFACTORY_HH_

#include <memory>
#include <ignition/plugin/Register.hh>
#include <ignition/transport/Node.hh>
#include "ignition/launch/Plugin.hh"
#include <gz/plugin/Register.hh>
#include <gz/transport/Node.hh>
#include "gz/launch/Plugin.hh"

namespace ignition
namespace gz
{
namespace launch
{
/// \brief Spawns entities into simulation.
///
/// # Example usage
/// <plugin name="ignition::launch::GazeboFactory"
/// <plugin name="gz::launch::GazeboFactory"
/// filename="ignition-launch-gazebo-factory">
///
/// <spawn>
Expand All @@ -50,7 +50,7 @@ namespace ignition
/// <uri>https://fuel.ignitionrobotics.org/1.0/openrobotics/models/X2 UGV/1</uri>
/// <!-- Publish robot state information -->
/// <plugin filename="ignition-gazebo-state-publisher-system"
/// name="ignition::gazebo::systems::StatePublisher"></plugin>
/// name="gz::sim::systems::StatePublisher"></plugin>
/// </include>
/// </sdf>
/// </spawn>
Expand All @@ -59,7 +59,7 @@ namespace ignition
/// ...
/// </spawn>
/// </plugin>
class GazeboFactory : public ignition::launch::Plugin
class GazeboFactory : public gz::launch::Plugin
{
/// \brief Constructor.
public: GazeboFactory();
Expand Down Expand Up @@ -90,6 +90,6 @@ namespace ignition
}

// Register the plugin
IGNITION_ADD_PLUGIN(ignition::launch::GazeboFactory, ignition::launch::Plugin)
IGNITION_ADD_PLUGIN(gz::launch::GazeboFactory, gz::launch::Plugin)

#endif
Loading