Skip to content

Port the lunar pole exploration rover plugins and model to Gazebo Harmonic, keeping Fortress (closes #47) - #48

Open
asimonov wants to merge 2 commits into
space-ros:mainfrom
asimonov:lunar_pole_harmonic
Open

Port the lunar pole exploration rover plugins and model to Gazebo Harmonic, keeping Fortress (closes #47)#48
asimonov wants to merge 2 commits into
space-ros:mainfrom
asimonov:lunar_pole_harmonic

Conversation

@asimonov

@asimonov asimonov commented Sep 4, 2026

Copy link
Copy Markdown
Member

Closes #47.

Makes the lunar pole exploration rover's power system plugins and model build and run on Gazebo Harmonic / ROS 2 Jazzy while keeping Ignition Fortress / ROS 2 Humble working. Two commits:

  1. Build the Gazebo plugins for Harmonic as well as FortressSolarPanelPlugin, RechargeableBatteryPlugin, SensorPowerSystemPlugin and RadioisotopeThermalGeneratorPlugin now target the gz-sim 8 API (gz::sim / gz::rendering / gz::sensors, gz/ headers, GZ_ADD_PLUGIN, gz* console macros, per-message includes for gz-msgs 10). Fortress ships gz/ redirect headers for all of those namespaces but not for the GZ_ / gz prefixed macros, so a 60-line plugins/gz_compat.hh maps those onto their Ignition names when absent. One source tree builds on both; CMakeLists.txt and package.xml pick the Ignition system packages on Humble and the ROS gz_*_vendor packages otherwise (so on Jazzy the plugins link against the same libraries as ros_gz and gz_ros2_control), and the environment hook sets both IGN_GAZEBO_* and GZ_SIM_* paths so Harmonic finds the meshes and plugins (the hook part of Update to Gazebo Harmonic/Jazzy #36). Since Building packages on jazzy that include simulation breaks due to missing humble dependencies #41 the plugins were excluded from non-Humble builds; this makes them available again.
  2. Make the lunar pole rover model work on Fortress and Harmonic — xacro properties keyed on ROS_DISTRO select ign_ros2_control/IgnitionSystem + ignition-gazebo-*-system or gz_ros2_control/GazeboSimSystem + gz-sim-*-system, so the one model serves both the existing Humble demo and the Jazzy one. The rover's controller configuration also moves here, next to the model, instead of being referenced through $(find lunar_pole_exploration_rover) in the demos repository (as the curiosity rover's is).

The canadarm, curiosity and lunar terrain models are untouched. Running the ported SolarPanelPlugin on Harmonic exposes a thread-safety bug in it (#44); the fix is a separate PR stacked on this one, and the Jazzy demo (space-ros/demos#165) needs both.

Effect on consumers

Every demo that builds this package on Jazzy (space_robots, lunar_terrain) previously got a simulation package with no plugins; it now compiles the four plugins as well, which adds well under a minute to the build and declares gz_{sim,plugin,common,rendering,sensors}_vendor as dependencies — the same vendor stack both demos already pull in for ros_gz and gz_ros2_control (space_robots builds those from source; lunar_terrain installs ros-jazzy-ros-gz), so no new class of dependency. Nothing those demos take from the package (the model directories) changes. On Humble (lunar_pole_exploration_rover on main) the build is the same as before.

Checked by building the current demos main Dockerfiles of all three against this branch plus the #44 fix (arm64, one edit each to clone the branch instead of main): lunar_pole_exploration_rover on Humble (67 packages), space_robots (53 packages) and lunar_terrain (11 packages) all build clean. The Humble image was also run headless: the server stays up with all four plugins loaded from the image build, the solar panel publishes ~106.7 W and the battery 30 V / 100 %, with no crash output.

Verification on Harmonic

With the #44 fix on top, the Jazzy demo from space-ros/demos#165 built against this branch and run headless (gz sim -s --headless-rendering): all four ros2_control controllers active, the rover drives and rotates through the demo services, the left solar panel reports 106.786 W at rest (the same reading the Fortress build gives) and rises to ~129 W as the rover turns, the battery reports 30 V / 100 %, the sensor activation switches change the power consumption, and all eight 2048x2048 mono16 cameras deliver frames. Every topic, service, joint and frame in the demo README was checked against a live run with the GUI.

…).

SolarPanelPlugin, RechargeableBatteryPlugin, SensorPowerSystemPlugin and
RadioisotopeThermalGeneratorPlugin were written against the Ignition Fortress
API and, since space-ros#41, only built on Humble. They now target the Gazebo Harmonic
(gz-sim 8) API: gz::sim, gz::rendering and gz::sensors namespaces, gz/ header
paths, the GZ_ADD_PLUGIN registration macros and the gz* console macros. Each
message type gets its own include, as gz-msgs 10 no longer provides them
transitively.

Fortress ships gz/ redirect headers for all of these namespaces but not for
the GZ_ / gz prefixed macros, so plugins/gz_compat.hh maps those onto their
Ignition names when they are missing. One set of sources therefore builds on
both distributions; CMakeLists.txt and package.xml select the Ignition system
packages on Humble and the ROS gz_*_vendor packages otherwise, and the
environment hook sets both IGN_GAZEBO_* and GZ_SIM_* paths.
…ros#47).

The ros2_control hardware plugin and the Gazebo system plugins have different
names on the two: ign_ros2_control/IgnitionSystem and ignition-gazebo-*-system
on Fortress, gz_ros2_control/GazeboSimSystem and gz-sim-*-system on Harmonic.
xacro properties keyed on ROS_DISTRO select the right set, so the same model
serves the Humble demo and the Jazzy one.

The gz_ros2_control plugin also referenced its controller configuration via
$(find lunar_pole_exploration_rover), coupling the model to a package in the
demos repository. The configuration now lives with the model, as the curiosity
rover's does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port the lunar pole exploration rover plugins and model to Gazebo Harmonic (keeping Fortress)

1 participant