ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

echoing messages from a rosbag in a docker conatiner

asked 2021-10-25 16:20:38 -0500

ngel.dvis gravatar image

updated 2021-10-26 07:49:32 -0500

lucasw gravatar image

I have a rosbag file that publishes custom messages to a topic. I want to be able to echo these messages inside a docker container. The rosbag can run either in the docker container or on my local machine, either work. Currently I've tried to run it on my local machine but get this error when the docker container tries to echo:

[ERROR] [1635193778.825277136]: Client wants topic <TOPIC> to have datatype/md5sum [<MSG_TYPE>/adf48fd02b6cd4b1ea3d615551fe75fb], but our version has [<MSG_TYPE>/38b2ab4d4630320405ac61f4c1028689]. Dropping connection.

Is there any way to resolve this conflict?

Dockerfile

ARG ROS_VERSION=noetic
ARG VERSION=1

FROM ros:${ROS_VERSION}
RUN apt-get update
COPY ./catkin_ws .    
WORKDIR /catkin_ws

docker-compose.yml

version: '3.5'

services:
  ros-master:
    image: ros:noetic
    command: stdbuf -o L roscore
    network_mode: host
    restart: always

  listener:
    image: ros:noetic
    build:
      context: .
    depends_on:
      - ros-master
    environment:  
      - "ROS_MASTER_URI=${ROS_MASTER_URI}"
      - "ROS_HOSTNAME=listener"
    command: bash -c "catkin_make && source devel/setup.bash && rostopic echo <TOPIC>"
    network_mode: host
    restart: always
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-26 02:18:38 -0500

gvdhoorn gravatar image

updated 2021-10-26 02:19:39 -0500

The "conflict" you report is caused by something publishing messages on a topic and something else trying to subscribe to them, but the expected message contents is not the published contents.

In other words: the subscriber and publisher disagree on either:

  • the type of message on the topic, or
  • the exact contents of the message type on the topic

there is no way to "resolve" this, other than using the same messages on both sides (in case of a version issue) or making sure subscribers are subscribing to the correct topics (with the correct types).

I don't believe the fact you're using Docker add anything here (different versions of messages is not something impossible to achieve, even with just a single ROS installation on a single OS / host).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-10-25 16:20:38 -0500

Seen: 390 times

Last updated: Oct 26 '21