Skip to content

ROS2 Issue on Ubuntu 22? #60

Description

@dcmcshan

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:

  1. The system-wide ROS 2 CycloneDDS package is version 0.10.5
  2. The Python package unitree-sdk2py specifically requires CycloneDDS version 0.10.2
  3. 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

  1. Build and install ROS 2 CycloneDDS 0.10.2 from source
  2. Modify unitree-sdk2py to support CycloneDDS 0.10.5
  3. 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
    // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions