DDS Communication Issue with Unitree SDK2 and MuJoCo Simulation
Description
The simulation is failing with a CycloneDDS assertion error when attempting to run the G1 robot simulation. The error occurs in the DDS writer initialization/usage.
unitree_mujoco: ./src/core/ddsc/src/dds_write.c:318: dds_writecdr_impl_common: Assertion `(wr->m_iox_pub == NULL) == (d->a.iox_chunk == NULL)' failed.
Environment
- OS: Ubuntu 22.04
- ROS 2: Humble
- System CycloneDDS version: 0.10.5 (ROS 2 package)
- Python CycloneDDS version: 0.10.2 (required by unitree-sdk2py)
Issue Details
There is a version mismatch between different CycloneDDS components:
- The system-wide ROS 2 CycloneDDS package is version 0.10.5
- The Python package
unitree-sdk2py specifically requires CycloneDDS version 0.10.2
- Attempts to align these versions have been unsuccessful:
- Cannot upgrade Python package due to
unitree-sdk2py dependency constraint
- Cannot downgrade ROS 2 package as version 0.10.2 is not available in repositories
Current Status
The version mismatch appears to be causing DDS communication issues between the simulation components. The simulation crashes with a DDS assertion error when attempting to initialize or use the DDS writer.
Potential Solutions
- Build and install ROS 2 CycloneDDS 0.10.2 from source
- Modify
unitree-sdk2py to support CycloneDDS 0.10.5
- Consider developing on Ubuntu 20.04 where package versions may be more aligned with the Unitree SDK2 development environment
Additional Context
The issue manifests when trying to run the G1 robot simulation using the unitree_mujoco framework. The error occurs in the DDS communication layer, specifically in the UnitreeSdk2Bridge component that handles communication between the simulation and the robot control interface.
Related Code
The DDS bridge initialization occurs in unitree_mujoco/simulate/src/unitree_sdk2_bridge/unitree_sdk2_bridge.cc:
UnitreeSdk2Bridge::UnitreeSdk2Bridge(mjModel *model, mjData *data) : mj_model_(model), mj_data_(data)
{
// Initialize the Unitree SDK2 channel factory
unitree::robot::ChannelFactory::Instance()->Init(1, "enp0s5"); // Using domain ID 1 and network interface enp0s5
// ...
}
DDS Communication Issue with Unitree SDK2 and MuJoCo Simulation
Description
The simulation is failing with a CycloneDDS assertion error when attempting to run the G1 robot simulation. The error occurs in the DDS writer initialization/usage.
unitree_mujoco: ./src/core/ddsc/src/dds_write.c:318: dds_writecdr_impl_common: Assertion `(wr->m_iox_pub == NULL) == (d->a.iox_chunk == NULL)' failed.Environment
Issue Details
There is a version mismatch between different CycloneDDS components:
unitree-sdk2pyspecifically requires CycloneDDS version 0.10.2unitree-sdk2pydependency constraintCurrent Status
The version mismatch appears to be causing DDS communication issues between the simulation components. The simulation crashes with a DDS assertion error when attempting to initialize or use the DDS writer.
Potential Solutions
unitree-sdk2pyto support CycloneDDS 0.10.5Additional Context
The issue manifests when trying to run the G1 robot simulation using the unitree_mujoco framework. The error occurs in the DDS communication layer, specifically in the
UnitreeSdk2Bridgecomponent that handles communication between the simulation and the robot control interface.Related Code
The DDS bridge initialization occurs in
unitree_mujoco/simulate/src/unitree_sdk2_bridge/unitree_sdk2_bridge.cc: