fix(simulation): Gazebo Harmonic Name() API + SITL integration (Phases A–C + GUI)#49
Merged
Conversation
- CMakeLists: replace find_package(gazebo) with gz-sim8/gz-transport13/gz-plugin2 - Headers: inherit gz::sim::System+ISystemConfigure+ISystemPreUpdate/PostUpdate instead of ModelPlugin; drop all <gazebo/...> includes; use gz::sim::Entity members and gz::transport::Node (value, not pointer) - Sources: Configure() replaces Load(); PreUpdate()/PostUpdate() replace WorldUpdateBegin callbacks; joint velocities via JointVelocityCmd component; forces via ExternalWorldWrenchCmd; topic names use /model/<name>/cmd_vel absolute path (no tilde); GZ_ADD_PLUGIN replaces GZ_REGISTER_MODEL_PLUGIN - Fix: remove .value_or() from gz::sim::Model::Name() and World::Name() calls — Harmonic returns std::string directly, not std::optional<std::string> - Dockerfile: convert to two-stage multi-stage build; add X11/Mesa GUI packages (libgl1-mesa-dri, libx11-6, etc.) for display forwarding Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ros2.Dockerfile: install ros-${ROS_DISTRO}-ros-gz-bridge/sim; fall back
to git-cloning ros_gz from source if apt overlay lacks the packages
- sim.launch.py: add use_external_gz arg with UnlessCondition so the
Compose gazebo service is not double-started inside the ROS 2 container
- compose.yaml: set GZ_IP/GZ_PARTITION env vars on both gazebo and ros2
services (required for gz-transport peer discovery across bridge network);
change ros2 depends_on gazebo to service_healthy; pass use_external_gz:=true
in the launch command; add Gazebo GUI support via DISPLAY passthrough,
/tmp/.X11-unix bind-mount, LIBGL_ALWAYS_SOFTWARE=1 for Mesa llvmpipe
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…un support sim_adapter (Phase C): - New SITL-only cFS app: receives CCSDS SPPs on UDP port 5700, validates APID (0x500–0x57F) and CRC-16/CCITT-FALSE, routes valid packets to the cFE Software Bus via SIM_INJECT_HK_MID - Entire body guarded by #ifndef CFS_FLIGHT_BUILD — zero symbols in flight image - 6 CMocka unit tests (all passing): CRC known vector, short packet, APID out of range, CRC mismatch, valid packet routed, init socket failure - _defs/mids.h: add SIM_ADAPTER_CMD_MID 0x1D00, SIM_ADAPTER_HK_MID 0x0D01 - Priority 95 in cfe_es_startup.scr (between MCU gateways and CDH) Gazebo GUI (make run): - Makefile: run xhost +local:docker before compose up; print display status - compose.yaml gazebo: DISPLAY passthrough + /tmp/.X11-unix bind-mount + LIBGL_ALWAYS_SOFTWARE=1; command detects $$DISPLAY at runtime — full GUI when display available, server-only (-s) when headless Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cppcheck [variableScope]: move bytes_recv declaration inside the while loop body in SIM_ADAPTER_AppMain — cppcheck --enable=all reports variableScope when a variable is declared at function scope but only used in a sub-block. apid-mid-lint [R1]: add Sim Injection Sub-Allocation section to docs/interfaces/apid-registry.md with an explicit row for APID 0x501 (SIM_ADAPTER_HK_MID). The range row 0x500-0x57F only registers 0x500 in the lint's set; 0x501 needed its own explicit row to satisfy R1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gz::sim::Model::Name(ecm)andWorld::Name(ecm)returnstd::stringin Gazebo Harmonic (gz-sim8), notstd::optional<std::string>— removes four invalid.value_or()calls that caused Docker build failuresModelPlugin,physics::ModelPtr,transport::NodePtr) to Harmonic ECM-based API (ISystemConfigure,ISystemPreUpdate/PostUpdate,JointVelocityCmd,ExternalWorldWrenchCmd); convertgazebo.Dockerfileto two-stage multi-stage build with compiled.sofilesros_gz_bridgein the ROS 2 Docker image; adduse_external_gzarg tosim.launch.py; setGZ_IP/GZ_PARTITIONenv vars in Compose for gz-transport cross-container peer discoverysim_adaptercFS app — receives CCSDS SPPs on UDP 5700, validates APID (0x500–0x57F) and CRC-16/CCITT-FALSE, routes to Software Bus; guarded by#ifndef CFS_FLIGHT_BUILD; 6/6 CMocka tests passingmake runopens Gazebo 3D window on a desktop (X11 forwarded via/tmp/.X11-unix; Mesa llvmpipe software renderer — no GPU required); falls back to headless when$DISPLAYis unsetTest plan
ctest --test-dir build --output-on-failure— all 14 unit tests pass (includes 6 new sim_adapter tests)cmake -B build_flight -DCFS_FLIGHT_BUILD=1 && cmake --build build_flight && nm build_flight/apps/sim_adapter/CMakeFiles/sim_adapter.dir/fsw/src/sim_adapter.c.o | grep SIM_ADAPTER || echo "GUARD OK"— no sim_adapter symbols in flight builddocker compose build gazebo— Dockerfile compiles all 4 plugins without errormake runon a Linux desktop with$DISPLAYset — Gazebo window opens;make runon headless CI — no error, Gazebo runs server-onlydocker exec sakura_ros2 ros2 node list—/gz_bridgepresent after stack starts🤖 Generated with Claude Code