[ros2 bag] DDS 설정

cassisOrg·2024년 4월 19일

4월 3주차

목록 보기
2/3

환경: ubuntu 22.04, ros2 humble, cyclonedds


가제보 오류 시

. /usr/share/gazebo/setup.sh


ros2 nav2 navigation 프로젝트

최종 버전 배포 전 ros2 bag 패키지도 추가하려고 했으나

실행하자 다음과 같은 오류가 발생했다.


ros2 bag을 마지막에 추가했기 때문에
운좋게도 원인이 bag 때문임을 바로 알 수 있었다.


원인은 cyclondedds와 rosbag 간의 충돌이었다.

해결방법은 다음과 같다.


home 디렉토리에 <폴더>/<xml파일> 을 만들어 준다.

<CycloneDDS>
  <Domain>
    <General>
      <AllowMulticast>false</AllowMulticast>
    </General>
    <Discovery>
      <ParticipantIndex>auto</ParticipantIndex>
      <MaxAutoParticipantIndex>1000</MaxAutoParticipantIndex>
    </Discovery>
  </Domain>
</CycloneDDS>

위 코드를 넣어준다.



export CYCLONEDDS_URI="file://$HOME/CycloneDDS/my_config.xml"

.bashrc에 위 코드를 추가한다.


오류가 발생한 이유는 제작한 navigation 패키지 내부에서 몇몇 토픽이 다중으로 pub / sub 되는 구조이다.

multicast : 1 vs n 통신

broadcast : n vs n 통신

multicast 에서 broadcast 로 바꿔준다.


dds 버전 확인

dpkg -l | grep dds

참고 :

https://answers.ros.org/question/408754/ros2-galacitc-failed-to-find-a-free-participant-index-for-domain/

https://cyclonedds.io/docs/cyclonedds/latest/config/index.html

0개의 댓글