rebuild bagfile from csv with Error: 'list' object has no attribute 'header'
Hello, I am working on rebuilding bagfile from csv file, and I am stuck at the tf part. As the structure of the tf is like this:
Here is what I have done, with the 'list' object has no attribute 'header' error:
import csv
import rospy
import rosbag
from tf.msg import tfMessage
with rosbag.Bag('rebuild.bag', 'w') as bag:
with open('tf.csv', 'r') as csvFile:
reader = csv.reader(csvFile)
for row in reader:
tf_msg = [tfMessage().transforms]
tf_msg[0].header.seq = int(row[1])
Sorry this looks more like a python question, I cannot figure out how to initialize a tfMessage instance...