diff --git a/descriptions/unitree/go2_description/urdf/robot.urdf b/descriptions/unitree/go2_description/urdf/robot.urdf
index 4c34838..dbdf128 100644
--- a/descriptions/unitree/go2_description/urdf/robot.urdf
+++ b/descriptions/unitree/go2_description/urdf/robot.urdf
@@ -194,7 +194,7 @@
-
+
@@ -247,7 +247,7 @@
-
+
@@ -275,7 +275,7 @@
-
+
@@ -303,7 +303,7 @@
-
+
@@ -387,7 +387,7 @@
-
+
@@ -415,7 +415,7 @@
-
+
@@ -443,7 +443,7 @@
-
+
@@ -527,7 +527,7 @@
-
+
@@ -555,7 +555,7 @@
-
+
@@ -583,7 +583,7 @@
-
+
@@ -667,7 +667,7 @@
-
+
@@ -695,7 +695,7 @@
-
+
@@ -723,7 +723,7 @@
-
+
diff --git a/hardwares/gz_quadruped_hardware/CMakeLists.txt b/hardwares/gz_quadruped_hardware/CMakeLists.txt
index 0b24c23..ff63f3c 100644
--- a/hardwares/gz_quadruped_hardware/CMakeLists.txt
+++ b/hardwares/gz_quadruped_hardware/CMakeLists.txt
@@ -3,18 +3,18 @@ project(gz_quadruped_hardware)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Default to C11
-if (NOT CMAKE_C_STANDARD)
+if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
-endif ()
+endif()
# Default to C++17
-if (NOT CMAKE_CXX_STANDARD)
+if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
-endif ()
+endif()
# Compiler options
-if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
-endif ()
+endif()
# Find dependencies
find_package(ament_cmake REQUIRED)
@@ -25,11 +25,28 @@ find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)
find_package(yaml_cpp_vendor REQUIRED)
-find_package(gz_sim_vendor REQUIRED)
-find_package(gz-sim REQUIRED)
+set(GZ_PLUGIN)
+set(GZ_SIM)
-find_package(gz_plugin_vendor REQUIRED)
-find_package(gz-plugin REQUIRED)
+find_package(gz-sim8 QUIET)
+if(NOT gz-sim8_FOUND)
+ message(STATUS "Compiling against Gazebo fortress")
+ find_package(ignition-gazebo6 REQUIRED)
+ set(GZ_SIM_VER ${ignition-gazebo6_VERSION_MAJOR})
+ find_package(ignition-plugin1 REQUIRED)
+ set(GZ_PLUGIN_VER ${ignition-plugin1_VERSION_MAJOR})
+ set(GZ_PLUGIN ignition-plugin${GZ_PLUGIN_VER}::register)
+ set(GZ_SIM ignition-gazebo${GZ_SIM_VER}::core)
+else ()
+ message(STATUS "Compiling against Gazebo harmonic")
+ find_package(gz-sim8 REQUIRED)
+ set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR})
+ find_package(gz-plugin2 REQUIRED)
+ set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})
+ set(GZ_PLUGIN gz-plugin${GZ_PLUGIN_VER}::register)
+ set(GZ_SIM gz-sim${GZ_SIM_VER}::core)
+ add_definitions(-DGZ_HEADERS)
+endif()
include_directories(include)
@@ -38,8 +55,8 @@ add_library(${PROJECT_NAME}-system SHARED
)
target_link_libraries(${PROJECT_NAME}-system
- gz-sim::gz-sim
- gz-plugin::register
+ ${GZ_SIM}
+ ${GZ_PLUGIN}
)
ament_target_dependencies(${PROJECT_NAME}-system
ament_index_cpp
@@ -62,7 +79,7 @@ ament_target_dependencies(gz_quadruped_plugins
rclcpp
)
target_link_libraries(gz_quadruped_plugins
- gz-sim::gz-sim
+ ${GZ_SIM}
)
## Install
diff --git a/hardwares/gz_quadruped_hardware/include/gz_quadruped_hardware/gz_quadruped_plugin.hpp b/hardwares/gz_quadruped_hardware/include/gz_quadruped_hardware/gz_quadruped_plugin.hpp
index 92d90e1..1af622e 100644
--- a/hardwares/gz_quadruped_hardware/include/gz_quadruped_hardware/gz_quadruped_plugin.hpp
+++ b/hardwares/gz_quadruped_hardware/include/gz_quadruped_hardware/gz_quadruped_plugin.hpp
@@ -15,18 +15,25 @@
#include
+#ifdef GZ_HEADERS
#include
namespace sim = gz::sim;
+#else
+#include
+namespace sim = ignition::gazebo;
+#endif
-namespace gz_quadruped_hardware {
+namespace gz_quadruped_hardware
+{
// Forward declarations.
class GazeboSimQuadrupedPluginPrivate;
class GazeboSimQuadrupedPlugin
- : public sim::System,
- public sim::ISystemConfigure,
- public sim::ISystemPreUpdate,
- public sim::ISystemPostUpdate {
+ : public sim::System,
+ public sim::ISystemConfigure,
+ public sim::ISystemPreUpdate,
+ public sim::ISystemPostUpdate
+ {
public:
/// \brief Constructor
GazeboSimQuadrupedPlugin();
@@ -36,22 +43,22 @@ namespace gz_quadruped_hardware {
// Documentation inherited
void Configure(
- const sim::Entity &_entity,
- const std::shared_ptr &_sdf,
- sim::EntityComponentManager &_ecm,
- sim::EventManager &_eventMgr) override;
+ const sim::Entity& _entity,
+ const std::shared_ptr& _sdf,
+ sim::EntityComponentManager& _ecm,
+ sim::EventManager& _eventMgr) override;
// Documentation inherited
void PreUpdate(
- const sim::UpdateInfo &_info,
- sim::EntityComponentManager &_ecm) override;
+ const sim::UpdateInfo& _info,
+ sim::EntityComponentManager& _ecm) override;
void PostUpdate(
- const sim::UpdateInfo &_info,
- const sim::EntityComponentManager &_ecm) override;
+ const sim::UpdateInfo& _info,
+ const sim::EntityComponentManager& _ecm) override;
private:
/// \brief Private data pointer.
std::unique_ptr dataPtr;
};
-} // namespace gz_ros2_control
+}
diff --git a/hardwares/gz_quadruped_hardware/include/gz_quadruped_hardware/gz_system.hpp b/hardwares/gz_quadruped_hardware/include/gz_quadruped_hardware/gz_system.hpp
index f376201..e252275 100644
--- a/hardwares/gz_quadruped_hardware/include/gz_quadruped_hardware/gz_system.hpp
+++ b/hardwares/gz_quadruped_hardware/include/gz_quadruped_hardware/gz_system.hpp
@@ -13,7 +13,6 @@
// limitations under the License.
#pragma once
-
#include