Robotics StackExchange | Archived questions

ros2 bag record: Implausible warnings

I'm running ROS2 foxy on Ubuntu 20.04, both on WSL and on native aarch.

I'm publishing topic with qos sensor profile:

// Quality of service: Sensor default, but queue size of 1
  static const rclcpp::QoS default_qos = rclcpp::QoS(rclcpp::KeepLast(1), rmw_qos_profile_sensor_data);

  // Publisher
  pub = this->create_publisher<my_pkg::msg::MyMsgT>("myMsg", default_qos);

On ros2, I see proper settings for this topic:

$ros2 topic info /myMsg --verbose
Type: my_pkg/msg/MyMsgT

Publisher count: 1

Node name: _NODE_NAME_UNKNOWN_
Node namespace: _NODE_NAMESPACE_UNKNOWN_
Topic type: my_pkg/msg/MyMsgT
Endpoint type: PUBLISHER
GID: 01.0f.42.19.bd.1a.17.df.01.00.00.00.00.00.19.03.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT
  Durability: RMW_QOS_POLICY_DURABILITY_VOLATILE
  Lifespan: 2147483651294967295 nanoseconds
  Deadline: 2147483651294967295 nanoseconds
  Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
  Liveliness lease duration: 2147483651294967295 nanoseconds

Subscription count: 0

When running ros2 bag record, I see random warnings which appear and disappear on every start:

$ros2 bag record -a
[INFO] [1683889007.313020116] [rosbag2_storage]: Opened database 'rosbag2_2023_05_12-12_56_47/rosbag2_2023_05_12-12_56_47_0.db3' for READ_WRITE.
[INFO] [1683889007.323326234] [rosbag2_transport]: Listening for topics...
....
[WARN] [1683889007.443336458] [rosbag2_transport]: A new publisher for subscribed topic /myMsgwas found offering RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT, but rosbag already subscribed requesting RMW_QOS_POLICY_RELIABILITY_RELIABLE. Messages from this new publisher will not be recorded.

Unfortunately it refrains these topics to be recorded at all and I need to restart measurement until I don't see such a warning. The warning changes between different topics all the time.

The same issue, but for galactic is mentioned here: https://github.com/ros2/rosbag2/issues/830

Any idea on how to prevent this?

Asked by holunder on 2023-05-12 06:08:22 UTC

Comments

Answers