CARLA数据提取键错误与Rosbags

发布于 2025-02-09 04:40:44 字数 1111 浏览 1 评论 0原文

我是Ros和Carla的新手,但是我正在做一个模仿学习的项目,需要从ROS中提取数据。我正在使用此库 rosbags 检索数据。

使用其他数据(例如图像和速度),我可以轻松提取和应使用以下代码进行序列化。

from rosbags.rosbag2 import Reader
from rosbags.serde import deserialize_cdr

def print_data(topic):
    with Reader('carla_data') as reader:
        for i, (connection, timestamp, rawdata) in enumerate(reader.messages()):
            if connection.topic == topic:
                msg = deserialize_cdr(rawdata, connection.msgtype)
                print(i, msg)
                break

我有来自ROS的主题的数据:

除了主题/carla/ego_vehicle/warter_control_cmd_manual ,一切都很好,但一切都很好

请告诉我我在做什么错。

I'm pretty new to ROS and Carla, but I'm doing a project on imitation learning that needs to extract data from ROS. I'm using this library rosbags to retrieve data.

With other datas like image and speed, I could easily extract and deserialize with the following code.

from rosbags.rosbag2 import Reader
from rosbags.serde import deserialize_cdr

def print_data(topic):
    with Reader('carla_data') as reader:
        for i, (connection, timestamp, rawdata) in enumerate(reader.messages()):
            if connection.topic == topic:
                msg = deserialize_cdr(rawdata, connection.msgtype)
                print(i, msg)
                break

I have data from topics from ROS for the following:
tpoics from ROS

Everything works fine except for the topic /carla/ego_vehicle/vehicle_control_cmd_manual which gives an error like this
enter image description here

Please tell me what I'm doing wrong.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我是男神闪亮亮 2025-02-16 04:40:44

您是否在运行此操作的计算机上安装了这些消息文件?如果没有,则需要通过apt(或您使用的任何包装管理器。安装

消息是在Python文件中导入它们,因此它具有一个消息说明可以工作。例如, 来自carla_msgs.msg导入carlaegovehiclecontrol

Do you have those message files installed on the computer you’re running this on? If not, they need to be installed via apt(or whatever package manager you use.

It messages are installed you should be importing them in your Python file, so it has a message description to work off. e.g. from carla_msgs.msg import CarlaEgoVehicleControl

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文