Skip to main content
added 2 characters in body
Source Link

Good day everyone,

I've been struggling with this for two days now. and I can't seem to find a solution. I have a dictionary with topic names and their types, what is the correct module to read the message using rcl?

while reader.has_next():
    topic, message, timestamp = reader.read_next()
    if topic in topic_names:
        message_type_str = topics_dict.get(topic)
        msg = _rclpy.rclpy_deserialize(message, message_type_str)
        print(msg)
        # msg_type = get_message(msg_type_str)
        # msg = deserialize_message(message, msg_type)
        # print(msg)
        # print(topic)
        # print(message_type)
        # print("===================================")

Good day everyone,

I've been struggling with this for two days now. and I can't seem to find a solution. I have dictionary with topic names and their types, what is the correct module to read the message using rcl?

while reader.has_next():
    topic, message, timestamp = reader.read_next()
    if topic in topic_names:
        message_type_str = topics_dict.get(topic)
        msg = _rclpy.rclpy_deserialize(message, message_type_str)
        print(msg)
        # msg_type = get_message(msg_type_str)
        # msg = deserialize_message(message, msg_type)
        # print(msg)
        # print(topic)
        # print(message_type)
        # print("===================================")

Good day everyone,

I've been struggling with this for two days now. and I can't seem to find a solution. I have a dictionary with topic names and their types, what is the correct module to read the message using rcl?

while reader.has_next():
    topic, message, timestamp = reader.read_next()
    if topic in topic_names:
        message_type_str = topics_dict.get(topic)
        msg = _rclpy.rclpy_deserialize(message, message_type_str)
        print(msg)
        # msg_type = get_message(msg_type_str)
        # msg = deserialize_message(message, msg_type)
        # print(msg)
        # print(topic)
        # print(message_type)
        # print("===================================")
Source Link

Cannot get the message using rosbag2 and rclpy

Good day everyone,

I've been struggling with this for two days now. and I can't seem to find a solution. I have dictionary with topic names and their types, what is the correct module to read the message using rcl?

while reader.has_next():
    topic, message, timestamp = reader.read_next()
    if topic in topic_names:
        message_type_str = topics_dict.get(topic)
        msg = _rclpy.rclpy_deserialize(message, message_type_str)
        print(msg)
        # msg_type = get_message(msg_type_str)
        # msg = deserialize_message(message, msg_type)
        # print(msg)
        # print(topic)
        # print(message_type)
        # print("===================================")