Error in doc
On the page https://ternaris.gitlab.io/rosbags/topics/rosbag2.html I tried to go throw the example:
from rosbags.rosbag2 import Writer
from rosbags.serde import serialize_cdr
from rosbags.typesys.types import std_msgs__msg__String as String
# create writer instance and open for writing
with Writer('/home/ros/rosbag_2020_03_24') as writer:
# add new connection
topic = '/chatter'
msgtype = String.__msgtype__
connection = writer.add_connection(topic, msgtype, 'cdr', '')
# serialize and write message
message = String('hello world')
writer.write(connection, timestamp, serialize_cdr(message, msgtype))
But the timestamp
varible wasn't defined
NameError: name 'timestamp' is not defined
I fixed by adding: timestamp = 1
Edited by motybz