# [ERROR] [rmw_fastrtps_cpp]: create_publisher() failed: DDS create_publisher failed

- **ID:** `ros2/rmw-fail-fast-no-interface`
- **Domain:** ros2
- **Category:** communication_error
- **Error Code:** `RMW-0001`
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

Fast DDS publisher creation fails when the node's topic type is not registered or the DDS domain participant is in an inconsistent state, often due to missing type support library or premature shutdown.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| ROS2 Humble (Hawksbill) | active | — | — |
| ROS2 Iron (Irwini) | active | — | — |
| ROS2 Jazzy (Jalisco) | active | — | — |

## Workarounds

1. **Ensure the node's topic type is explicitly registered before creating the publisher. In Python, call `node.declare_parameter('use_sim_time', False)` and then `node.create_publisher(MyMsg, 'topic', 10)` after a short sleep to allow DDS to initialize.** (85% success)
   ```
   Ensure the node's topic type is explicitly registered before creating the publisher. In Python, call `node.declare_parameter('use_sim_time', False)` and then `node.create_publisher(MyMsg, 'topic', 10)` after a short sleep to allow DDS to initialize.
   ```
2. **In C++, add a small delay (e.g., `std::this_thread::sleep_for(std::chrono::milliseconds(100))`) after creating the node and before creating the publisher to ensure the DDS participant is fully ready.** (80% success)
   ```
   In C++, add a small delay (e.g., `std::this_thread::sleep_for(std::chrono::milliseconds(100))`) after creating the node and before creating the publisher to ensure the DDS participant is fully ready.
   ```

## Dead Ends

- **** — Reinstalling rmw_fastrtps_cpp via apt-get doesn't help because the issue is type registration, not the middleware installation. (60% fail)
- **** — Changing RMW_IMPLEMENTATION to rmw_cyclonedds_cpp may mask the problem but doesn't fix the underlying DDS participant state, and can introduce new compatibility issues. (70% fail)
