CARLA数据提取键错误与Rosbags
我是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
除了主题/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:
Everything works fine except for the topic /carla/ego_vehicle/vehicle_control_cmd_manual which gives an error like this
Please tell me what I'm doing wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否在运行此操作的计算机上安装了这些消息文件?如果没有,则需要通过
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