srv / srv_tools

ROS-Stack with some tools
63 stars 56 forks source link

bag_add_time_offset fails to run #25

Open J-Rojas opened 5 years ago

J-Rojas commented 5 years ago

There's some incorrect code after running the bag_add_time_offset.py file

Traceback (most recent call last):
  File "/home/jrojas/work/projects/ros_stuff/catkin_ws/src/srv_tools/bag_tools/scripts/bag_add_time_offset.py", line 78, in <module>
    fix_bagfile(args.i, args.o, arg.t, args.of)
NameError: name 'arg' is not defined

I managed to fix this, then received another error:

Traceback (most recent call last):
  File "/home/jrojas/work/projects/ros_stuff/catkin_ws/src/srv_tools/bag_tools/scripts/bag_add_time_offset.py", line 78, in <module>
    fix_bagfile(args.i, args.o, args.t, args.of)
  File "/home/jrojas/work/projects/ros_stuff/catkin_ws/src/srv_tools/bag_tools/scripts/bag_add_time_offset.py", line 56, in fix_bagfile
    for topic, msg, t in rosbag.Bag(inbag).read_messages():
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/bag.py", line 458, in __init__
    self._open(f, mode, allow_unindexed)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/bag.py", line 1415, in _open
    if   mode == 'r': self._open_read(f, allow_unindexed)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/bag.py", line 1437, in _open_read
    self._file     = open(f, 'rb')
TypeError: coercing to Unicode: need string or buffer, list found

I will send a PR to fix these.

hanliming08 commented 4 years ago

fix_bagfile(args.i, args.o, arg.t, args.of) fix_bagfile(args.i, args.o, args.t, args.of)